diff options
author | Tim Potter <tpot@samba.org> | 2003-09-29 06:22:55 +0000 |
---|---|---|
committer | Tim Potter <tpot@samba.org> | 2003-09-29 06:22:55 +0000 |
commit | 1052b52178fb4ce0e83ddfc48339d68d34fd43c3 (patch) | |
tree | 2f6ab4c5fe544f3bc77dc5b8413d91734f16e282 /source3 | |
parent | 981c82b16e82da859f7205cfc37ffe849e58b78c (diff) | |
download | samba-1052b52178fb4ce0e83ddfc48339d68d34fd43c3.tar.gz |
Merge from 3.0:
>Apply some NULL pointer paranoia to previous wins hook fix.
>Fix broken wins hook functionality. A i18n fixe caused the name type
>to be appended to the netbios name between angle brackets. This interfered
>the 'sh -c' used to implement smbrun(). Closes bug #528.
(This used to be commit 12659ae74965f8a088361cb4fbf8730cdad84af1)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nmbd/nmbd_winsserver.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source3/nmbd/nmbd_winsserver.c b/source3/nmbd/nmbd_winsserver.c index 484588c6626..36940724207 100644 --- a/source3/nmbd/nmbd_winsserver.c +++ b/source3/nmbd/nmbd_winsserver.c @@ -107,7 +107,7 @@ static void wins_hook(const char *operation, struct name_record *namerec, int tt { pstring command; char *cmd = lp_wins_hook(); - char *p; + char *p, *namestr; int i; if (!cmd || !*cmd) return; @@ -119,11 +119,17 @@ static void wins_hook(const char *operation, struct name_record *namerec, int tt } } + /* Use the name without the nametype (and scope) appended */ + + namestr = nmb_namestr(&namerec->name); + if ((p = strchr(namestr, '<'))) + *p = 0; + p = command; p += slprintf(p, sizeof(command)-1, "%s %s %s %02x %d", cmd, operation, - nmb_namestr(&namerec->name), + namestr, namerec->name.name_type, ttl); |