summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-04-09 18:03:02 +0000
committerJeremy Allison <jra@samba.org>2001-04-09 18:03:02 +0000
commit7130bb0dcf6194e7098a4d81c6149d810179fb7c (patch)
tree46f03fee42a5662eb7cdeefd53f98ae0cb0d500a /source3
parent7fba7a0e82e887001d3aa5c3b38c7ee4203a55bc (diff)
downloadsamba-7130bb0dcf6194e7098a4d81c6149d810179fb7c.tar.gz
samba-7130bb0dcf6194e7098a4d81c6149d810179fb7c.tar.bz2
samba-7130bb0dcf6194e7098a4d81c6149d810179fb7c.zip
Tidy up return codes for server manager.
Jeremy. (This used to be commit b4cbdcb644066e132d5c806ae4f45d6a05276beb)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 4537cd30d0..3b0bb352fe 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -1235,13 +1235,17 @@ uint32 _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
r_u->switch_value = 0;
if (strequal(share_name,"IPC$") || strequal(share_name,"ADMIN$"))
- return NT_STATUS_BAD_NETWORK_NAME;
+ return ERROR_ACCESS_DENIED;
snum = find_service(share_name);
/* Does this share exist ? */
if (snum < 0)
- return NT_STATUS_BAD_NETWORK_NAME;
+ return ERRnosuchshare;
+
+ /* No change to printer shares. */
+ if (lp_print_ok(snum))
+ return ERROR_ACCESS_DENIED;
get_current_user(&user,p);
@@ -1360,11 +1364,15 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
get_current_user(&user,p);
- if (user.uid != 0)
+ if (user.uid != 0) {
+ DEBUG(10,("_srv_net_share_add: uid != 0. Access denied.\n"));
return ERROR_ACCESS_DENIED;
+ }
- if (!lp_add_share_cmd() || !*lp_add_share_cmd())
+ if (!lp_add_share_cmd() || !*lp_add_share_cmd()) {
+ DEBUG(10,("_srv_net_share_add: No add share command\n"));
return ERROR_ACCESS_DENIED;
+ }
switch (q_u->info_level) {
case 1:
@@ -1398,7 +1406,7 @@ uint32 _srv_net_share_add(pipes_struct *p, SRV_Q_NET_SHARE_ADD *q_u, SRV_R_NET_S
/* Share already exists. */
if (snum >= 0)
- return NT_STATUS_BAD_NETWORK_NAME;
+ return ERRfilexists;
/* We can only add disk shares. */
if (type != STYPE_DISKTREE)
@@ -1461,10 +1469,17 @@ uint32 _srv_net_share_del(pipes_struct *p, SRV_Q_NET_SHARE_DEL *q_u, SRV_R_NET_S
unistr2_to_ascii(share_name, &q_u->uni_share_name, sizeof(share_name));
+ if (strequal(share_name,"IPC$") || strequal(share_name,"ADMIN$"))
+ return ERROR_ACCESS_DENIED;
+
snum = find_service(share_name);
if (snum < 0)
- return NT_STATUS_BAD_NETWORK_NAME;
+ return ERRnosuchshare;
+
+ /* No change to printer shares. */
+ if (lp_print_ok(snum))
+ return ERROR_ACCESS_DENIED;
get_current_user(&user,p);