diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/netapi/share.c | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/source3/lib/netapi/share.c b/source3/lib/netapi/share.c index 414900a11d..c6af548225 100644 --- a/source3/lib/netapi/share.c +++ b/source3/lib/netapi/share.c @@ -481,7 +481,65 @@ WERROR NetShareGetInfo_l(struct libnetapi_ctx *ctx, WERROR NetShareSetInfo_r(struct libnetapi_ctx *ctx, struct NetShareSetInfo *r) { - return WERR_NOT_SUPPORTED; + WERROR werr; + NTSTATUS status; + struct cli_state *cli = NULL; + struct rpc_pipe_client *pipe_cli = NULL; + union srvsvc_NetShareInfo info; + + if (!r->in.buffer) { + return WERR_INVALID_PARAM; + } + + switch (r->in.level) { + case 2: + case 1004: + break; + case 1: + case 502: + case 503: + case 1005: + case 1006: + case 1501: + return WERR_NOT_SUPPORTED; + default: + return WERR_UNKNOWN_LEVEL; + } + + werr = libnetapi_open_pipe(ctx, r->in.server_name, + &ndr_table_srvsvc.syntax_id, + &cli, + &pipe_cli); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + status = map_SHARE_INFO_buffer_to_srvsvc_share_info(ctx, + r->in.buffer, + r->in.level, + &info); + if (!NT_STATUS_IS_OK(status)) { + werr = ntstatus_to_werror(status); + goto done; + } + + status = rpccli_srvsvc_NetShareSetInfo(pipe_cli, ctx, + r->in.server_name, + r->in.net_name, + r->in.level, + &info, + r->out.parm_err, + &werr); + if (!W_ERROR_IS_OK(werr)) { + goto done; + } + + done: + if (!cli) { + return werr; + } + + return werr; } /**************************************************************** |