summaryrefslogtreecommitdiff
path: root/source3/smbd/vfs-wrap.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2001-01-23 01:52:30 +0000
committerJeremy Allison <jra@samba.org>2001-01-23 01:52:30 +0000
commit2f7c1db093504a9798cdfd9c5d08a259cb4abc46 (patch)
tree31db36db246f4f9bb42135b7526f64168f4dd6c5 /source3/smbd/vfs-wrap.c
parent3ea544fecba9d6aa662491ea4006b57a6fb6e79f (diff)
downloadsamba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.tar.gz
samba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.tar.bz2
samba-2f7c1db093504a9798cdfd9c5d08a259cb4abc46.zip
include/vfs.h:
smbd/vfs-wrap.c: smbd/vfs.c: Added fchmod_acl and chmod_acl. lib/substitute.c: smbd/lanman.c: smbd/open.c: smbd/process.c: smbd/reply.c: smbd/service.c: Removed sessetup_user variable. Added current_user_info struct which conatins domain info etc. Added '%D' for client domain parameter. Jeremy. (This used to be commit 2844ec3d511680609d6794b8718001a1bda9e89f)
Diffstat (limited to 'source3/smbd/vfs-wrap.c')
-rw-r--r--source3/smbd/vfs-wrap.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/source3/smbd/vfs-wrap.c b/source3/smbd/vfs-wrap.c
index a9d8a32430..ad4d4ddbef 100644
--- a/source3/smbd/vfs-wrap.c
+++ b/source3/smbd/vfs-wrap.c
@@ -107,6 +107,20 @@ int vfswrap_mkdir(connection_struct *conn, char *path, mode_t mode)
#endif
result = mkdir(path, mode);
+
+ if (result == 0) {
+ /*
+ * We need to do this as the default behavior of POSIX ACLs
+ * is to set the mask to be the requested group permission
+ * bits, not the group permission bits to be the requested
+ * group permission bits. This is not what we want, as it will
+ * mess up any inherited ACL bits that were set. JRA.
+ */
+ if (conn->vfs_ops.chmod_acl != NULL) {
+ conn->vfs_ops.chmod_acl(conn, path, mode);
+ }
+ }
+
END_PROFILE(syscall_mkdir);
return result;
}
@@ -332,6 +346,19 @@ int vfswrap_chmod(connection_struct *conn, char *path, mode_t mode)
}
#endif
+ /*
+ * We need to do this due to the fact that the default POSIX ACL
+ * chmod modifies the ACL *mask* for the group owner, not the
+ * group owner bits directly. JRA.
+ */
+
+ if (conn->vfs_ops.chmod_acl != NULL) {
+ if ((result = conn->vfs_ops.chmod_acl(conn, path, mode)) == 0) {
+ END_PROFILE(syscall_chmod);
+ return result;
+ }
+ }
+
result = chmod(path, mode);
END_PROFILE(syscall_chmod);
return result;
@@ -506,4 +533,15 @@ BOOL vfswrap_set_nt_acl(files_struct *fsp, char *name, uint32 security_info_sent
{
return set_nt_acl(fsp, security_info_sent, psd);
}
+
+int vfswrap_chmod_acl(connection_struct *conn, char *name, mode_t mode)
+{
+ return chmod_acl(name, mode);
+}
+
+int vfswrap_fchmod_acl(files_struct *fsp, int fd, mode_t mode)
+{
+ return fchmod_acl(fd, mode);
+}
+
#undef OLD_NTDOMAIN