summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-07-01 21:47:13 +0000
committerJeremy Allison <jra@samba.org>2003-07-01 21:47:13 +0000
commit58fca5074216891bcc9b0c1674b221646af79841 (patch)
tree0e51fb3d7b29dd2383942a41f4cdcf9bb80806ee /source3
parent15ac8bbed5e378617a00838ac54f3d081348ee62 (diff)
downloadsamba-58fca5074216891bcc9b0c1674b221646af79841.tar.gz
samba-58fca5074216891bcc9b0c1674b221646af79841.tar.bz2
samba-58fca5074216891bcc9b0c1674b221646af79841.zip
Adding jcmd's share ACL on XP patch. Thanks Jim !
Jeremy. (This used to be commit 7ed1118ae61a13de2c781a94fc2394090efd1f9b)
Diffstat (limited to 'source3')
-rw-r--r--source3/include/rpc_srvsvc.h8
-rw-r--r--source3/rpc_parse/parse_srv.c3
-rw-r--r--source3/rpc_server/srv_srvsvc_nt.c20
3 files changed, 27 insertions, 4 deletions
diff --git a/source3/include/rpc_srvsvc.h b/source3/include/rpc_srvsvc.h
index 94d23bb4bc..5ebb77a8c2 100644
--- a/source3/include/rpc_srvsvc.h
+++ b/source3/include/rpc_srvsvc.h
@@ -463,9 +463,15 @@ typedef struct ptr_info_1004_info
SH_INFO_1004_STR info_1004_str;
} SRV_SHARE_INFO_1004;
+#define SHARE_1005_IN_DFS 0x00000001
+#define SHARE_1005_DFS_ROOT 0x00000002
+/* use the CSC policy mask and shift to match up with the smb.conf parm */
+#define SHARE_1005_CSC_POLICY_MASK 0x00000030
+#define SHARE_1005_CSC_POLICY_SHIFT 4
+
typedef struct share_info_1005_info
{
- uint32 dfs_root_flag;
+ uint32 share_info_flags;
} SRV_SHARE_INFO_1005;
typedef struct share_info_1006_info
diff --git a/source3/rpc_parse/parse_srv.c b/source3/rpc_parse/parse_srv.c
index 27763aa224..bbb5193ddc 100644
--- a/source3/rpc_parse/parse_srv.c
+++ b/source3/rpc_parse/parse_srv.c
@@ -623,7 +623,8 @@ static BOOL srv_io_share_info1005(const char* desc, SRV_SHARE_INFO_1005* sh1005,
if(!prs_align(ps))
return False;
- if(!prs_uint32("dfs_root_flag", ps, depth, &sh1005->dfs_root_flag))
+ if(!prs_uint32("share_info_flags", ps, depth,
+ &sh1005->share_info_flags))
return False;
return True;
diff --git a/source3/rpc_server/srv_srvsvc_nt.c b/source3/rpc_server/srv_srvsvc_nt.c
index 57ba055aef..ea66a7d38b 100644
--- a/source3/rpc_server/srv_srvsvc_nt.c
+++ b/source3/rpc_server/srv_srvsvc_nt.c
@@ -432,10 +432,13 @@ static void init_srv_share_info_1004(pipes_struct *p, SRV_SHARE_INFO_1004* sh100
static void init_srv_share_info_1005(pipes_struct *p, SRV_SHARE_INFO_1005* sh1005, int snum)
{
- sh1005->dfs_root_flag = 0;
+ sh1005->share_info_flags = 0;
if(lp_host_msdfs() && lp_msdfs_root(snum))
- sh1005->dfs_root_flag = 3;
+ sh1005->share_info_flags |=
+ SHARE_1005_IN_DFS | SHARE_1005_DFS_ROOT;
+ sh1005->share_info_flags |=
+ lp_csc_policy(snum) << SHARE_1005_CSC_POLICY_SHIFT;
}
/***************************************************************************
Fill in a share info level 1006 structure.
@@ -1513,6 +1516,19 @@ WERROR _srv_net_share_set_info(pipes_struct *p, SRV_Q_NET_SHARE_SET_INFO *q_u, S
type = STYPE_DISKTREE;
break;
case 1005:
+ /* XP re-sets the csc policy even if it wasn't changed by the
+ user, so we must compare it to see if it's what is set in
+ smb.conf, so that we can contine other ops like setting
+ ACLs on a share */
+ if (((q_u->info.share.info1005.share_info_flags &
+ SHARE_1005_CSC_POLICY_MASK) >>
+ SHARE_1005_CSC_POLICY_SHIFT) == lp_csc_policy(snum))
+ return WERR_OK;
+ else {
+ DEBUG(3, ("_srv_net_share_set_info: client is trying to change csc policy from the network; must be done with smb.conf\n"));
+ return WERR_ACCESS_DENIED;
+ }
+ break;
case 1006:
case 1007:
return WERR_ACCESS_DENIED;