[SCM] Samba Shared Repository - branch v3-6-test updated
Jeremy Allison
jra at samba.org
Sun Apr 3 18:43:45 MDT 2011
The branch, v3-6-test has been updated
via 702c32d Fix bug #7987 - ACL can get lost when files are being renamed.
from 546d41f s3: Fix bug 8042: File creation on OS/X
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-6-test
- Log -----------------------------------------------------------------
commit 702c32d87e39a40412c97713a6511a0072b6f047
Author: Jeremy Allison <jra at samba.org>
Date: Fri Apr 1 16:50:28 2011 -0700
Fix bug #7987 - ACL can get lost when files are being renamed.
There is no reason for smbd with Windows ACLs to use chmod
or fchmod unless it's a file opened with UNIX extensions or
with posix pathnames.
Autobuild-User: Jeremy Allison <jra at samba.org>
Autobuild-Date: Sat Apr 2 02:40:43 CEST 2011 on sn-devel-104
(cherry picked from commit 00224d06c389e9744b83bcec09a9d002086058fc)
-----------------------------------------------------------------------
Summary of changes:
source3/modules/vfs_acl_common.c | 40 ++++++++++++++++++++++++++++++++++++++
source3/modules/vfs_acl_tdb.c | 6 ++++-
source3/modules/vfs_acl_xattr.c | 4 +++
3 files changed, 49 insertions(+), 1 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/modules/vfs_acl_common.c b/source3/modules/vfs_acl_common.c
index e01ac4e..368f420 100644
--- a/source3/modules/vfs_acl_common.c
+++ b/source3/modules/vfs_acl_common.c
@@ -1018,3 +1018,43 @@ static int unlink_acl_common(struct vfs_handle_struct *handle,
smb_fname->base_name,
false);
}
+
+static int chmod_acl_module_common(struct vfs_handle_struct *handle,
+ const char *path, mode_t mode)
+{
+ if (lp_posix_pathnames()) {
+ /* Only allow this on POSIX pathnames. */
+ return SMB_VFS_NEXT_CHMOD(handle, path, mode);
+ }
+ return 0;
+}
+
+static int fchmod_acl_module_common(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, mode_t mode)
+{
+ if (fsp->posix_open) {
+ /* Only allow this on POSIX opens. */
+ return SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
+ }
+ return 0;
+}
+
+static int chmod_acl_acl_module_common(struct vfs_handle_struct *handle,
+ const char *name, mode_t mode)
+{
+ if (lp_posix_pathnames()) {
+ /* Only allow this on POSIX pathnames. */
+ return SMB_VFS_NEXT_CHMOD_ACL(handle, name, mode);
+ }
+ return 0;
+}
+
+static int fchmod_acl_acl_module_common(struct vfs_handle_struct *handle,
+ struct files_struct *fsp, mode_t mode)
+{
+ if (fsp->posix_open) {
+ /* Only allow this on POSIX opens. */
+ return SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
+ }
+ return 0;
+}
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index 5fc1bc0..3e5abd9 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -398,13 +398,17 @@ static struct vfs_fn_pointers vfs_acl_tdb_fns = {
.disconnect = disconnect_acl_tdb,
.opendir = opendir_acl_common,
.mkdir = mkdir_acl_common,
+ .rmdir = rmdir_acl_tdb,
.open = open_acl_common,
.create_file = create_file_acl_common,
.unlink = unlink_acl_tdb,
- .rmdir = rmdir_acl_tdb,
+ .chmod = chmod_acl_module_common,
+ .fchmod = fchmod_acl_module_common,
.fget_nt_acl = fget_nt_acl_common,
.get_nt_acl = get_nt_acl_common,
.fset_nt_acl = fset_nt_acl_common,
+ .chmod_acl = chmod_acl_acl_module_common,
+ .fchmod_acl = fchmod_acl_acl_module_common,
.sys_acl_set_file = sys_acl_set_file_tdb,
.sys_acl_set_fd = sys_acl_set_fd_tdb
};
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index aa7aeae..0609d7f 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -207,9 +207,13 @@ static struct vfs_fn_pointers vfs_acl_xattr_fns = {
.open = open_acl_common,
.create_file = create_file_acl_common,
.unlink = unlink_acl_common,
+ .chmod = chmod_acl_module_common,
+ .fchmod = fchmod_acl_module_common,
.fget_nt_acl = fget_nt_acl_common,
.get_nt_acl = get_nt_acl_common,
.fset_nt_acl = fset_nt_acl_common,
+ .chmod_acl = chmod_acl_acl_module_common,
+ .fchmod_acl = fchmod_acl_acl_module_common,
.sys_acl_set_file = sys_acl_set_file_xattr,
.sys_acl_set_fd = sys_acl_set_fd_xattr
};
--
Samba Shared Repository
More information about the samba-cvs
mailing list