s3: fix empty ACL dialog for file in snapshot
authorChristian Ambach <christian.ambach@de.ibm.com>
Thu, 27 Jan 2011 18:31:45 +0000 (19:31 +0100)
committerVolker Lendecke <vl@samba.org>
Mon, 31 Jan 2011 10:55:49 +0000 (11:55 +0100)
Explorer failed to display the ACL of a file when it was
located in a snapshot.
Originally, this was already fixed with 30b5a1d2290fb09d362
in samba-ctdb v3.2.
The patch was ported to master, but there is no fget_nt_acl
operation any more so that part was ommited.
Afterwards, it was ported from there to 3.4 missing
the fget_nt_acl part now.

Re-adding now the lost part

source3/modules/vfs_shadow_copy2.c

index 96f0e7b821c367d542ec237cd536395105a4544a..1cffc77f12997bb25459b2296f06937c42cd5e35 100644 (file)
@@ -593,6 +593,14 @@ static NTSTATUS shadow_copy2_get_nt_acl(vfs_handle_struct *handle,
         SHADOW2_NTSTATUS_NEXT(GET_NT_ACL, (handle, name, security_info, ppdesc), NT_STATUS_ACCESS_DENIED);
 }
 
+static NTSTATUS shadow_copy2_fget_nt_acl(vfs_handle_struct *handle,
+                              files_struct *fsp, uint32 security_info,
+                              struct security_descriptor **ppdesc)
+{
+       char* fname = fsp->fsp_name;
+        SHADOW2_NTSTATUS_NEXT(GET_NT_ACL, (handle, name, security_info, ppdesc), NT_STATUS_ACCESS_DENIED);
+}
+
 static int shadow_copy2_mkdir(vfs_handle_struct *handle,  const char *fname, mode_t mode)
 {
         SHADOW2_NEXT(MKDIR, (handle, name, mode), int, -1);
@@ -766,6 +774,7 @@ static vfs_op_tuple shadow_copy2_ops[] = {
 
         /* NT File ACL operations */
         {SMB_VFS_OP(shadow_copy2_get_nt_acl), SMB_VFS_OP_GET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT},
+        {SMB_VFS_OP(shadow_copy2_fget_nt_acl), SMB_VFS_OP_FGET_NT_ACL, SMB_VFS_LAYER_TRANSPARENT},
 
         /* POSIX ACL operations */
         {SMB_VFS_OP(shadow_copy2_chmod_acl), SMB_VFS_OP_CHMOD_ACL, SMB_VFS_LAYER_TRANSPARENT},