summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2008-09-04 20:24:23 +0200
committerGünther Deschner <gd@samba.org>2008-09-05 13:22:47 +0200
commit05449814e98b50a0f2615be5c476b48db1036f22 (patch)
tree78ad71d6c5e7d217cd9f0e44f6938e3eaab548f9
parent136ddc8f049a248b635d82ff395d774c5d78769d (diff)
downloadsamba-05449814e98b50a0f2615be5c476b48db1036f22.tar.gz
samba-05449814e98b50a0f2615be5c476b48db1036f22.tar.bz2
samba-05449814e98b50a0f2615be5c476b48db1036f22.zip
netapi: implement NetShareSetInfo_r.
Guenther (This used to be commit ebcd45ed3ff79ce3b90872aa87a737ba6ee3401f)
-rw-r--r--source3/lib/netapi/share.c60
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;
}
/****************************************************************