added IDL and test suite for lsa_CreateSecret()
authorAndrew Tridgell <tridge@samba.org>
Sat, 3 Apr 2004 17:15:32 +0000 (17:15 +0000)
committerAndrew Tridgell <tridge@samba.org>
Sat, 3 Apr 2004 17:15:32 +0000 (17:15 +0000)
(This used to be commit 4de08b64ddb3851e90a8dadd7d0d0991e933abf5)

source4/librpc/idl/lsa.idl
source4/torture/rpc/lsa.c

index 3e9ca1be3faaf63917dd12ce622fa27150772f39..f90ad030d22498551df940dad77cfd9360d83ce8 100644 (file)
 
 
        /* Function:        0x10 */
-       NTSTATUS CREATESECRET ();
+       NTSTATUS lsa_CreateSecret(
+               [in,ref]     policy_handle *handle,
+               [in]         lsa_Name       name,
+               [in]         uint32         desired_access,
+               [out,ref]    policy_handle *sec_handle
+               );
 
 
        /*****************************************/
index 3b7e4dbe5dc920db2bfd1a7a488d6bd515df55dc..f50d189dd21d5108fc2b7cbf52d1fa15b2fb416e 100644 (file)
@@ -380,6 +380,35 @@ static BOOL test_CreateTrustedDomain(struct dcerpc_pipe *p,
        return True;
 }
 
+static BOOL test_CreateSecret(struct dcerpc_pipe *p, 
+                             TALLOC_CTX *mem_ctx, 
+                             struct policy_handle *handle)
+{
+       NTSTATUS status;
+       struct lsa_CreateSecret r;
+       struct policy_handle sec_handle;
+
+       printf("Testing CreateSecret\n");
+
+       init_lsa_Name(&r.in.name, "torturesecret");
+
+       r.in.handle = handle;
+       r.in.desired_access = SEC_RIGHTS_MAXIMUM_ALLOWED;
+       r.out.sec_handle = &sec_handle;
+
+       status = dcerpc_lsa_CreateSecret(p, mem_ctx, &r);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("CreateSecret failed - %s\n", nt_errstr(status));
+               return False;
+       }
+
+       if (!test_Delete(p, mem_ctx, &sec_handle)) {
+               return False;
+       }
+
+       return True;
+}
+
 static BOOL test_EnumAccountRights(struct dcerpc_pipe *p, 
                                   TALLOC_CTX *mem_ctx, 
                                   struct policy_handle *acct_handle,
@@ -675,6 +704,10 @@ BOOL torture_rpc_lsa(int dummy)
                ret = False;
        }
 
+       if (!test_CreateSecret(p, mem_ctx, &handle)) {
+               ret = False;
+       }
+
        if (!test_CreateTrustedDomain(p, mem_ctx, &handle)) {
                ret = False;
        }