diff options
author | Günther Deschner <gd@samba.org> | 2006-09-18 10:00:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:18:56 -0500 |
commit | 57cd2235fa684f55bdeb075daf4b96cf1bf8c79d (patch) | |
tree | 7c7d3c1b1f2a3e478c978e7e11894a9b78b2799e /source4 | |
parent | 28c9c212bc49cef7e5d67f8e93f1991f93e560cc (diff) | |
download | samba-57cd2235fa684f55bdeb075daf4b96cf1bf8c79d.tar.gz samba-57cd2235fa684f55bdeb075daf4b96cf1bf8c79d.tar.bz2 samba-57cd2235fa684f55bdeb075daf4b96cf1bf8c79d.zip |
r18611: Do not return NT_STATUS_OK when libnet_Add|DelShare has failed.
Guenther
(This used to be commit 1709ad741b43a19eaeef9e0a64e70a52132c088b)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/libnet/libnet_share.c | 14 |
1 files changed, 13 insertions, 1 deletions
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); |