[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha7-1038-ga2ef1fe

Günther Deschner gd at samba.org
Tue Apr 14 10:14:11 GMT 2009


The branch, master has been updated
       via  a2ef1fee69771f58c27604ef213405031f42ff96 (commit)
       via  fa302020ee39bf39bf324983cf8e381232691e76 (commit)
       via  e3ceb0c65333cb870463971021e3af24d82abf26 (commit)
       via  4a2dfbf3c94c8fc4c2cbcbea3b138c5a9674f951 (commit)
      from  786447dea021f97a44582009bf33e28d972dacb4 (commit)

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


- Log -----------------------------------------------------------------
commit a2ef1fee69771f58c27604ef213405031f42ff96
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 12:10:22 2009 +0200

    s4-smbtorture: make sure samba3 does not regress in EnumServicesStatusW call.
    
    Guenther

commit fa302020ee39bf39bf324983cf8e381232691e76
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 12:08:55 2009 +0200

    s3-svcctl: fix memcpy in _svcctl_EnumServicesStatusW().
    
    Make sure we are not copying more than what we have as valid data.
    
    Fix from Jeremy. Thanks a lot for watching this so closely!
    
    Guenther

commit e3ceb0c65333cb870463971021e3af24d82abf26
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 12:00:39 2009 +0200

    s3-spoolss: remove unused dup_nt_devicemode().
    
    Guenther

commit 4a2dfbf3c94c8fc4c2cbcbea3b138c5a9674f951
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 14 01:08:23 2009 +0200

    s4-smbtorture: print SPOOLSS_JOB_CONTROL flags in RPC-SPOOLSS test.
    
    Guenther

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

Summary of changes:
 source3/include/proto.h            |    1 -
 source3/printing/nt_printing.c     |   28 ----------------------------
 source3/rpc_server/srv_svcctl_nt.c |    3 +--
 source4/torture/rpc/spoolss.c      |   33 ++++++++++++++++++++++++++++++++-
 source4/torture/rpc/svcctl.c       |    3 +++
 5 files changed, 36 insertions(+), 32 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/proto.h b/source3/include/proto.h
index b8ba8c0..25e81fd 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -4843,7 +4843,6 @@ WERROR move_driver_to_download_area(struct pipes_struct *p,
 int pack_devicemode(NT_DEVICEMODE *nt_devmode, uint8 *buf, int buflen);
 uint32 del_a_printer(const char *sharename);
 NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename);
-NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode);
 void free_nt_devicemode(NT_DEVICEMODE **devmode_ptr);
 int unpack_devicemode(NT_DEVICEMODE **nt_devmode, const uint8 *buf, int buflen);
 int add_new_printer_key( NT_PRINTER_DATA *data, const char *name );
diff --git a/source3/printing/nt_printing.c b/source3/printing/nt_printing.c
index c20171b..f3b938e 100644
--- a/source3/printing/nt_printing.c
+++ b/source3/printing/nt_printing.c
@@ -2732,34 +2732,6 @@ NT_DEVICEMODE *construct_nt_devicemode(const fstring default_devicename)
 }
 
 /****************************************************************************
- Deepcopy an NT devicemode.
-****************************************************************************/
-
-NT_DEVICEMODE *dup_nt_devicemode(NT_DEVICEMODE *nt_devicemode)
-{
-	NT_DEVICEMODE *new_nt_devicemode = NULL;
-
-	if ( !nt_devicemode )
-		return NULL;
-
-	if ((new_nt_devicemode = (NT_DEVICEMODE *)memdup(nt_devicemode, sizeof(NT_DEVICEMODE))) == NULL) {
-		DEBUG(0,("dup_nt_devicemode: malloc fail.\n"));
-		return NULL;
-	}
-
-	new_nt_devicemode->nt_dev_private = NULL;
-	if (nt_devicemode->nt_dev_private != NULL) {
-		if ((new_nt_devicemode->nt_dev_private = (uint8 *)memdup(nt_devicemode->nt_dev_private, nt_devicemode->driverextra)) == NULL) {
-			SAFE_FREE(new_nt_devicemode);
-			DEBUG(0,("dup_nt_devicemode: malloc fail.\n"));
-			return NULL;
-        }
-	}
-
-	return new_nt_devicemode;
-}
-
-/****************************************************************************
  Clean up and deallocate a (maybe partially) allocated NT_DEVICEMODE.
 ****************************************************************************/
 
diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index 0b0ef83..d73f73f 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -464,9 +464,8 @@ WERROR _svcctl_EnumServicesStatusW(pipes_struct *p,
 		if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
 			return ntstatus_to_werror(ndr_map_error2ntstatus(ndr_err));
 		}
-
 		blob = ndr_push_blob(ndr);
-		memcpy(r->out.service, blob.data, r->in.offered);
+		memcpy(r->out.service, blob.data, MIN(blob.length, r->in.offered));
 	}
 
 	*r->out.needed			= (buffer_size > r->in.offered) ? buffer_size : r->in.offered;
diff --git a/source4/torture/rpc/spoolss.c b/source4/torture/rpc/spoolss.c
index b188970..d17b3c7 100644
--- a/source4/torture/rpc/spoolss.c
+++ b/source4/torture/rpc/spoolss.c
@@ -1101,7 +1101,38 @@ static bool test_SetJob(struct torture_context *tctx,
 	r.in.ctr	= NULL;
 	r.in.command	= command;
 
-	torture_comment(tctx, "Testing SetJob\n");
+	switch (command) {
+	case SPOOLSS_JOB_CONTROL_PAUSE:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_PAUSE\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_RESUME:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RESUME\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_CANCEL:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_CANCEL\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_RESTART:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RESTART\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_DELETE:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_DELETE\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_SEND_TO_PRINTER\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_LAST_PAGE_EJECTED\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_RETAIN:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RETAIN\n");
+		break;
+	case SPOOLSS_JOB_CONTROL_RELEASE:
+		torture_comment(tctx, "Testing SetJob: SPOOLSS_JOB_CONTROL_RELEASE\n");
+		break;
+	default:
+		torture_comment(tctx, "Testing SetJob\n");
+		break;
+	}
 
 	status = dcerpc_spoolss_SetJob(p, tctx, &r);
 	torture_assert_ntstatus_ok(tctx, status, "SetJob failed");
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index e38e8da..631e367 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -374,6 +374,9 @@ static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_
 
 	for(i = 0; i < services_returned; i++) {
 
+		torture_assert(tctx, service[i].service_name,
+			"Service without name returned!");
+
 		printf("%-20s   \"%s\", Type: %d, State: %d\n",
 			service[i].service_name, service[i].display_name,
 			service[i].status.type, service[i].status.state);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list