From 7875e6fe63805a3412cb4a8673a2dbf233631110 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Thu, 9 Apr 2009 22:49:24 -0700 Subject: [PATCH] Don't try to simplify an ACL that has a mask w/o any named values. --- NEWS | 2 ++ acls.c | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/NEWS b/NEWS index 61bfbf10..1e80e042 100644 --- a/NEWS +++ b/NEWS @@ -32,6 +32,8 @@ Changes since 3.0.5: receiving side when a mount-point directory did not match a directory in the transfer. + - Fixed the dropping of an ACL mask when no named ACL values were present. + - Fixed the use of --dry-run with --read-batch. - Fixed configure's erroneous use of target. diff --git a/acls.c b/acls.c index f9c0ee8e..434bc61d 100644 --- a/acls.c +++ b/acls.c @@ -137,7 +137,8 @@ static void rsync_acl_strip_perms(rsync_acl *racl) else { if (racl->group_obj == racl->mask_obj) racl->group_obj = NO_ENTRY; - racl->mask_obj = NO_ENTRY; + if (racl->names.count != 0) + racl->mask_obj = NO_ENTRY; } racl->other_obj = NO_ENTRY; } @@ -749,14 +750,7 @@ static int recv_rsync_acl(item_list *racl_list, SMB_ACL_TYPE_T type, int f) /* If we received a superfluous mask, throw it away. */ duo_item->racl.mask_obj = NO_ENTRY; #else - if (!duo_item->racl.names.count) { - /* If we received a superfluous mask, throw it away. */ - if (duo_item->racl.mask_obj != NO_ENTRY) { - /* Mask off the group perms with it first. */ - duo_item->racl.group_obj &= duo_item->racl.mask_obj | NO_ENTRY; - duo_item->racl.mask_obj = NO_ENTRY; - } - } else if (duo_item->racl.mask_obj == NO_ENTRY) /* Must be non-empty with lists. */ + if (duo_item->racl.names.count && duo_item->racl.mask_obj == NO_ENTRY) /* Must be non-empty with lists. */ duo_item->racl.mask_obj = (computed_mask_bits | duo_item->racl.group_obj) & ~NO_ENTRY; #endif -- 2.34.1