The branch, v3-4-test has been updated via 3368cd38f710b9d21a3382bfd8971f0f6517eec1 (commit) via 5fc2656e600791667835775c94a86f788abbcc1a (commit) via 0f48d27d6fb45bc61899916037a5133e3022ec59 (commit) via f78af6c1f1bab5299ef286ada2477e849cf5ba97 (commit) from d99b3025eb54030e90d0c32b2967490d41a1e02a (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-4-test - Log ----------------------------------------------------------------- commit 3368cd38f710b9d21a3382bfd8971f0f6517eec1 Author: Günther Deschner <g...@samba.org> Date: Tue Apr 14 12:10:22 2009 +0200 s4-smbtorture: make sure samba3 does not regress in EnumServicesStatusW call. Guenther (cherry picked from commit a2ef1fee69771f58c27604ef213405031f42ff96) commit 5fc2656e600791667835775c94a86f788abbcc1a Author: Günther Deschner <g...@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 (cherry picked from commit fa302020ee39bf39bf324983cf8e381232691e76) commit 0f48d27d6fb45bc61899916037a5133e3022ec59 Author: Günther Deschner <g...@samba.org> Date: Tue Apr 14 12:00:39 2009 +0200 s3-spoolss: remove unused dup_nt_devicemode(). Guenther (cherry picked from commit e3ceb0c65333cb870463971021e3af24d82abf26) commit f78af6c1f1bab5299ef286ada2477e849cf5ba97 Author: Günther Deschner <g...@samba.org> Date: Tue Apr 14 01:08:23 2009 +0200 s4-smbtorture: print SPOOLSS_JOB_CONTROL flags in RPC-SPOOLSS test. Guenther (cherry picked from commit 4a2dfbf3c94c8fc4c2cbcbea3b138c5a9674f951) ----------------------------------------------------------------------- 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 d13ac21..5d665c6 100644 --- a/source3/include/proto.h +++ b/source3/include/proto.h @@ -4805,7 +4805,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