]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
HBSD: Ignore UFS shenanigans 1409/head
authorShawn Webb <shawn.webb@hardenedbsd.org>
Wed, 14 Oct 2020 16:51:49 +0000 (12:51 -0400)
committerShawn Webb <shawn.webb@hardenedbsd.org>
Wed, 14 Oct 2020 16:51:49 +0000 (12:51 -0400)
UFS stores NFSv4 ACLs in the system extended attribute namespace. Per
libarchive maintainer, ignore those attributes.

Signed-off-by: Shawn Webb <shawn.webb@hardenedbsd.org>

libarchive/archive_read_disk_entry_from_file.c
libarchive/archive_write_disk_posix.c

index 7395ee725feba2b30b0da96e900d0af212353a79..9c9cf38ee9f17e5f5b11e54b559da5e32fec1803 100644 (file)
@@ -765,11 +765,15 @@ setup_xattrs_namespace(struct archive_read_disk *a,
                size_t len = 255 & (int)*p;
                char *name;
 
-               switch (namespace) {
-               case EXTATTR_NAMESPACE_SYSTEM:
+               if (namespace == EXTATTR_NAMESPACE_SYSTEM) {
+                       if (!strcmp(p + 1, "nfs4.acl") ||
+                           !strcmp(p + 1, "posix1e.acl_access") ||
+                           !strcmp(p + 1, "posix1e.acl_default")) {
+                               p += 1 + len;
+                               continue;
+                       }
                        strcpy(buff, "system.");
-                       break;
-               default:
+               } else {
                        strcpy(buff, "user.");
                }
                name = buff + strlen(buff);
index e522492fbd6083067fec5c453d0344a5e0918886..7e32fca92918d4f680c272f8adbf457a09e953b3 100644 (file)
@@ -4432,6 +4432,10 @@ set_xattrs(struct archive_write_disk *a)
                        } else if (strncmp(name, "system.", 7) == 0) {
                                name += 7;
                                namespace = EXTATTR_NAMESPACE_SYSTEM;
+                               if (!strcmp(name, "nfs4.acl") ||
+                                   !strcmp(name, "posix1e.acl_access") ||
+                                   !strcmp(name, "posix1e.acl_default"))
+                                       continue;
                        } else {
                                /* Other namespaces are unsupported */
                                archive_strcat(&errlist, name);