diff options
author | Günther Deschner <gd@samba.org> | 2006-09-26 23:43:58 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:14:48 -0500 |
commit | efffbc90362aa9d09f4c3f2e17f040ad81f7988d (patch) | |
tree | 0978d6c03856b68e5cc6b3283a6de40504f88747 /source3 | |
parent | c67b5558741ca1e425ed5f51589db3c9ecbf782d (diff) | |
download | samba-efffbc90362aa9d09f4c3f2e17f040ad81f7988d.tar.gz samba-efffbc90362aa9d09f4c3f2e17f040ad81f7988d.tar.bz2 samba-efffbc90362aa9d09f4c3f2e17f040ad81f7988d.zip |
r18935: Make "netshareenum" work again. There is most probably a better way to
do this... Any pointers?
Guenther
(This used to be commit 1f09e54fec9ac2e6173272d83d8c96d33636f1a0)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/rpcclient/cmd_srvsvc.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source3/rpcclient/cmd_srvsvc.c b/source3/rpcclient/cmd_srvsvc.c index c58f908cec..e1e5af752a 100644 --- a/source3/rpcclient/cmd_srvsvc.c +++ b/source3/rpcclient/cmd_srvsvc.c @@ -249,6 +249,8 @@ static NTSTATUS cmd_srvsvc_net_share_enum(struct rpc_pipe_client *cli, uint32 preferred_len = 0xffffffff, i; uint32 numentries; + ZERO_STRUCT(ctr); + if (argc > 2) { printf("Usage: %s [infolevel]\n", argv[0]); return NT_STATUS_OK; @@ -259,8 +261,33 @@ static NTSTATUS cmd_srvsvc_net_share_enum(struct rpc_pipe_client *cli, hnd = 0; + switch (info_level) { + case 1: { + struct srvsvc_NetShareCtr1 ctr1; + ZERO_STRUCT(ctr1); + ctr.ctr1 = &ctr1; + } + break; + + case 2: { + struct srvsvc_NetShareCtr2 ctr2; + ZERO_STRUCT(ctr2); + ctr.ctr2 = &ctr2; + } + break; + case 502: { + struct srvsvc_NetShareCtr502 ctr502; + ZERO_STRUCT(ctr502); + ctr.ctr502 = &ctr502; + } + break; + + default: + break; + } + result = rpccli_srvsvc_NetShareEnum( - cli, mem_ctx, NULL, &info_level, &ctr, preferred_len, &numentries, + cli, mem_ctx, cli->cli->desthost, &info_level, &ctr, preferred_len, &numentries, &hnd); if (!NT_STATUS_IS_OK(result) || !numentries) |