[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-822-g265e1fc

Günther Deschner gd at samba.org
Fri Apr 24 12:01:23 GMT 2009


The branch, v3-4-test has been updated
       via  265e1fca1228776a0a7556ef854bfcc4130085b4 (commit)
       via  32e4e65e61e627100a8201b5aba273c2e8b63de8 (commit)
       via  d9d4e769a4d4a2978656ef77e9e91308152a9483 (commit)
       via  16f3e855d056e5951fa6136a61c13d09fa9a74c1 (commit)
       via  f783489d73d044433b911c673acca0aaf0fb70c8 (commit)
      from  172ecfae44768289b98c1bafa7aa2b89dbecc312 (commit)

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


- Log -----------------------------------------------------------------
commit 265e1fca1228776a0a7556ef854bfcc4130085b4
Author: Günther Deschner <gd at samba.org>
Date:   Tue Apr 21 16:18:51 2009 +0200

    s3-svcctl: indicate that the spooler is already running if it does.
    
    Guenther
    (cherry picked from commit 16b2f4b55a80314aa733dd7f23543c1c3926223c)

commit 32e4e65e61e627100a8201b5aba273c2e8b63de8
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 10 21:39:45 2009 +0200

    s3-svcctl: fix _svcctl_ControlService.
    
    Guenther
    (cherry picked from commit aa26bdd71969610a4b6a5bdfdd735a1dab31a12c)

commit d9d4e769a4d4a2978656ef77e9e91308152a9483
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 10 21:10:07 2009 +0200

    s4-smbtorture: add test_ControlService() to RPC-SVCCTL.
    
    Guenther
    (cherry picked from commit a263eaca499cf2b8a89c3ab04c6ef5e7e9aea396)

commit 16f3e855d056e5951fa6136a61c13d09fa9a74c1
Author: Günther Deschner <gd at samba.org>
Date:   Fri Apr 10 20:55:10 2009 +0200

    s4-smbtorture: add test_StartServiceW() to RPC-SVCCTL.
    
    Guenther
    (cherry picked from commit f926a4e390e7108dad36ecfffaddb628b23436c0)

commit f783489d73d044433b911c673acca0aaf0fb70c8
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 20 16:49:01 2009 +0200

    s4-smbtorture: change default service to spooler in RPC-SVCCTL.
    
    Guenther
    (cherry picked from commit ae5dd1219a14e939cb1e3674e6daba7885cc9d51)

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

Summary of changes:
 source3/rpc_server/srv_svcctl_nt.c |    2 +-
 source3/services/svc_spoolss.c     |    4 ++
 source4/torture/rpc/svcctl.c       |   70 +++++++++++++++++++++++++++++++++++-
 3 files changed, 74 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/srv_svcctl_nt.c b/source3/rpc_server/srv_svcctl_nt.c
index d73f73f..f88801e 100644
--- a/source3/rpc_server/srv_svcctl_nt.c
+++ b/source3/rpc_server/srv_svcctl_nt.c
@@ -524,7 +524,7 @@ WERROR _svcctl_ControlService(pipes_struct *p,
 		return info->ops->service_status( info->name,
 						  r->out.service_status );
 	default:
-		return WERR_ACCESS_DENIED;
+		return WERR_INVALID_PARAM;
 	}
 }
 
diff --git a/source3/services/svc_spoolss.c b/source3/services/svc_spoolss.c
index bb2b892..4a2cb78 100644
--- a/source3/services/svc_spoolss.c
+++ b/source3/services/svc_spoolss.c
@@ -50,6 +50,10 @@ static WERROR spoolss_start( const char *service )
 	if ( _lp_disable_spoolss() )
 		return WERR_ACCESS_DENIED;
 
+	if (lp_get_spoolss_state() == SVCCTL_RUNNING) {
+		return WERR_SERVICE_ALREADY_RUNNING;
+	}
+
 	lp_set_spoolss_state( SVCCTL_RUNNING );
 
 	return WERR_OK;
diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index a2e32f2..ad27060 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -26,7 +26,7 @@
 #include "torture/rpc/rpc.h"
 #include "param/param.h"
 
-#define TORTURE_DEFAULT_SERVICE "NetLogon"
+#define TORTURE_DEFAULT_SERVICE "Spooler"
 
 static bool test_OpenSCManager(struct dcerpc_pipe *p, struct torture_context *tctx, struct policy_handle *h)
 {
@@ -313,6 +313,70 @@ static bool test_QueryServiceObjectSecurity(struct torture_context *tctx,
 	return true;
 }
 
+static bool test_StartServiceW(struct torture_context *tctx,
+			       struct dcerpc_pipe *p)
+{
+	struct svcctl_StartServiceW r;
+	struct policy_handle h, s;
+
+	if (!test_OpenSCManager(p, tctx, &h))
+		return false;
+
+	if (!test_OpenService(p, tctx, &h, TORTURE_DEFAULT_SERVICE, &s))
+		return false;
+
+	r.in.handle = &s;
+	r.in.NumArgs = 0;
+	r.in.Arguments = NULL;
+
+	torture_assert_ntstatus_ok(tctx,
+		dcerpc_svcctl_StartServiceW(p, tctx, &r),
+		"StartServiceW failed!");
+	torture_assert_werr_equal(tctx, r.out.result,
+		WERR_SERVICE_ALREADY_RUNNING,
+		"StartServiceW failed!");
+
+	if (!test_CloseServiceHandle(p, tctx, &s))
+		return false;
+
+	if (!test_CloseServiceHandle(p, tctx, &h))
+		return false;
+
+	return true;
+}
+
+static bool test_ControlService(struct torture_context *tctx,
+				struct dcerpc_pipe *p)
+{
+	struct svcctl_ControlService r;
+	struct policy_handle h, s;
+	struct SERVICE_STATUS service_status;
+
+	if (!test_OpenSCManager(p, tctx, &h))
+		return false;
+
+	if (!test_OpenService(p, tctx, &h, TORTURE_DEFAULT_SERVICE, &s))
+		return false;
+
+	r.in.handle = &s;
+	r.in.control = 0;
+	r.out.service_status = &service_status;
+
+	torture_assert_ntstatus_ok(tctx,
+		dcerpc_svcctl_ControlService(p, tctx, &r),
+		"ControlService failed!");
+	torture_assert_werr_equal(tctx, r.out.result, WERR_INVALID_PARAM,
+		"ControlService failed!");
+
+	if (!test_CloseServiceHandle(p, tctx, &s))
+		return false;
+
+	if (!test_CloseServiceHandle(p, tctx, &h))
+		return false;
+
+	return true;
+}
+
 static bool test_EnumServicesStatus(struct torture_context *tctx, struct dcerpc_pipe *p)
 {
 	struct svcctl_EnumServicesStatusW r;
@@ -490,6 +554,10 @@ struct torture_suite *torture_rpc_svcctl(TALLOC_CTX *mem_ctx)
 				   test_QueryServiceConfig2W);
 	torture_rpc_tcase_add_test(tcase, "QueryServiceObjectSecurity",
 				   test_QueryServiceObjectSecurity);
+	torture_rpc_tcase_add_test(tcase, "StartServiceW",
+				   test_StartServiceW);
+	torture_rpc_tcase_add_test(tcase, "ControlService",
+				   test_ControlService);
 
 	return suite;
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list