[SCM] Samba Shared Repository - branch v3-3-test updated

Karolin Seeger kseeger at samba.org
Mon Oct 26 01:58:09 MDT 2009


The branch, v3-3-test has been updated
       via  1791b1c... s3: Fix crash in pam_winbind, another reference to freed memory.
       via  bbeda13... Fix bug 6829 - smbclient does not show special characters properly. All successful calls to cli_session_setup() *must* be followed by calls to cli_init_creds() to stash the credentials we successfully connected with. There were 2 codepaths where this was missing. This caused smbclient to be unable to open the \srvsvc pipe to do an RPC netserverenum, and cause it to fall back to a RAP netserverenum, which uses DOS codepage conversion rather than the full UCS2 of RPC, so the returned characters were not correct (unless the DOS codepage was set correctly). Phew. That was fun to track down :-). Includes logic simplification in libsmb_server.c Jeremy.
      from  4fce98c... Fix bug 6828 - infinite timeout occurs when byte lock held outside of samba Jeremy.

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


- Log -----------------------------------------------------------------
commit 1791b1cc43ce744c73b473aff0e311acbdf0ee4e
Author: Bo Yang <boyang at samba.org>
Date:   Sat Oct 24 10:55:36 2009 +0800

    s3: Fix crash in pam_winbind, another reference to freed memory.
    
    Fix bug #6840.
    
    Signed-off-by: Bo Yang <boyang at samba.org>

commit bbeda1398687b79596769a5d046e1e0f249bd382
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 22 15:35:59 2009 -0700

    Fix bug 6829 - smbclient does not show special characters properly. All successful calls to cli_session_setup() *must* be followed by calls to cli_init_creds() to stash the credentials we successfully connected with. There were 2 codepaths where this was missing. This caused smbclient to be unable to open the \srvsvc pipe to do an RPC netserverenum, and cause it to fall back to a RAP netserverenum, which uses DOS codepage conversion rather than the full UCS2 of RPC, so the returned characters were not correct (unless the DOS codepage was set correctly). Phew. That was fun to track down :-). Includes logic simplification in libsmb_server.c Jeremy.

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

Summary of changes:
 source/libsmb/clidfs.c        |    3 +++
 source/libsmb/libsmb_server.c |    2 ++
 source/nsswitch/pam_winbind.c |   10 +++++++---
 3 files changed, 12 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/libsmb/clidfs.c b/source/libsmb/clidfs.c
index 5379ff9..1b17679 100644
--- a/source/libsmb/clidfs.c
+++ b/source/libsmb/clidfs.c
@@ -235,6 +235,9 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
 			return NULL;
 		}
 		d_printf("Anonymous login successful\n");
+		cli_init_creds(c, "", lp_workgroup(), "");
+	} else {
+		cli_init_creds(c, username, lp_workgroup(), password);
 	}
 
 	if ( show_sessetup ) {
diff --git a/source/libsmb/libsmb_server.c b/source/libsmb/libsmb_server.c
index 6880f5c..dfb56b0 100644
--- a/source/libsmb/libsmb_server.c
+++ b/source/libsmb/libsmb_server.c
@@ -497,6 +497,8 @@ again:
                         return NULL;
                 }
 	}
+
+	cli_init_creds(c, username_used, *pp_workgroup, *pp_password);
         
 	DEBUG(4,(" session setup ok\n"));
         
diff --git a/source/nsswitch/pam_winbind.c b/source/nsswitch/pam_winbind.c
index 3d0c5ef..7454081 100644
--- a/source/nsswitch/pam_winbind.c
+++ b/source/nsswitch/pam_winbind.c
@@ -1784,7 +1784,7 @@ static int winbind_auth_request(struct pwb_context *ctx,
 	if (logon.blobs) {
 		wbcFreeMemory(logon.blobs);
 	}
-	if (info && info->blobs) {
+	if (info && info->blobs && !p_info) {
 		wbcFreeMemory(info->blobs);
 	}
 	if (error && !p_error) {
@@ -3138,10 +3138,14 @@ int pam_sm_chauthtok(pam_handle_t * pamh, int flags,
 					free(username_ret);
 				}
 
-				wbcFreeMemory(info);
-				wbcFreeMemory(policy);
 			}
 
+			if (info && info->blobs) {
+				wbcFreeMemory(info->blobs);
+			}
+			wbcFreeMemory(info);
+			wbcFreeMemory(policy);
+
 			goto out;
 		}
 	} else {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list