s3-rpcclient: allow to define server_unc in cmd_srvsvc_srv_query_info().
authorGünther Deschner <gd@samba.org>
Wed, 7 Apr 2010 12:38:31 +0000 (14:38 +0200)
committerGünther Deschner <gd@samba.org>
Wed, 7 Apr 2010 12:41:13 +0000 (14:41 +0200)
Guenther

source3/rpcclient/cmd_srvsvc.c

index 866b68111d81380a454debb4c3cf504b06ebfad4..890151e2b4ab2d5cd1b9df079159e749bb6c7df2 100644 (file)
@@ -173,17 +173,23 @@ static WERROR cmd_srvsvc_srv_query_info(struct rpc_pipe_client *cli,
        union srvsvc_NetSrvInfo info;
        WERROR result;
        NTSTATUS status;
+       const char *server_unc = cli->srv_name_slash;
 
-       if (argc > 2) {
-               printf("Usage: %s [infolevel]\n", argv[0]);
+       if (argc > 3) {
+               printf("Usage: %s [infolevel] [server_unc]\n", argv[0]);
                return WERR_OK;
        }
 
-       if (argc == 2)
+       if (argc >= 2) {
                info_level = atoi(argv[1]);
+       }
+
+       if (argc >= 3) {
+               server_unc = argv[2];
+       }
 
        status = rpccli_srvsvc_NetSrvGetInfo(cli, mem_ctx,
-                                            cli->srv_name_slash,
+                                            server_unc,
                                             info_level,
                                             &info,
                                             &result);