From a2ce1c0cb1331551ff728dcfe3260fab4cd827e5 Mon Sep 17 00:00:00 2001 From: Samba Release Account Date: Thu, 31 Jul 1997 18:47:26 +0000 Subject: 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 Jeremy (jallison@whistle.com) --- source/lib/util.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'source/lib/util.c') 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); +} -- cgit v1.2.1