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

Jeremy Allison jra at samba.org
Thu Oct 22 16:11:19 MDT 2009


The branch, v3-5-test has been updated
       via  322f076... 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 :-). Jeremy.
       via  44b0dce... s4-torture: catch bad command line options
       via  3e447ed... s4-torture: fixed a pipe leak
       via  9f68deb... s4-torture: fixed a fd/mem leak in the RPC-LSA-SECRETS test
      from  b2b8363... s4-lsa: Fix dcesrv_lsa_EnumTrustDom() and avoid infite windows client loop.

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


- Log -----------------------------------------------------------------
commit 322f0769b7a0cad2f5ee9be1b89676c2461d681b
Author: Jeremy Allison <jra at samba.org>
Date:   Thu Oct 22 15:06:38 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 :-).
    Jeremy.

commit 44b0dcefb70cd8ffd18f6513c655c137fdd1985e
Author: Andrew Tridgell <tridge at samba.org>
Date:   Thu Oct 15 18:27:57 2009 +1100

    s4-torture: catch bad command line options
    
    It is annoying when you mistype a command line option and aren't told.

commit 3e447ed62138fff14493a76a95a7fd2755e467f0
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Oct 20 16:34:42 2009 +1100

    s4-torture: fixed a pipe leak
    
    The RPC-SAMR-PASSWORDS* tests could leak RPC pipes, causing an
    overallocation of fd's on the server

commit 9f68deb48c7264c89f7f235306ef0f14dcfc6865
Author: Andrew Tridgell <tridge at samba.org>
Date:   Tue Oct 20 14:27:57 2009 +1100

    s4-torture: fixed a fd/mem leak in the RPC-LSA-SECRETS test
    
    This test left a large number of lsa pipes open, which could trigger
    the server running out of fds

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

Summary of changes:
 source3/libsmb/clidfs.c           |    9 +++++++++
 source3/libsmb/libsmb_server.c    |   11 +++++++++++
 source4/torture/rpc/samr.c        |    2 ++
 source4/torture/rpc/session_key.c |   19 ++++++++++++-------
 source4/torture/smbtorture.c      |    3 +++
 5 files changed, 37 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index 5e944f1..53dc6d7 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -216,6 +216,15 @@ static struct cli_state *do_connect(TALLOC_CTX *ctx,
 			return NULL;
 		}
 		d_printf("Anonymous login successful\n");
+		status = cli_init_creds(c, "", lp_workgroup(), "");
+	} else {
+		status = cli_init_creds(c, username, lp_workgroup(), password);
+	}
+
+	if (!NT_STATUS_IS_OK(status)) {
+		DEBUG(10,("cli_init_creds() failed: %s\n", nt_errstr(status)));
+		cli_shutdown(c);
+		return NULL;
 	}
 
 	if ( show_sessetup ) {
diff --git a/source3/libsmb/libsmb_server.c b/source3/libsmb/libsmb_server.c
index 60849c8..18b12a1 100644
--- a/source3/libsmb/libsmb_server.c
+++ b/source3/libsmb/libsmb_server.c
@@ -498,6 +498,17 @@ again:
                         errno = EPERM;
                         return NULL;
                 }
+		status = cli_init_creds(c, username_used,
+				*pp_workgroup, *pp_password);
+	} else {
+		status = cli_init_creds(c, username_used,
+				*pp_workgroup, *pp_password);
+	}
+
+	if (!NT_STATUS_IS_OK(status)) {
+		errno = map_errno_from_nt_status(status);
+		cli_shutdown(c);
+		return NULL;
 	}
 
 	DEBUG(4,(" session setup ok\n"));
diff --git a/source4/torture/rpc/samr.c b/source4/torture/rpc/samr.c
index b3bc5cf..eb3c86e 100644
--- a/source4/torture/rpc/samr.c
+++ b/source4/torture/rpc/samr.c
@@ -3275,6 +3275,8 @@ static bool test_SetPassword_pwdlastset(struct dcerpc_pipe *p,
 #undef TEST_SET_LEVELS
 #undef TEST_QUERY_LEVELS
 
+	talloc_free(np);
+
 	return ret;
 }
 
diff --git a/source4/torture/rpc/session_key.c b/source4/torture/rpc/session_key.c
index 431897a..1d31999 100644
--- a/source4/torture/rpc/session_key.c
+++ b/source4/torture/rpc/session_key.c
@@ -148,6 +148,7 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
 	struct dcerpc_binding *binding;
 	const struct secret_settings *settings = 
 		(const struct secret_settings *)_data;
+	NTSTATUS status;
 
 	lp_set_cmdline(torture->lp_ctx, "ntlmssp client:keyexchange", settings->keyexchange?"True":"False");
 	lp_set_cmdline(torture->lp_ctx, "ntlmssp_client:ntlm2", settings->ntlm2?"True":"False");
@@ -158,24 +159,28 @@ static bool test_secrets(struct torture_context *torture, const void *_data)
 
 	binding->flags |= settings->bindoptions;
 
-	torture_assert_ntstatus_ok(torture, 
-				   dcerpc_pipe_connect_b(torture, &p, binding,
-							 &ndr_table_lsarpc,
-							 cmdline_credentials,
-							 torture->ev,
-							 torture->lp_ctx),
-				   "connect");
+	status = dcerpc_pipe_connect_b(torture, &p, binding,
+				       &ndr_table_lsarpc,
+				       cmdline_credentials,
+				       torture->ev,
+				       torture->lp_ctx);
+
+	torture_assert_ntstatus_ok(torture, status, "connect");
 
 	if (!test_lsa_OpenPolicy2(p, torture, &handle)) {
+		talloc_free(p);
 		return false;
 	}
 
 	torture_assert(torture, handle, "OpenPolicy2 failed.  This test cannot run against this server");
 	
 	if (!test_CreateSecret_basic(p, torture, handle)) {
+		talloc_free(p);
 		return false;
 	}
 
+	talloc_free(p);
+
 	return true;
 }
 
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c
index dbd45bf..08c5748 100644
--- a/source4/torture/smbtorture.c
+++ b/source4/torture/smbtorture.c
@@ -519,6 +519,9 @@ int main(int argc,char *argv[])
 				talloc_free(option);
 			}
 			break;
+		default:
+			printf("bad command line option\n");
+			exit(1);
 		}
 	}
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list