r26286: IDL and torture test for netr_ServerTrustPasswordsGet().
authorGünther Deschner <gd@samba.org>
Tue, 4 Dec 2007 09:20:13 +0000 (10:20 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:09 +0000 (05:48 +0100)
Guenther

source/librpc/idl/netlogon.idl
source/rpc_server/netlogon/dcerpc_netlogon.c
source/samba4-knownfail
source/torture/rpc/netlogon.c

index 8e0950c2aa5dde0eb10bc0e3193f7d38b7f378f6..5285ee15ed8204219dd44550e037e10b75387df6 100644 (file)
@@ -1269,7 +1269,16 @@ interface netlogon
 
        /****************/
        /* Function 0x2a */
-       WERROR netr_NETRSERVERTRUSTPASSWORDSGET();
+       NTSTATUS netr_ServerTrustPasswordsGet(
+               [in]  [string,charset(UTF16)] uint16 *server_name,
+               [in]  [string,charset(UTF16)] uint16 account_name[],
+               [in]  netr_SchannelType secure_channel_type,
+               [in]  [string,charset(UTF16)] uint16 computer_name[],
+               [in,ref] netr_Authenticator *credential,
+               [out,ref] netr_Authenticator *return_authenticator,
+               [out,ref] samr_Password *password,
+               [out,ref] samr_Password *password2
+       );
 
        /****************/
        /* Function 0x2b */
index d2390a8de056f9e3d80bac6c948b258f694567f4..a6e955178d225734c6921c708a6c3c5f952c5e76 100644 (file)
@@ -1206,11 +1206,11 @@ static WERROR dcesrv_netr_DSRDEREGISTERDNSHOSTRECORDS(struct dcesrv_call_state *
 }
 
 
-/* 
-  netr_NETRSERVERTRUSTPASSWORDSGET 
+/*
+  netr_ServerTrustPasswordsGet
 */
-static WERROR dcesrv_netr_NETRSERVERTRUSTPASSWORDSGET(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-                      struct netr_NETRSERVERTRUSTPASSWORDSGET *r)
+static NTSTATUS dcesrv_netr_ServerTrustPasswordsGet(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+                      struct netr_ServerTrustPasswordsGet *r)
 {
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
index 11726383d14a283ddbe29059eb0fc0d651baef18..5e56aa6d97d7079d00deae5f99a914bfb40a746a 100644 (file)
@@ -30,5 +30,6 @@ RPC-NETLOGON.*/DsrGetDcSiteCoverageW
 RPC-NETLOGON.*/DsRAddressToSitenamesW
 RPC-NETLOGON.*/DsRAddressToSitenamesExW
 RPC-NETLOGON.*/GetPassword
+RPC-NETLOGON.*/GetTrustPasswords
 BASE-CHARSET.*/Testing partial surrogate
 .*NET-API-DELSHARE.*                           # DelShare isn't implemented yet
index c0b26e0d8730d88dfec95a0f382c38aa8ca35bb0..74bc3a2bf78f6aaa0eef330a6660cdafe8e8f1a2 100644 (file)
@@ -468,6 +468,39 @@ static bool test_GetPassword(struct torture_context *tctx,
 
        return true;
 }
+
+static bool test_GetTrustPasswords(struct torture_context *tctx,
+                                  struct dcerpc_pipe *p,
+                                  struct cli_credentials *machine_credentials)
+{
+       struct netr_ServerTrustPasswordsGet r;
+       struct creds_CredentialState *creds;
+       struct netr_Authenticator credential;
+       NTSTATUS status;
+       struct netr_Authenticator return_authenticator;
+       struct samr_Password password, password2;
+
+       if (!test_SetupCredentials(p, tctx, machine_credentials, &creds)) {
+               return false;
+       }
+
+       creds_client_authenticator(creds, &credential);
+
+       r.in.server_name = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
+       r.in.account_name = talloc_asprintf(tctx, "%s$", TEST_MACHINE_NAME);
+       r.in.secure_channel_type = SEC_CHAN_BDC;
+       r.in.computer_name = TEST_MACHINE_NAME;
+       r.in.credential = &credential;
+       r.out.return_authenticator = &return_authenticator;
+       r.out.password = &password;
+       r.out.password2 = &password2;
+
+       status = dcerpc_netr_ServerTrustPasswordsGet(p, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "ServerTrustPasswordsGet");
+
+       return true;
+}
+
 /*
   try a netlogon SamLogon
 */
@@ -1531,6 +1564,8 @@ struct torture_suite *torture_rpc_netlogon(TALLOC_CTX *mem_ctx)
        torture_rpc_tcase_add_test_creds(tcase, "SamLogon", test_SamLogon);
        torture_rpc_tcase_add_test_creds(tcase, "SetPassword", test_SetPassword);
        torture_rpc_tcase_add_test_creds(tcase, "SetPassword2", test_SetPassword2);
+       torture_rpc_tcase_add_test_creds(tcase, "GetPassword", test_GetPassword);
+       torture_rpc_tcase_add_test_creds(tcase, "GetTrustPasswords", test_GetTrustPasswords);
        torture_rpc_tcase_add_test_creds(tcase, "GetDomainInfo", test_GetDomainInfo);
        torture_rpc_tcase_add_test_creds(tcase, "DatabaseSync", test_DatabaseSync);
        torture_rpc_tcase_add_test_creds(tcase, "DatabaseDeltas", test_DatabaseDeltas);