summaryrefslogtreecommitdiff
path: root/source3/lib/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r--source3/lib/util.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 51bb2b4a16..9982d105ad 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -74,6 +74,7 @@ pstring user_socket_options="";
pstring sesssetup_user="";
pstring myname = "";
fstring myworkgroup = "";
+char **my_netbios_names;
int smb_read_error = 0;
@@ -834,7 +835,7 @@ int StrnCaseCmp(const char *s, const char *t, int n)
/*******************************************************************
compare 2 strings
********************************************************************/
-BOOL strequal(char *s1,char *s2)
+BOOL strequal(const char *s1, const char *s2)
{
if (s1 == s2) return(True);
if (!s1 || !s2) return(False);
@@ -845,7 +846,7 @@ BOOL strequal(char *s1,char *s2)
/*******************************************************************
compare 2 strings up to and including the nth char.
******************************************************************/
-BOOL strnequal(char *s1,char *s2,int n)
+BOOL strnequal(const char *s1,const char *s2,int n)
{
if (s1 == s2) return(True);
if (!s1 || !s2 || !n) return(False);
@@ -3741,3 +3742,20 @@ void file_unlock(int fd)
#endif
close(fd);
}
+
+/*******************************************************************
+is the name specified one of my netbios names
+returns true is it is equal, false otherwise
+********************************************************************/
+BOOL is_myname(const char *s)
+{
+ int n;
+ BOOL ret = False;
+
+ for (n=0; my_netbios_names[n]; n++) {
+ if (strequal(my_netbios_names[n], s))
+ ret=True;
+ }
+ DEBUG(8, ("is_myname(\"%s\") returns %d\n", s, ret));
+ return(ret);
+}