s3: nmbd: Don't set work_changed = True inside update_server_ttl().
authorJeremy Allison <jra@samba.org>
Fri, 1 May 2015 16:56:59 +0000 (09:56 -0700)
committerJeremy Allison <jra@samba.org>
Mon, 4 May 2015 16:24:21 +0000 (18:24 +0200)
This is taken care of inside expire_servers() when it calls
remove_server_from_workgroup().

Ensure the only functions in nmbd_serverlistdb.c that
set subnet->work_changed are:

remove_all_servers()
add_server_to_workgroup()
remove_server_from_workgroup()

Fix inspired by a change from Volker.

https://bugzilla.samba.org/show_bug.cgi?id=11254

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/nmbd/nmbd_serverlistdb.c

index b4057193b2f23b40fcc6ad3fac016cfaab4d5864..cd84bdf1d1e0d331061f7fc68d8df1cd4ee2761c 100644 (file)
@@ -133,8 +133,6 @@ workgroup %s. This is a bug.\n", name, work->work_group));
        DEBUG(3,("create_server_on_workgroup: Created server entry %s of type %x (%s) on \
 workgroup %s.\n", name,servertype,comment, work->work_group));
  
-       work->subnet->work_changed = True;
        return(servrec);
 }
 
@@ -151,8 +149,6 @@ void update_server_ttl(struct server_record *servrec, int ttl)
                servrec->death_time = PERMANENT_TTL;
        else
                servrec->death_time = (ttl != PERMANENT_TTL) ? time(NULL)+(ttl*3) : PERMANENT_TTL;
-
-       servrec->subnet->work_changed = True;
 }
 
 /*******************************************************************
@@ -172,7 +168,6 @@ void expire_servers(struct work_record *work, time_t t)
                if ((servrec->death_time != PERMANENT_TTL) && ((t == -1) || (servrec->death_time < t))) {
                        DEBUG(3,("expire_old_servers: Removing timed out server %s\n",servrec->serv.name));
                        remove_server_from_workgroup(work, servrec);
-                       work->subnet->work_changed = True;
                }
        }
 }