The branch, master has been updated
       via  f12756b s4-smbtorture: add test_SetServiceObjectSecurity() to 
RPC-SVCCTL.
      from  1c82ca0 s3/winbind: remove unused winbindd_check_cache_size

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


- Log -----------------------------------------------------------------
commit f12756b5acac3fad4178f009865f8bcc5b6934a2
Author: Günther Deschner <[email protected]>
Date:   Fri Apr 24 13:44:54 2009 +0200

    s4-smbtorture: add test_SetServiceObjectSecurity() to RPC-SVCCTL.
    
    Guenther

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

Summary of changes:
 source4/torture/rpc/svcctl.c |   63 +++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 62 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/torture/rpc/svcctl.c b/source4/torture/rpc/svcctl.c
index 8f9ec1a..5ad678f 100644
--- a/source4/torture/rpc/svcctl.c
+++ b/source4/torture/rpc/svcctl.c
@@ -1,6 +1,6 @@
 /*
    Unix SMB/CIFS implementation.
-   test suite for srvsvc rpc operations
+   test suite for svcctl rpc operations
 
    Copyright (C) Jelmer Vernooij 2004
    Copyright (C) Guenther Deschner 2008,2009
@@ -324,6 +324,65 @@ static bool test_QueryServiceObjectSecurity(struct 
torture_context *tctx,
        return true;
 }
 
+static bool test_SetServiceObjectSecurity(struct torture_context *tctx,
+                                         struct dcerpc_pipe *p)
+{
+       struct svcctl_QueryServiceObjectSecurity q;
+       struct svcctl_SetServiceObjectSecurity r;
+       struct policy_handle h, s;
+       struct dcerpc_binding_handle *b = p->binding_handle;
+
+       uint8_t *buffer;
+       uint32_t needed;
+
+       if (!test_OpenSCManager(b, tctx, &h))
+               return false;
+
+       if (!test_OpenService(b, tctx, &h, TORTURE_DEFAULT_SERVICE, &s))
+               return false;
+
+       q.in.handle = &s;
+       q.in.security_flags = SECINFO_DACL;
+       q.in.offered = 0;
+       q.out.buffer = NULL;
+       q.out.needed = &needed;
+
+       torture_assert_ntstatus_ok(tctx,
+               dcerpc_svcctl_QueryServiceObjectSecurity_r(b, tctx, &q),
+               "QueryServiceObjectSecurity failed!");
+
+       if (W_ERROR_EQUAL(q.out.result, WERR_INSUFFICIENT_BUFFER)) {
+               q.in.offered = needed;
+               buffer = talloc_array(tctx, uint8_t, needed);
+               q.out.buffer = buffer;
+               torture_assert_ntstatus_ok(tctx,
+                       dcerpc_svcctl_QueryServiceObjectSecurity_r(b, tctx, &q),
+                       "QueryServiceObjectSecurity failed!");
+       }
+
+       torture_assert_werr_ok(tctx, q.out.result,
+               "QueryServiceObjectSecurity failed!");
+
+       r.in.handle = &s;
+       r.in.security_flags = SECINFO_DACL;
+       r.in.buffer = q.out.buffer;
+       r.in.offered = *q.out.needed;
+
+       torture_assert_ntstatus_ok(tctx,
+               dcerpc_svcctl_SetServiceObjectSecurity_r(b, tctx, &r),
+               "SetServiceObjectSecurity failed!");
+       torture_assert_werr_ok(tctx, r.out.result,
+               "SetServiceObjectSecurity failed!");
+
+       if (!test_CloseServiceHandle(b, tctx, &s))
+               return false;
+
+       if (!test_CloseServiceHandle(b, tctx, &h))
+               return false;
+
+       return true;
+}
+
 static bool test_StartServiceW(struct torture_context *tctx,
                               struct dcerpc_pipe *p)
 {
@@ -570,6 +629,8 @@ 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, "SetServiceObjectSecurity",
+                                  test_SetServiceObjectSecurity);
        torture_rpc_tcase_add_test(tcase, "StartServiceW",
                                   test_StartServiceW);
        torture_rpc_tcase_add_test(tcase, "ControlService",


-- 
Samba Shared Repository

Reply via email to