summaryrefslogtreecommitdiffstats
path: root/source/lib
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-07-31 18:47:26 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-07-31 18:47:26 +0000
commita2ce1c0cb1331551ff728dcfe3260fab4cd827e5 (patch)
treeb112cff9bc10ba5918a619459b9299bdd7b92a53 /source/lib
parent148b7a2ee3f520f31793d25ebe164a147f2afdfe (diff)
downloadsamba-a2ce1c0cb1331551ff728dcfe3260fab4cd827e5.tar.gz
samba-a2ce1c0cb1331551ff728dcfe3260fab4cd827e5.tar.xz
samba-a2ce1c0cb1331551ff728dcfe3260fab4cd827e5.zip
loadparm.c: Added new netbios aliases parameter (code from Cisco)
nameannounce.c: Code to announce aliases as well as our own names. namedbsubnet.c: Code to add the aliases to the server list. nameserv.c: Code to defend our aliases on the namelist. namework.c: Code to check it's one of our aliases. nmbd.c: Code to initialise the aliases. proto.h: Fixup protos. util.c: Code to check it's one of our aliases. All above code based on code for 1.9.16p11 donated by Cisco from Ben Woodard <bwoodard@luthien.cisco.com> Jeremy (jallison@whistle.com)
Diffstat (limited to 'source/lib')
-rw-r--r--source/lib/util.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source/lib/util.c b/source/lib/util.c
index 51bb2b4a16a..9982d105adc 100644
--- a/source/lib/util.c
+++ b/source/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);
+}