diff options
author | Jeremy Allison <jra@samba.org> | 1998-01-27 06:55:38 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-01-27 06:55:38 +0000 |
commit | b843aa94149375ef559c1f4e4572bf6632860bce (patch) | |
tree | 8203086c422813ef49ce606e98d2b600ef732685 /source | |
parent | 519926b97afc9264bab620103126bad4d59aab2f (diff) | |
download | samba-b843aa94149375ef559c1f4e4572bf6632860bce.tar.gz samba-b843aa94149375ef559c1f4e4572bf6632860bce.tar.xz samba-b843aa94149375ef559c1f4e4572bf6632860bce.zip |
asyncdns.c: Fixed shutdown bug where nmbd would hang.
nmbd_winsserver.c: Allow spaces in WINS names.
Jeremy.
Diffstat (limited to 'source')
-rw-r--r-- | source/nmbd/asyncdns.c | 12 | ||||
-rw-r--r-- | source/nmbd/nmbd_winsserver.c | 2 |
2 files changed, 13 insertions, 1 deletions
diff --git a/source/nmbd/asyncdns.c b/source/nmbd/asyncdns.c index ee3fdfcd17c..3b71369d670 100644 --- a/source/nmbd/asyncdns.c +++ b/source/nmbd/asyncdns.c @@ -187,6 +187,9 @@ void run_dns_queue(void) if (fd_in == -1) return; + /* Allow SIGTERM to kill us. */ + BlockSignals(False, SIGTERM); + if (!process_exists(child_pid)) { close(fd_in); start_async_dns(); @@ -197,9 +200,12 @@ void run_dns_queue(void) DEBUG(0,("Incomplete DNS answer from child!\n")); fd_in = -1; } + BlockSignals(True, SIGTERM); return; } + BlockSignals(True, SIGTERM); + namerec = add_dns_result(&r.name, r.result); if (dns_current) { @@ -305,8 +311,14 @@ BOOL queue_dns_query(struct packet_struct *p,struct nmb_name *question, DEBUG(3,("DNS search for %s - ", namestr(question))); + /* Unblock TERM signal so we can be killed in DNS lookup. */ + BlockSignals(False, SIGTERM); + dns_ip.s_addr = interpret_addr(qname); + /* Re-block TERM signal. */ + BlockSignals(True, SIGTERM); + *n = add_dns_result(question, dns_ip); if(*n == NULL) send_wins_name_query_response(NAM_ERR, p, NULL); diff --git a/source/nmbd/nmbd_winsserver.c b/source/nmbd/nmbd_winsserver.c index eb120e09188..553a4e72f90 100644 --- a/source/nmbd/nmbd_winsserver.c +++ b/source/nmbd/nmbd_winsserver.c @@ -1548,7 +1548,7 @@ void wins_write_database(void) if (namerec->source == REGISTER_NAME) { - fprintf(fp, "%s#%02x %d ", + fprintf(fp, "\"%s#%02x\" %d ", namerec->name.name,namerec->name.name_type, /* Ignore scope. */ (int)namerec->death_time); |