[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1096-gd9aaf37

Günther Deschner gd at samba.org
Sun Apr 19 23:00:23 GMT 2009


The branch, master has been updated
       via  d9aaf3759ac7fd6ce07a347a0138bdfb27a6f929 (commit)
       via  5f0c9c57f53f9b0026b4f58f68442a72103c0d7d (commit)
      from  dd073a333ed60ea84cdf7a735884fa91a4c62535 (commit)

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


- Log -----------------------------------------------------------------
commit d9aaf3759ac7fd6ce07a347a0138bdfb27a6f929
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 20 00:57:53 2009 +0200

    s3-printing: use sec_initial_uid() instead "0" in print_access_check().
    
    Another babystep in order to make us pass RPC-SPOOLSS.
    
    Guenther

commit 5f0c9c57f53f9b0026b4f58f68442a72103c0d7d
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 13 23:56:59 2009 +0200

    s4-smbtorture: test all levels in test_GetJob().
    
    Guenther

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

Summary of changes:
 source3/printing/nt_printing.c |    2 +-
 source4/torture/rpc/spoolss.c  |   31 +++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index f3b938e..b96d64b 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -5736,7 +5736,7 @@ bool print_access_check(struct auth_serversupplied_info *server_info, int snum,
 
 	/* Always allow root or SE_PRINT_OPERATROR to do anything */
 
-	if (server_info->utok.uid == 0
+	if (server_info->utok.uid == sec_initial_uid()
 	    || user_has_privileges(server_info->ptok, &se_printop ) ) {
 		return True;
 	}
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index bc89eab..bfe6672 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1064,28 +1064,43 @@ static bool test_GetJob(struct torture_context *tctx,
 	NTSTATUS status;
 	struct spoolss_GetJob r;
 	uint32_t needed;
+	uint32_t levels[] = {1, 2 /* 3, 4 */};
+	uint32_t i;
 
 	r.in.handle = handle;
 	r.in.job_id = job_id;
-	r.in.level = 1;
+	r.in.level = 0;
 	r.in.buffer = NULL;
 	r.in.offered = 0;
 	r.out.needed = &needed;
 
-	torture_comment(tctx, "Testing GetJob\n");
+	torture_comment(tctx, "Testing GetJob level %d\n", r.in.level);
 
 	status = dcerpc_spoolss_GetJob(p, tctx, &r);
-	torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+	torture_assert_werr_equal(tctx, r.out.result, WERR_UNKNOWN_LEVEL, "Unexpected return code");
 
-	if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
-		DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
-		data_blob_clear(&blob);
-		r.in.buffer = &blob;
-		r.in.offered = needed;
+	for (i = 0; i < ARRAY_SIZE(levels); i++) {
+
+		torture_comment(tctx, "Testing GetJob level %d\n", r.in.level);
+
+		r.in.level = levels[i];
+		r.in.offered = 0;
 
 		status = dcerpc_spoolss_GetJob(p, tctx, &r);
+		torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
 
+		if (W_ERROR_EQUAL(r.out.result, WERR_INSUFFICIENT_BUFFER)) {
+			DATA_BLOB blob = data_blob_talloc(tctx, NULL, needed);
+			data_blob_clear(&blob);
+			r.in.buffer = &blob;
+			r.in.offered = needed;
+
+			status = dcerpc_spoolss_GetJob(p, tctx, &r);
+			torture_assert_ntstatus_ok(tctx, status, "GetJob failed");
+
+		}
 		torture_assert(tctx, r.out.info, "No job info returned");
+		torture_assert_werr_ok(tctx, r.out.result, "GetJob failed");
 	}
 
 	return true;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list