s3:rpcclient: make use of rpcclient_netlogon_creds instead of cli->netlogon_creds
authorStefan Metzmacher <metze@samba.org>
Mon, 16 Sep 2013 17:00:22 +0000 (19:00 +0200)
committerStefan Metzmacher <metze@samba.org>
Tue, 7 Jan 2014 11:47:11 +0000 (12:47 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpcclient/cmd_netlogon.c

index 8a865a90dbe7a65d171529ecd2a798caff533a9d..59e1e4e37a84a3d6ac45b0b01e947f991a21695d 100644 (file)
@@ -633,7 +633,11 @@ static NTSTATUS cmd_netlogon_sam_sync(struct rpc_pipe_client *cli,
                struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL;
                struct netlogon_creds_CredentialState *creds = NULL;
 
-               status = netlogon_creds_cli_lock(cli->netlogon_creds,
+               if (rpcclient_netlogon_creds == NULL) {
+                       return NT_STATUS_UNSUCCESSFUL;
+               }
+
+               status = netlogon_creds_cli_lock(rpcclient_netlogon_creds,
                                                 mem_ctx, &creds);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
@@ -712,7 +716,11 @@ static NTSTATUS cmd_netlogon_sam_deltas(struct rpc_pipe_client *cli,
                struct netr_DELTA_ENUM_ARRAY *delta_enum_array = NULL;
                struct netlogon_creds_CredentialState *creds = NULL;
 
-               status = netlogon_creds_cli_lock(cli->netlogon_creds,
+               if (rpcclient_netlogon_creds == NULL) {
+                       return NT_STATUS_UNSUCCESSFUL;
+               }
+
+               status = netlogon_creds_cli_lock(rpcclient_netlogon_creds,
                                                 mem_ctx, &creds);
                if (!NT_STATUS_IS_OK(status)) {
                        return status;
@@ -1157,11 +1165,11 @@ static NTSTATUS cmd_netlogon_database_redo(struct rpc_pipe_client *cli,
                sscanf(argv[1], "%d", &rid);
        }
 
-       if (cli->netlogon_creds == NULL) {
+       if (rpcclient_netlogon_creds == NULL) {
                return NT_STATUS_UNSUCCESSFUL;
        }
 
-       status = netlogon_creds_cli_lock(cli->netlogon_creds,
+       status = netlogon_creds_cli_lock(rpcclient_netlogon_creds,
                                         mem_ctx, &creds);
        if (!NT_STATUS_IS_OK(status)) {
                return status;
@@ -1223,7 +1231,11 @@ static NTSTATUS cmd_netlogon_capabilities(struct rpc_pipe_client *cli,
 
        ZERO_STRUCT(return_authenticator);
 
-       status = netlogon_creds_cli_lock(cli->netlogon_creds,
+       if (rpcclient_netlogon_creds == NULL) {
+               return NT_STATUS_UNSUCCESSFUL;
+       }
+
+       status = netlogon_creds_cli_lock(rpcclient_netlogon_creds,
                                         mem_ctx, &creds);
        if (!NT_STATUS_IS_OK(status)) {
                return status;