r26285: Add IDL and torture test for netr_ServerPasswordGet().
authorGünther Deschner <gd@samba.org>
Tue, 4 Dec 2007 08:41:28 +0000 (09:41 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:48:08 +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 9743f74b34538ab5e31ce0a14fb21893dee2f717..8e0950c2aa5dde0eb10bc0e3193f7d38b7f378f6 100644 (file)
@@ -1112,7 +1112,15 @@ interface netlogon
 
        /****************/
        /* Function 0x1f */
-       WERROR netr_NETRSERVERPASSWORDGET();
+       WERROR netr_ServerPasswordGet(
+               [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
+               );
 
        /****************/
        /* Function 0x20 */
index 1c6a1d0588184881fb3004a8f16a7d7a65f68ccd..d2390a8de056f9e3d80bac6c948b258f694567f4 100644 (file)
@@ -946,11 +946,11 @@ static NTSTATUS dcesrv_netr_LogonGetDomainInfo(struct dcesrv_call_state *dce_cal
 
 
 
-/* 
-  netr_NETRSERVERPASSWORDGET 
+/*
+  netr_ServerPasswordGet
 */
-static WERROR dcesrv_netr_NETRSERVERPASSWORDGET(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
-                      struct netr_NETRSERVERPASSWORDGET *r)
+static WERROR dcesrv_netr_ServerPasswordGet(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
+                      struct netr_ServerPasswordGet *r)
 {
        DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
 }
index e9226f86a701c03ec0475a466393cf2a4002254a..11726383d14a283ddbe29059eb0fc0d651baef18 100644 (file)
@@ -29,5 +29,6 @@ RPC-NETLOGON.*/NetrEnumerateTrustedDomainsEx
 RPC-NETLOGON.*/DsrGetDcSiteCoverageW
 RPC-NETLOGON.*/DsRAddressToSitenamesW
 RPC-NETLOGON.*/DsRAddressToSitenamesExW
+RPC-NETLOGON.*/GetPassword
 BASE-CHARSET.*/Testing partial surrogate
 .*NET-API-DELSHARE.*                           # DelShare isn't implemented yet
index 92fd27b8ce7f8ae05a3090e95e9d80fc7ce2d719..c0b26e0d8730d88dfec95a0f382c38aa8ca35bb0 100644 (file)
@@ -438,6 +438,36 @@ static bool test_SetPassword2(struct torture_context *tctx,
        return true;
 }
 
+static bool test_GetPassword(struct torture_context *tctx,
+                            struct dcerpc_pipe *p,
+                            struct cli_credentials *machine_credentials)
+{
+       struct netr_ServerPasswordGet r;
+       struct creds_CredentialState *creds;
+       struct netr_Authenticator credential;
+       NTSTATUS status;
+       struct netr_Authenticator return_authenticator;
+       struct samr_Password password;
+
+       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;
+
+       status = dcerpc_netr_ServerPasswordGet(p, tctx, &r);
+       torture_assert_ntstatus_ok(tctx, status, "ServerPasswordGet");
+
+       return true;
+}
 /*
   try a netlogon SamLogon
 */