summaryrefslogtreecommitdiff
path: root/source3/nameserv.c
diff options
context:
space:
mode:
authorSamba Release Account <samba-bugs@samba.org>1997-05-31 01:11:40 +0000
committerSamba Release Account <samba-bugs@samba.org>1997-05-31 01:11:40 +0000
commitd98bea900ee694cdba83149620c65bd7f8765f26 (patch)
tree23d2ee7a6fc586dbfbbc2961c3214455f645cc61 /source3/nameserv.c
parent5c4776f496d814b0ab5b75b5d029dc0998236365 (diff)
downloadsamba-d98bea900ee694cdba83149620c65bd7f8765f26.tar.gz
samba-d98bea900ee694cdba83149620c65bd7f8765f26.tar.bz2
samba-d98bea900ee694cdba83149620c65bd7f8765f26.zip
namepacket.c: Block SIGTERM correctly - we can only take them at defined points.
nameserv.c: Fixup name release code - used when we are going down. nameservreply.c: Relaxed check for deleting name - original code never deleted. nmbd.c: Block SIGTERM signals most of the time - see comment on namepacket above. Jeremy (jallison@whistle.com) (This used to be commit 9f4e01224751134c2f7701e2aea87d06a79d77a4)
Diffstat (limited to 'source3/nameserv.c')
-rw-r--r--source3/nameserv.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/nameserv.c b/source3/nameserv.c
index 93111eb268..aba7ddadb6 100644
--- a/source3/nameserv.c
+++ b/source3/nameserv.c
@@ -62,12 +62,18 @@ void remove_name_entry(struct subnet_record *d, char *name,int type, BOOL direct
a de-registration packet to the local subnet before removing the
name from its local-subnet name database. */
+ int search = FIND_SELF;
struct name_record n;
struct name_record *n2=NULL;
make_nmb_name(&n.name,name,type,scope);
- if ((n2 = find_name_search(&d, &n.name, FIND_SELF, ipzero)))
+ if(d == wins_subnet)
+ search |= FIND_WINS;
+ else
+ search |= FIND_LOCAL;
+
+ if ((n2 = find_name_search(&d, &n.name, search, ipzero)))
{
/* check name isn't already being de-registered */
if (NAME_DEREG(n2->ip_flgs[0].nb_flags))
@@ -79,6 +85,14 @@ void remove_name_entry(struct subnet_record *d, char *name,int type, BOOL direct
if (!n2) return;
+ /* Only remove names with non-zero death times. */
+ if(n2->death_time == 0)
+ {
+ DEBUG(5,("remove_name_entry: Name %s(%d) has zero ttl - not removing.\n",
+ name, type));
+ return;
+ }
+
/* remove the name immediately. even if the spec says we should
first try to release them, this is too dangerous with our current
name structures as otherwise we will end up replying to names we