From 28177ca73bdbe3f8fb17a608db3df1a39e0e37a4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 17 Aug 1996 11:37:44 +0000 Subject: - added support for Amiga-unix (based on BSD I think) - changed the order of PROGS and SPROGS in Makefile (SPROGS first) - another 64 bit cleanup (for INADDR_NONE) - added paranoia code in DirCacheAdd() to detect looping - fixed important DirCache flush bug - rewrote the NetServerEnum code after I found it could return servers from multiple workgroups at once, and this could cause browsing havoc. Now a null workgroup query is equivalent to a query for the servers primary workgroup - got rid of my_workgroup() - got rid of "workgroup = *" comment in Makefile. We no longer support a workgroup of *, users must set the workgroup explicitly - the wins.dat file was being stored in a different format to what it was being loaded in - this could cause havoc. fixed. - uppercase our netbios name and the workgroup name at startup - if accept fails in main loop when running as a daemon then continue, don't just exit! - don't use ./ on smbclient in smbtar - better code to detect if a process exists (This used to be commit ec3d53963064b50ff33e8eff47812aac82f164ba) --- source3/namedbname.c | 55 +++++++++++++++++++++++++--------------------------- 1 file changed, 26 insertions(+), 29 deletions(-) (limited to 'source3/namedbname.c') diff --git a/source3/namedbname.c b/source3/namedbname.c index 42ad9ad009..214926cfc9 100644 --- a/source3/namedbname.c +++ b/source3/namedbname.c @@ -230,17 +230,14 @@ void dump_names(void) { if (f && ip_equal(d->bcast_ip, ipgrp) && n->source == REGISTER) { - fstring data; - - /* XXXX i have little imagination as to how to output nb_flags as - anything other than as a hexadecimal number :-) */ - - sprintf(data, "%s#%02x %s %2x %ld", - n->name.name,n->name.name_type, /* XXXX ignore scope for now */ - inet_ntoa(n->ip), - n->nb_flags, - n->death_time); - fprintf(f, "%s\n", data); + /* XXXX i have little imagination as to how to output nb_flags as + anything other than as a hexadecimal number :-) */ + + fprintf(f, "%s#%02x %s %2x %ld\n", + n->name.name,n->name.name_type, /* XXXX ignore scope for now */ + inet_ntoa(n->ip), + n->nb_flags, + n->death_time); } DEBUG(3,("%15s ", inet_ntoa(d->bcast_ip))); @@ -294,12 +291,12 @@ void load_netbios_names(void) int type = 0; int nb_flags; time_t ttd; - struct in_addr ipaddr; + struct in_addr ipaddr; - enum name_source source; + enum name_source source; char *ptr; - int count = 0; + int count = 0; char *p; @@ -307,24 +304,24 @@ void load_netbios_names(void) if (*line == '#') continue; - ptr = line; - - if (next_token(&ptr,name_str ,NULL)) ++count; - if (next_token(&ptr,ip_str ,NULL)) ++count; - if (next_token(&ptr,ttd_str ,NULL)) ++count; - if (next_token(&ptr,nb_flags_str,NULL)) ++count; - - if (count <= 0) continue; - - if (count != 4) { - DEBUG(0,("Ill formed wins line")); - DEBUG(0,("[%s]: name#type ip nb_flags abs_time\n",line)); - continue; - } + ptr = line; + if (next_token(&ptr,name_str ,NULL)) ++count; + if (next_token(&ptr,ip_str ,NULL)) ++count; + if (next_token(&ptr,nb_flags_str,NULL)) ++count; + if (next_token(&ptr,ttd_str ,NULL)) ++count; + + if (count <= 0) continue; + + if (count != 4) { + DEBUG(0,("Ill formed wins line")); + DEBUG(0,("[%s]: name#type ip nb_flags abs_time\n",line)); + continue; + } + /* netbios name. # divides the name from the type (hex): netbios#xx */ strcpy(name,name_str); - + p = strchr(name,'#'); if (p) { -- cgit