The patches for 3.0.9.
[rsync-patches.git] / adaptec_acl_mods.diff
index 45c1e7f3d0fb3d9f23774e112012b5e0050c2eb7..eb86f2e921f74d61bc7523affe635f0a091e7a4d 100644 (file)
@@ -10,7 +10,7 @@ Philip Lowman wrote:
 > chmod, and chown bits which Adaptec has added to XFS on their SnapOS NAS
 > units.  This is nice for backing up files between different NAS units
 > and preserving all of the Samba ACLs.
-> 
+>
 > I'm not sure how useful this patch will be because I'm not sure if any
 > other NAS vendors have standardized on their extensions to POSIX ACLs to
 > support Samba in the same manner that Adaptec has.  FWIW, though, this
@@ -24,8 +24,10 @@ Todo:
 Fix a bug that could lose some bits when stripping some (supposedly)
 superfluous ACL info.
 
---- old/lib/sysacls.c
-+++ new/lib/sysacls.c
+based-on: 40afd365cc8ca968fd16e161d24df5b8a8a520cc
+diff --git a/lib/sysacls.c b/lib/sysacls.c
+--- a/lib/sysacls.c
++++ b/lib/sysacls.c
 @@ -31,6 +31,18 @@
  #endif
  #define DEBUG(x,y)
@@ -45,17 +47,17 @@ superfluous ACL info.
  void SAFE_FREE(void *mem)
  {
        if (mem)
-@@ -115,6 +127,9 @@ int sys_acl_get_access_bits(SMB_ACL_ENTR
-       if ((rc = acl_get_permset(entry_d, &permset)) != 0)
-               return rc;
-       *bits = (acl_get_perm(permset, ACL_READ) ? 4 : 0)
-+            | (acl_get_perm(permset, ACL_CHOWN) ? 32 : 0)
-+            | (acl_get_perm(permset, ACL_CHMOD) ? 16 : 0)
-+            | (acl_get_perm(permset, ACL_DELETE) ? 8 : 0)
-             | (acl_get_perm(permset, ACL_WRITE) ? 2 : 0)
-             | (acl_get_perm(permset, ACL_EXECUTE) ? 1 : 0);
-       return 0;
-@@ -147,6 +162,12 @@ int sys_acl_set_access_bits(SMB_ACL_ENTR
+@@ -100,6 +112,9 @@ int sys_acl_get_info(SMB_ACL_ENTRY_T entry, SMB_ACL_TAG_T *tag_type_p, uint32 *b
+               return -1;
+       *bits_p = (acl_get_perm(permset, ACL_READ) ? 4 : 0)
++              | (acl_get_perm(permset, ACL_CHOWN) ? 32 : 0)
++              | (acl_get_perm(permset, ACL_CHMOD) ? 16 : 0)
++              | (acl_get_perm(permset, ACL_DELETE) ? 8 : 0)
+               | (acl_get_perm(permset, ACL_WRITE) ? 2 : 0)
+               | (acl_get_perm(permset, ACL_EXECUTE) ? 1 : 0);
+@@ -144,6 +159,12 @@ int sys_acl_set_access_bits(SMB_ACL_ENTRY_T entry, uint32 bits)
        if ((rc = acl_get_permset(entry, &permset)) != 0)
                return rc;
        acl_clear_perms(permset);
@@ -68,9 +70,10 @@ superfluous ACL info.
        if (bits & 4)
                acl_add_perm(permset, ACL_READ);
        if (bits & 2)
---- old/lib/sysacls.h
-+++ new/lib/sysacls.h
-@@ -60,8 +60,8 @@
+diff --git a/lib/sysacls.h b/lib/sysacls.h
+--- a/lib/sysacls.h
++++ b/lib/sysacls.h
+@@ -59,8 +59,8 @@
  #define SMB_ACL_TYPE_ACCESS   ACL_TYPE_ACCESS
  #define SMB_ACL_TYPE_DEFAULT  ACL_TYPE_DEFAULT