summaryrefslogtreecommitdiffstats
path: root/source/namedb.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>1996-06-07 03:34:22 +0000
committerAndrew Tridgell <tridge@samba.org>1996-06-07 03:34:22 +0000
commit88b191b48836eeb7937f25b37d0bdd4a2276e5a7 (patch)
tree029183b29f3787bcbb34b61475bd02ad554d30e0 /source/namedb.c
parent5a0d016b2432da9299d92b33d723534d91c8dcf4 (diff)
downloadsamba-88b191b48836eeb7937f25b37d0bdd4a2276e5a7.tar.gz
samba-88b191b48836eeb7937f25b37d0bdd4a2276e5a7.tar.xz
samba-88b191b48836eeb7937f25b37d0bdd4a2276e5a7.zip
- added predict.c, moving the routines from util.c
- added iface_count() and iface_n_ip() routines so its easy to loop over the local interface list - made readsize a normal loadparm global - check for null w in add_domain_entry() - set the deathtime to time()-1 for doamin entries with servertype==0 This allows servers that are shutting down to be removed - add the 0x1c name at startup if we are a WINS server. Previously we added it only if we were a master - loop over interfaces in add_my_domains(), so people don't have to have a lmhosts file to get lp_workgroup() on all interfaces - set add to True for find_workgroupstruct() in nmbsync, and check for null return - remove some ugly "errno = EBADF" bits. they just confused things.
Diffstat (limited to 'source/namedb.c')
-rw-r--r--source/namedb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source/namedb.c b/source/namedb.c
index 2e942587be8..2868d54ac4f 100644
--- a/source/namedb.c
+++ b/source/namedb.c
@@ -460,6 +460,8 @@ struct domain_record *add_domain_entry(struct in_addr source_ip,
{
struct work_record *w = find_workgroupstruct(d, name, add);
+ if (!w) return NULL;
+
/* add WORKGROUP(1e) and WORKGROUP(00) entries into name database
or register with WINS server, if it's our workgroup */
if (strequal(lp_workgroup(), name))
@@ -586,7 +588,8 @@ struct server_record *add_server_entry(struct domain_record *d,
if (ismybcast(d->bcast_ip) &&
strequal(lp_workgroup(),work->work_group))
{
- servertype |= SV_TYPE_LOCAL_LIST_ONLY;
+ if (servertype)
+ servertype |= SV_TYPE_LOCAL_LIST_ONLY;
}
else
{
@@ -599,6 +602,9 @@ struct server_record *add_server_entry(struct domain_record *d,
strupper(s->serv.name);
s->serv.type = servertype;
s->death_time = ttl?time(NULL)+ttl*3:0;
+
+ if (servertype == 0)
+ s->death_time = time(NULL)-1;
/* for a domain entry, the comment field refers to the server name */