diff options
author | Samba Release Account <samba-bugs@samba.org> | 1997-07-31 18:47:26 +0000 |
---|---|---|
committer | Samba Release Account <samba-bugs@samba.org> | 1997-07-31 18:47:26 +0000 |
commit | 363b9a2739e9e39d1f69625e6647c6c9047a901a (patch) | |
tree | 1fb3f2f19bbcd15922468bf125ba1314220cd915 /source3/lib/util.c | |
parent | f2b7e75f0cbff28b082150ba5ec60617b92bd545 (diff) | |
download | samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.tar.gz samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.tar.xz samba-363b9a2739e9e39d1f69625e6647c6c9047a901a.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)
(This used to be commit a2ce1c0cb1331551ff728dcfe3260fab4cd827e5)
Diffstat (limited to 'source3/lib/util.c')
-rw-r--r-- | source3/lib/util.c | 22 |
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); +} |