From 57cd2235fa684f55bdeb075daf4b96cf1bf8c79d Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Mon, 18 Sep 2006 10:00:19 +0000 Subject: r18611: Do not return NT_STATUS_OK when libnet_Add|DelShare has failed. Guenther (This used to be commit 1709ad741b43a19eaeef9e0a64e70a52132c088b) --- source4/libnet/libnet_share.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/source4/libnet/libnet_share.c b/source4/libnet/libnet_share.c index 6bcc693bd9..51152fb072 100644 --- a/source4/libnet/libnet_share.c +++ b/source4/libnet/libnet_share.c @@ -134,13 +134,19 @@ NTSTATUS libnet_AddShare(struct libnet_context *ctx, s.in.info.info2 = &r->in.share; s.in.server_unc = talloc_asprintf(mem_ctx, "\\\\%s", r->in.server_name); - status = dcerpc_srvsvc_NetShareAdd(c.out.dcerpc_pipe, mem_ctx,&s); + status = dcerpc_srvsvc_NetShareAdd(c.out.dcerpc_pipe, mem_ctx, &s); if (!NT_STATUS_IS_OK(status)) { r->out.error_string = talloc_asprintf(mem_ctx, "srvsvc_NetShareAdd on server '%s' failed" ": %s", r->in.server_name, nt_errstr(status)); + } else if (!W_ERROR_IS_OK(s.out.result)) { + r->out.error_string = talloc_asprintf(mem_ctx, + "srvsvc_NetShareAdd on server '%s' failed" + ": %s", + r->in.server_name, win_errstr(s.out.result)); + status = werror_to_ntstatus(s.out.result); } talloc_free(c.out.dcerpc_pipe); @@ -178,6 +184,12 @@ NTSTATUS libnet_DelShare(struct libnet_context *ctx, "srvsvc_NetShareDel on server '%s' failed" ": %s", r->in.server_name, nt_errstr(status)); + } else if (!W_ERROR_IS_OK(s.out.result)) { + r->out.error_string = talloc_asprintf(mem_ctx, + "srvsvc_NetShareDel on server '%s' failed" + ": %s", + r->in.server_name, win_errstr(s.out.result)); + status = werror_to_ntstatus(s.out.result); } talloc_free(c.out.dcerpc_pipe); -- cgit