]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Don't check for duplicates when adding NFSv4 ACL entries
authorMartin Matuska <martin@matuska.org>
Tue, 13 Dec 2016 12:35:27 +0000 (13:35 +0100)
committerMartin Matuska <martin@matuska.org>
Tue, 13 Dec 2016 12:38:20 +0000 (13:38 +0100)
libarchive/archive_acl.c

index ff5c90492b95ebd2a122c8c74da485591b2bcb9f..3653d6fc7b4a323a8d9247781f723b9c80e061de 100644 (file)
@@ -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;