diff mbox series

misc/create_inode_libarchive.c: also allow gnu.translator xattrs

Message ID 172863424488.2407118.13900202892540655392@localhost
State New
Headers show
Series misc/create_inode_libarchive.c: also allow gnu.translator xattrs | expand

Commit Message

Johannes Schauer Marin Rodrigues Oct. 11, 2024, 8:10 a.m. UTC
Hello ext4 folks,

in my recent patch to allow e2fsprogs to create filesystems from tarballs via
libarchive I restricted the allowed xattrs to "security.capability". My
intention was probably to not allow any random xattr from the tarball onto the
filesystem.

This now creates a problem as GNU Hurd started using xattrs to store Hurd
translators in the "gnu.translator" extended attribute. With the following
patch I'm able to create a bootable GNU Hurd filesystem from a tarball:



Would that change be a good idea? I also submitted my patch as a pull request
to Ted's github repo here: https://github.com/tytso/e2fsprogs/pull/194

Or would it be a better idea to drop the sanity check for extended attribute
names? What do you think?

Thanks!

cheers, josch
diff mbox series

Patch

--- a/misc/create_inode_libarchive.c
+++ b/misc/create_inode_libarchive.c
@@ -442,7 +442,7 @@  static errcode_t set_inode_xattr_tar(ext
 	dl_archive_entry_xattr_reset(entry);
 	while (dl_archive_entry_xattr_next(entry, &name, &value, &value_size) ==
 	       ARCHIVE_OK) {
-		if (strcmp(name, "security.capability") != 0)
+		if (strcmp(name, "security.capability") != 0 && strcmp(name, "gnu.translator"))
 			continue;
 
 		retval = ext2fs_xattr_set(handle, name, value, value_size);