[SCM] Samba Shared Repository - branch v3-0-test updated - release-3-0-32-50-g559ba02

Michael Adam obnox at samba.org
Mon Oct 27 14:05:03 GMT 2008


The branch, v3-0-test has been updated
       via  559ba0215cada4093efd22f165b608c41913d935 (commit)
      from  90651d77f1f7fc6d29629d3a0dd566d07c090609 (commit)

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


- Log -----------------------------------------------------------------
commit 559ba0215cada4093efd22f165b608c41913d935
Author: Michael Adam <obnox at samba.org>
Date:   Mon Oct 27 14:28:44 2008 +0100

    winbind: fix smbd hanging on Solaris when winbindd closes socket.
    
    On some versions of Solaris, we observed a strange effect of close(2)
    on a socket: After the server (here winbindd) called close, the client fd
    was not marked as readable for select. And a write call to the fd did
    not produce an error EPIPE but just returned as if successful.
    
    So while winbindd had called remove_client(), the corresponding smbd
    still thought that it was connected, but failed to retrieve answers
    for its queries.
    
    This patch works around the problem by forcing the client fd to
    the readable state: Just write one byte into the socket before
    closing.
    
    Michael

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

Summary of changes:
 source/nsswitch/winbindd.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c
index 54081ab..48b94f2 100644
--- a/source/nsswitch/winbindd.c
+++ b/source/nsswitch/winbindd.c
@@ -669,12 +669,17 @@ static void new_connection(int listen_sock, BOOL privileged)
 
 static void remove_client(struct winbindd_cli_state *state)
 {
+	char c = 0;
+
 	/* It's a dead client - hold a funeral */
 	
 	if (state == NULL) {
 		return;
 	}
-		
+
+	/* tell client, we are closing ... */
+	write(state->sock, &c, sizeof(c));
+
 	/* Close socket */
 		
 	close(state->sock);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list