summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-10-21 16:27:38 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:36 -0500
commit0dab687fcee526d1b8f0cb8e92bc6e8107481b11 (patch)
tree25f883edb4e17b46a30199d7986c075275f877bc /source3/utils
parente7c14137fa4f6c37b9418bc161f09d2617657274 (diff)
downloadsamba-0dab687fcee526d1b8f0cb8e92bc6e8107481b11.tar.gz
samba-0dab687fcee526d1b8f0cb8e92bc6e8107481b11.tar.bz2
samba-0dab687fcee526d1b8f0cb8e92bc6e8107481b11.zip
r19445: Attempt to fix net rpc share
(This used to be commit 769988f83adac5f8adcf6a3cda68fb8f26a0327d)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c43
1 files changed, 42 insertions, 1 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index c22ffb9878..33889235bf 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3137,6 +3137,25 @@ static NTSTATUS get_share_info(struct rpc_pipe_client *pipe_hnd,
uint32 *numentries)
{
union srvsvc_NetShareInfo info;
+ NTSTATUS status;
+
+ switch(level) {
+ case 1:
+ if (!(ctr->ctr1 = TALLOC_ZERO_P(
+ mem_ctx, struct srvsvc_NetShareCtr1))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ break;
+ case 502:
+ if (!(ctr->ctr502 = TALLOC_ZERO_P(
+ mem_ctx, struct srvsvc_NetShareCtr502))) {
+ return NT_STATUS_NO_MEMORY;
+ }
+ break;
+ default:
+ return NT_STATUS_INVALID_LEVEL;
+ break;
+ }
/* no specific share requested, enumerate all */
if (argc == 0) {
@@ -3147,7 +3166,29 @@ static NTSTATUS get_share_info(struct rpc_pipe_client *pipe_hnd,
}
/* request just one share */
- return rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx, NULL, argv[0], level, &info);
+ status = rpccli_srvsvc_NetShareGetInfo(pipe_hnd, mem_ctx, NULL,
+ argv[0], level, &info);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ *numentries = 1;
+
+ switch(level) {
+ case 1:
+ ctr->ctr1->count = 1;
+ ctr->ctr1->array = info.info1;
+ break;
+ case 502:
+ ctr->ctr501->count = 1;
+ ctr->ctr502->array = info.info502;
+ break;
+ default:
+ return NT_STATUS_INTERNAL_ERROR;
+ break;
+ }
+
+ return NT_STATUS_OK;
}
/**