[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-7-147-gd98820b

Karolin Seeger kseeger at samba.org
Thu Jan 29 07:44:02 GMT 2009


The branch, v3-2-stable has been updated
       via  d98820b808581a1c585c8fc45335ccc28ca2888b (commit)
       via  93d293c42ebe9ccc5f1bd6060ebdaf3cef41c55d (commit)
       via  2eacd0343b0f18e481a3f8ab49388ca73dbc24a1 (commit)
       via  8ec4938668bc710427179cb898aa49c5f699a38c (commit)
      from  4a054938a8153f1bf9ef56b5d9769f15c2038d3a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable


- Log -----------------------------------------------------------------
commit d98820b808581a1c585c8fc45335ccc28ca2888b
Author: Karolin Seeger <kseeger at samba.org>
Date:   Thu Jan 29 08:42:55 2009 +0100

    WHATSNEW: Update changes since 3.2.7.
    
    Karolin
    (cherry picked from commit 31ea6bbc4a964604377509d3c096bae647c614a2)

commit 93d293c42ebe9ccc5f1bd6060ebdaf3cef41c55d
Author: Andreas Schneider <anschneider at suse.de>
Date:   Wed Jan 14 12:11:36 2009 +0100

    Use talloc_tos() instead of the talloc NULL context.
    
    Signed-off-by: Andreas Schneider <anschneider at suse.de>
    (cherry picked from commit ef76b71683f3d420fa8062bc5364493c44ab68ce)

commit 2eacd0343b0f18e481a3f8ab49388ca73dbc24a1
Author: Volker Lendecke <vl at samba.org>
Date:   Wed Jan 28 10:35:35 2009 +0100

    Avoid valgrind errors
    
    In event handlers, we might destroy other events that are pending in the lists.
    We can only run one event safely per select call.
    
    Yes, I've seen these valgrind errors :-)
    
    Jeremy, with ccdd921e61 you had checked in the change to run multiple events.
    Do you remember why it was necessary and could not be solved in a different
    way?
    
    Volker
    (cherry picked from commit 077e0ed31315242c571ccd9e9579f53aac0dbbc7)

commit 8ec4938668bc710427179cb898aa49c5f699a38c
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Jan 27 19:41:34 2009 +0100

    Fix a valgrind error when the socket dies
    
    Don't reference anything that might have been deleted in the async_req_error
    call.
    (cherry picked from commit 8e7d0cf27cf9eb18be497d13bd0dbbe1d76b97a0)

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

Summary of changes:
 WHATSNEW.txt              |    2 ++
 source/lib/events.c       |   38 ++++++++++----------------------------
 source/libsmb/async_smb.c |    5 +++--
 source/smbd/service.c     |    2 +-
 4 files changed, 16 insertions(+), 31 deletions(-)


Changeset truncated at 500 lines:

diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index 1616c3d..903e21d 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -102,6 +102,7 @@ o   Volker Lendecke <vl at sernet.de>
     * Fix a memory leak in cups_pull_comment_location.
     * Fix an ancient uninitialized variable read.
     * Fix a bad memleak in vfs_full_audit.
+    * Fix several valgrind errors.
 
 
 o   Herb Lewis <hlewis at chomps.localdomain>
@@ -147,6 +148,7 @@ o   Andreas Schneider <anschneider at suse.de>
     * Fix a segfault if ? is there but the options are NULL.
     * Avoid flooding of syslog with failing pam_putenv messages.
     * Document default of the printing config variable.
+    * Use talloc_tos() instead of the talloc NULL context.
 
 
 o   Karolin Seeger <kseeger at samba.org>
diff --git a/source/lib/events.c b/source/lib/events.c
index 229e7e2..9d809fb 100644
--- a/source/lib/events.c
+++ b/source/lib/events.c
@@ -245,22 +245,13 @@ bool events_pending(struct event_context *event_ctx)
 bool run_events(struct event_context *event_ctx,
 		int selrtn, fd_set *read_fds, fd_set *write_fds)
 {
-	bool fired = False;
-	struct fd_event *fde, *next;
-
-	/* Run all events that are pending, not just one (as we
-	   did previously. */
+	struct fd_event *fde;
+	struct timeval now;
 
-	while (event_ctx->timed_events) {
-		struct timeval now;
-		GetTimeOfDay(&now);
+	GetTimeOfDay(&now);
 
-		if (timeval_compare(
-			    &now, &event_ctx->timed_events->when) < 0) {
-			/* Nothing to do yet */
-			DEBUG(11, ("run_events: Nothing to do\n"));
-			break;
-		}
+	if ((event_ctx->timed_events != NULL)
+	    && (timeval_compare(&now, &event_ctx->timed_events->when) >= 0)) {
 
 		DEBUG(10, ("Running event \"%s\" %lx\n",
 			   event_ctx->timed_events->event_name,
@@ -271,38 +262,29 @@ bool run_events(struct event_context *event_ctx,
 			event_ctx->timed_events, &now,
 			event_ctx->timed_events->private_data);
 
-		fired = True;
-	}
-
-	if (fired) {
-		/*
-		 * We might have changed the socket status during the timed
-		 * events, return to run select again.
-		 */
-		return True;
+		return true;
 	}
 
 	if (selrtn == 0) {
 		/*
 		 * No fd ready
 		 */
-		return fired;
+		return false;
 	}
 
-	for (fde = event_ctx->fd_events; fde; fde = next) {
+	for (fde = event_ctx->fd_events; fde; fde = fde->next) {
 		uint16 flags = 0;
 
-		next = fde->next;
 		if (FD_ISSET(fde->fd, read_fds)) flags |= EVENT_FD_READ;
 		if (FD_ISSET(fde->fd, write_fds)) flags |= EVENT_FD_WRITE;
 
 		if (flags) {
 			fde->handler(event_ctx, fde, flags, fde->private_data);
-			fired = True;
+			return true;
 		}
 	}
 
-	return fired;
+	return false;
 }
 
 
diff --git a/source/libsmb/async_smb.c b/source/libsmb/async_smb.c
index 9346264..a031516 100644
--- a/source/libsmb/async_smb.c
+++ b/source/libsmb/async_smb.c
@@ -318,7 +318,7 @@ static void cli_state_handler(struct event_context *event_ctx,
 			      struct fd_event *event, uint16 flags, void *p)
 {
 	struct cli_state *cli = (struct cli_state *)p;
-	struct cli_request *req;
+	struct cli_request *req, *next;
 	NTSTATUS status;
 
 	DEBUG(11, ("cli_state_handler called with flags %d\n", flags));
@@ -421,7 +421,8 @@ static void cli_state_handler(struct event_context *event_ctx,
 	return;
 
  sock_error:
-	for (req = cli->outstanding_requests; req; req = req->next) {
+	for (req = cli->outstanding_requests; req; req = next) {
+		next = req;
 		async_req_error(req->async, status);
 	}
 	TALLOC_FREE(cli->fd_event);
diff --git a/source/smbd/service.c b/source/smbd/service.c
index cb51f35..1c8ffbd 100644
--- a/source/smbd/service.c
+++ b/source/smbd/service.c
@@ -693,7 +693,7 @@ static connection_struct *make_connection_snum(int snum, user_struct *vuser,
 		char *found_username = NULL;
 
 		guest = True;
-		pass = getpwnam_alloc(NULL, guestname);
+		pass = getpwnam_alloc(talloc_tos(), guestname);
 		if (!pass) {
 			DEBUG(0,("make_connection_snum: Invalid guest "
 				 "account %s??\n",guestname));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list