From c61966d0956c264d439cb53cbb65c4f552702f0d Mon Sep 17 00:00:00 2001 From: Martin Matuska Date: Tue, 13 Dec 2016 13:35:27 +0100 Subject: [PATCH] Don't check for duplicates when adding NFSv4 ACL entries --- libarchive/archive_acl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/libarchive/archive_acl.c b/libarchive/archive_acl.c index ff5c90492..3653d6fc7 100644 --- a/libarchive/archive_acl.c +++ b/libarchive/archive_acl.c @@ -280,11 +280,17 @@ acl_new_entry(struct archive_acl *acl, acl->acl_text = NULL; } - /* If there's a matching entry already in the list, overwrite it. */ + /* + * If there's a matching entry already in the list, overwrite it. + * NFSv4 entries may be repeated and are not overwritten. + * + * TODO: compare names of no id is provided (needs more rework) + */ ap = acl->acl_head; aq = NULL; while (ap != NULL) { - if (ap->type == type && ap->tag == tag && ap->id == id) { + if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) && + ap->type == type && ap->tag == tag && ap->id == id) { if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER && tag != ARCHIVE_ENTRY_ACL_GROUP)) { ap->permset = permset; -- 2.47.2