UCS Bug: https://forge.univention.org/bugzilla/show_bug.cgi?id=33751 New Samba share option "acl xattr update mtime" to make vfs_acl_xattr update the modification time of a file while setting NTACLs (default: false). --- a/lib/param/param_table.c 2014-01-06 13:06:42.000000000 +0100 +++ b/lib/param/param_table.c 2014-01-06 13:06:46.000000000 +0100 @@ -4365,6 +4365,15 @@ .special = NULL, .enum_list = NULL }, + { + .label = "acl xattr update mtime", + .type = P_BOOL, + .p_class = P_LOCAL, + .offset = LOCAL_VAR(bAclXattrUpdateMtime), + .special = NULL, + .enum_list = NULL, + .flags = FLAG_ADVANCED | FLAG_SHARE, + }, {NULL, P_BOOL, P_NONE, 0, NULL, NULL, 0} }; --- a/source3/param/loadparm.c 2014-01-06 20:45:53.000000000 +0100 +++ b/source3/param/loadparm.c 2014-01-06 15:41:32.000000000 +0100 @@ -279,6 +279,7 @@ .ismb_encrypt = SMB_SIGNING_DEFAULT, .bKernelShareModes = true, .bDurableHandles = true, + .bAclXattrUpdateMtime = false, .param_opt = NULL, .dummy = "" }; --- a/lib/param/param_functions.c 2014-01-06 20:42:54.000000000 +0100 +++ b/lib/param/param_functions.c 2014-01-06 15:42:46.000000000 +0100 @@ -152,6 +152,7 @@ FN_LOCAL_PARM_BOOL(change_notify, bChangeNotify) FN_LOCAL_PARM_BOOL(kernel_change_notify, bKernelChangeNotify) FN_LOCAL_BOOL(durable_handles, bDurableHandles) +FN_LOCAL_BOOL(acl_xattr_update_mtime, bAclXattrUpdateMtime) FN_GLOBAL_BOOL(allow_insecure_widelinks, bAllowInsecureWidelinks) FN_GLOBAL_BOOL(allow_trusted_domains, bAllowTrustedDomains) --- a/source3/modules/vfs_acl_common.c 2014-01-06 13:09:17.000000000 +0100 +++ b/source3/modules/vfs_acl_common.c 2014-01-06 13:08:54.000000000 +0100 @@ -814,6 +814,20 @@ } } + if (lp_acl_xattr_update_mtime(SNUM(handle->conn))) { + DEBUG(10,("fset_nt_acl_xattr: updating mtime of %s (fd: %d)\n", + fsp_str_dbg(fsp), fsp->fh->fd)); + if (fsp->fh->fd != -1) { + ret = futimes(fsp->fh->fd, NULL); + } else { + ret = utime(fsp->fsp_name->base_name, NULL); + } + if (ret != 0) { + DEBUG(10,("fset_nt_acl_xattr: error updating mtime: %s\n", + strerror(errno))); + } + } + /* Get the full underlying sd, then hash. */ status = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp,