[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Thu May 31 19:04:03 MDT 2012


The branch, master has been updated
       via  50d4c96 Remove an unused variable.
       via  8fd02fa Forward port of Richard Sharpe's <realrichardsharpe at gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.
       via  f6e4102 We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
      from  6718747 s3:smbd: use server_messaging_context() instead of sconn->msg_ctx in exit_server_common()

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 50d4c96d66b876741672f8ce4744891e713f3a3f
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 31 16:06:17 2012 -0700

    Remove an unused variable.
    
    Autobuild-User: Jeremy Allison <jra at samba.org>
    Autobuild-Date: Fri Jun  1 03:03:12 CEST 2012 on sn-devel-104

commit 8fd02fa2d6bdedbda1657a15f602bb4384367251
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 31 15:06:58 2012 -0700

    Forward port of Richard Sharpe's <realrichardsharpe at gmail.com> fix for bug #8970 - Possible memory leaks in the samba master process.

commit f6e41026f89deb5393e239b9dc83b287e5c7d6ed
Author: Jeremy Allison <jra at samba.org>
Date:   Thu May 31 12:35:04 2012 -0700

    We are triggering the cleanup_timeout_fn() too often, on exiting when an smbd is idle.
    
    Calls to exit_server_cleanly() should be treated as a "clean" shutdown,
    and not trigger the master smbd to call cleanup_timeout_fn.

-----------------------------------------------------------------------

Summary of changes:
 lib/util/debug.c             |    4 +---
 source3/nmbd/nmbd.c          |    3 ++-
 source3/param/loadparm.c     |    6 +++++-
 source3/printing/load.c      |    7 ++++++-
 source3/smbd/server_exit.c   |   15 ++++-----------
 source3/smbd/server_reload.c |    1 +
 source3/winbindd/winbindd.c  |    3 ++-
 7 files changed, 21 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/debug.c b/lib/util/debug.c
index 52abd79..a990ad5 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -551,7 +551,6 @@ bool reopen_logs_internal(void)
 	int old_fd = 0;
 	bool ret = true;
 
-	char *fname = NULL;
 	if (state.reopening_logs) {
 		return true;
 	}
@@ -580,8 +579,7 @@ bool reopen_logs_internal(void)
 
 	oldumask = umask( 022 );
 
-	fname = state.debugf;
-	if (!fname) {
+	if (!state.debugf) {
 		return false;
 	}
 
diff --git a/source3/nmbd/nmbd.c b/source3/nmbd/nmbd.c
index 98a5310..d464e7e 100644
--- a/source3/nmbd/nmbd.c
+++ b/source3/nmbd/nmbd.c
@@ -382,11 +382,12 @@ static bool reload_nmbd_services(bool test)
 	set_remote_machine_name("nmbd", False);
 
 	if ( lp_loaded() ) {
-		const char *fname = lp_configfile();
+		char *fname = lp_configfile();
 		if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
 			set_dyn_CONFIGFILE(fname);
 			test = False;
 		}
+		TALLOC_FREE(fname);
 	}
 
 	if ( test && !lp_file_list_changed() )
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index 11ff646..1c78b58 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -8809,7 +8809,11 @@ static bool lp_load_ex(const char *pszFname,
 		}
 	}
 
-	lp_add_auto_services(lp_auto_services());
+	{
+		char *serv = lp_auto_services();
+		lp_add_auto_services(serv);
+		TALLOC_FREE(serv);
+	}
 
 	if (add_ipc) {
 		/* When 'restrict anonymous = 2' guest connections to ipc$
diff --git a/source3/printing/load.c b/source3/printing/load.c
index 161d711..af4dcc7 100644
--- a/source3/printing/load.c
+++ b/source3/printing/load.c
@@ -31,6 +31,7 @@ static void add_auto_printers(void)
 	int pnum = lp_servicenumber(PRINTERS_NAME);
 	char *str;
 	char *saveptr;
+	char *auto_serv = NULL;
 
 	if (pnum < 0)
 		if (process_registry_service(PRINTERS_NAME))
@@ -39,8 +40,12 @@ static void add_auto_printers(void)
 	if (pnum < 0)
 		return;
 
-	if ((str = SMB_STRDUP(lp_auto_services())) == NULL)
+	auto_serv = lp_auto_services();
+	str = SMB_STRDUP(auto_serv);
+	TALLOC_FREE(auto_serv);
+	if (str == NULL) {
 		return;
+	}
 
 	for (p = strtok_r(str, LIST_SEP, &saveptr); p;
 	     p = strtok_r(NULL, LIST_SEP, &saveptr)) {
diff --git a/source3/smbd/server_exit.c b/source3/smbd/server_exit.c
index aa22c15..9ff3cad 100644
--- a/source3/smbd/server_exit.c
+++ b/source3/smbd/server_exit.c
@@ -84,7 +84,6 @@ static void exit_server_common(enum server_exit_reason how,
 static void exit_server_common(enum server_exit_reason how,
 	const char *const reason)
 {
-	bool had_open_conn = false;
 	struct smbXsrv_connection *conn = global_smbXsrv_connection;
 	struct smbd_server_connection *sconn = NULL;
 	struct messaging_context *msg_ctx = server_messaging_context();
@@ -108,7 +107,7 @@ static void exit_server_common(enum server_exit_reason how,
 			bool found = false;
 			files_forall(sconn, log_writeable_file_fn, &found);
 		}
-		had_open_conn = conn_close_all(sconn);
+		(void)conn_close_all(sconn);
 		invalidate_all_vuids(sconn);
 	}
 
@@ -183,6 +182,8 @@ static void exit_server_common(enum server_exit_reason how,
 
 		dump_core();
 
+		/* Notreached. */
+		exit(1);
 	} else {
 		DEBUG(3,("Server exit (%s)\n",
 			(reason ? reason : "normal exit")));
@@ -192,15 +193,7 @@ static void exit_server_common(enum server_exit_reason how,
 		gencache_stabilize();
 	}
 
-	/* if we had any open SMB connections when we exited then we
-	   need to tell the parent smbd so that it can trigger a retry
-	   of any locks we may have been holding or open files we were
-	   blocking */
-	if (had_open_conn) {
-		exit(1);
-	} else {
-		exit(0);
-	}
+	exit(0);
 }
 
 void exit_server(const char *const explanation)
diff --git a/source3/smbd/server_reload.c b/source3/smbd/server_reload.c
index 8ca5bee..bab622d 100644
--- a/source3/smbd/server_reload.c
+++ b/source3/smbd/server_reload.c
@@ -146,6 +146,7 @@ bool reload_services(struct smbd_server_connection *sconn,
 			set_dyn_CONFIGFILE(fname);
 			test = False;
 		}
+		TALLOC_FREE(fname);
 	}
 
 	reopen_logs();
diff --git a/source3/winbindd/winbindd.c b/source3/winbindd/winbindd.c
index 22056e2..248f747 100644
--- a/source3/winbindd/winbindd.c
+++ b/source3/winbindd/winbindd.c
@@ -65,11 +65,12 @@ static bool reload_services_file(const char *lfile)
 	bool ret;
 
 	if (lp_loaded()) {
-		const char *fname = lp_configfile();
+		char *fname = lp_configfile();
 
 		if (file_exist(fname) && !strcsequal(fname,get_dyn_CONFIGFILE())) {
 			set_dyn_CONFIGFILE(fname);
 		}
+		TALLOC_FREE(fname);
 	}
 
 	/* if this is a child, restore the logfile to the special


-- 
Samba Shared Repository


More information about the samba-cvs mailing list