X-Git-Url: https://mattmccutchen.net/rsync/rsync-patches.git/blobdiff_plain/148e46463ad7d7f01d8fa915a1c545e3cff0c18c..82c2230a445b352ac67f3ed13bf7fa88b0bbac70:/adaptec_acl_mods.diff diff --git a/adaptec_acl_mods.diff b/adaptec_acl_mods.diff index 0ae772c..60b76f5 100644 --- a/adaptec_acl_mods.diff +++ b/adaptec_acl_mods.diff @@ -1,8 +1,7 @@ -Depends-On-Patch: acls.diff - -After applying the above patch and this one, run these commands for a -successful build: +To use this patch, run these commands for a successful build: + patch -p1 user_obj & 7) << 6) -- + (((racl->mask != ACL_NO_ENTRY ? racl->mask : racl->group_obj) & 7) << 3) -- + (racl->other & 7); -+ /* Note that (ACL_NO_ENTRY & 077) is 0. */ -+ return ((racl->user_obj & 077) << 6) -+ + (((racl->mask != ACL_NO_ENTRY ? racl->mask : racl->group_obj) & 077) << 3) -+ + (racl->other & 077); - } - - static void rsync_acl_strip_perms(rsync_acl *racl) -@@ -178,6 +178,9 @@ static BOOL unpack_smb_acl(rsync_acl *ra +@@ -307,6 +307,9 @@ static BOOL unpack_smb_acl(SMB_ACL_T sac } access = (sys_acl_get_perm(permset, SMB_ACL_READ) ? 4 : 0) | (sys_acl_get_perm(permset, SMB_ACL_WRITE) ? 2 : 0) @@ -54,9 +38,9 @@ entry. + | (sys_acl_get_perm(permset, SMB_ACL_CHMOD) ? 16 : 0) + | (sys_acl_get_perm(permset, SMB_ACL_CHOWN) ? 32 : 0) | (sys_acl_get_perm(permset, SMB_ACL_EXECUTE) ? 1 : 0); - /* continue == done with entry; break == store in given idal */ + /* continue == done with entry; break == store in temporary ida list */ switch (tag_type) { -@@ -587,6 +590,12 @@ static int store_access_in_entry(uchar a +@@ -401,6 +404,12 @@ static int store_access_in_entry(uchar a COE( sys_acl_get_permset,(entry, &permset) ); COE( sys_acl_clear_perms,(permset) ); @@ -69,51 +53,69 @@ entry. if (access & 4) COE( sys_acl_add_perm,(permset, SMB_ACL_READ) ); if (access & 2) -@@ -619,7 +628,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ +@@ -434,7 +443,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_USER_OBJ) ); - COE2( store_access_in_entry,(racl->user_obj & 7, entry) ); + COE2( store_access_in_entry,(racl->user_obj & 077, entry) ); - for (ida = racl->users.idas, count = racl->users.count; - count--; ida++) { -@@ -631,7 +640,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + for (ida = racl->users.idas, count = racl->users.count; count--; ida++) { + COE( sys_acl_create_entry,(smb_acl, &entry) ); +@@ -445,7 +454,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_GROUP_OBJ) ); - COE2( store_access_in_entry,(racl->group_obj & 7, entry) ); + COE2( store_access_in_entry,(racl->group_obj & 077, entry) ); - for (ida = racl->groups.idas, count = racl->groups.count; - count--; ida++) { -@@ -652,7 +661,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + for (ida = racl->groups.idas, count = racl->groups.count; count--; ida++) { + COE( sys_acl_create_entry,(smb_acl, &entry) ); +@@ -455,7 +464,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ + } + + #ifdef ACLS_NEED_MASK +- mask_bits = racl->mask_obj == NO_ENTRY ? racl->group_obj & 7 : racl->mask_obj; ++ mask_bits = racl->mask_obj == NO_ENTRY ? racl->group_obj & 077 : racl->mask_obj; + COE( sys_acl_create_entry,(smb_acl, &entry) ); + COE( sys_acl_set_tag_type,(entry, SMB_ACL_MASK) ); + COE2( store_access_in_entry,(mask_bits, entry) ); +@@ -469,7 +478,7 @@ static BOOL pack_smb_acl(SMB_ACL_T *smb_ COE( sys_acl_create_entry,(smb_acl, &entry) ); COE( sys_acl_set_tag_type,(entry, SMB_ACL_OTHER) ); -- COE2( store_access_in_entry,(racl->other & 7, entry) ); -+ COE2( store_access_in_entry,(racl->other & 077, entry) ); +- COE2( store_access_in_entry,(racl->other_obj & 7, entry) ); ++ COE2( store_access_in_entry,(racl->other_obj & 077, entry) ); #ifdef DEBUG if (sys_acl_valid(*smb_acl) < 0) -@@ -761,7 +770,7 @@ static void receive_rsync_acl(rsync_acl +@@ -766,7 +775,7 @@ static void old_recv_rsync_acl(rsync_acl while (count--) { char tag = read_byte(f); uchar access = read_byte(f); - if (access & ~ (4 | 2 | 1)) { + if (access & ~(32 | 16 | 8 | 4 | 2 | 1)) { - rprintf(FERROR, "receive_rsync_acl: bogus permset %o\n", + rprintf(FERROR, "old_recv_rsync_acl: bogus permset %o\n", access); exit_cleanup(RERR_STREAMIO); -@@ -834,7 +843,7 @@ static void receive_rsync_acl(rsync_acl - } else - #endif - if (racl->mask == ACL_NO_ENTRY) /* Always non-empty when needed. */ -- racl->mask = computed_mask_bits | (racl->group_obj & 7); -+ racl->mask = computed_mask_bits | (racl->group_obj & 077); +@@ -832,7 +841,7 @@ static void old_recv_rsync_acl(rsync_acl + racl->mask_obj = NO_ENTRY; + } + } else if (racl->mask_obj == NO_ENTRY) /* Must be non-empty with lists. */ +- racl->mask_obj = computed_mask_bits | (racl->group_obj & 7); ++ racl->mask_obj = computed_mask_bits | (racl->group_obj & 077); } - /* receive and build the rsync_acl_lists */ + /* Receive the ACL info the sender has included for this file-list entry. */ +@@ -904,7 +913,7 @@ static uchar recv_acl_access(uchar *name + *name_follows_val = 0; + } + +- if (access & ~(4 | 2 | 1)) { ++ if (access & ~(32 | 16 | 8 | 4 | 2 | 1)) { + rprintf(FERROR, "recv_acl_access: bogus permset %o\n", access); + exit_cleanup(RERR_STREAMIO); + } --- old/smb_acls.h +++ new/smb_acls.h @@ -33,6 +33,11 @@