s3:rpcclient: introduce global rpcclient_cli_state
authorStefan Metzmacher <metze@samba.org>
Fri, 13 Sep 2013 09:06:00 +0000 (11:06 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 16 Oct 2013 19:48:51 +0000 (08:48 +1300)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source3/rpcclient/rpcclient.c
source3/rpcclient/rpcclient.h

index 42c565d211af01b2931fdaa0973ac66aa1626bdd..c88e6b30d81489ac3d78f58302d23cf8e1065a15 100644 (file)
@@ -49,6 +49,7 @@ static unsigned int timeout = 0;
 static enum dcerpc_transport_t default_transport = NCACN_NP;
 
 struct user_auth_info *rpcclient_auth_info;
+struct cli_state *rpcclient_cli_state;
 
 /* List to hold groups of commands.
  *
@@ -1113,7 +1114,7 @@ out_free:
 #endif
 
        /* Load command lists */
-
+       rpcclient_cli_state = cli;
        timeout = cli_set_timeout(cli, 10000);
 
        cmd_set = rpcclient_command_list;
@@ -1161,6 +1162,7 @@ out_free:
        }
 
 done:
+       rpcclient_cli_state = NULL;
        if (cli != NULL) {
                cli_shutdown(cli);
        }
index 762c54aacda75ca097ffb5591c4afd6728c04d8f..ae12cac4d0a511d0c559efd3e0b87ed784d9151c 100644 (file)
@@ -41,4 +41,6 @@ struct cmd_set {
        const char *usage;
 };
 
+extern struct cli_state *rpcclient_cli_state;
+
 #endif /* RPCCLIENT_H */