tytso / e2fsprogs

Ext2/3/4 file system utilities
http://ext4.wiki.kernel.org
383 stars 224 forks source link

mke2fs: support gnu.translator xattrs for tarball input #192

Open josch opened 3 months ago

josch commented 3 months ago

Hi,

I'm creating tarballs for GNU Hurd on Linux by making use of the recent change that uses the gnu.translator xattr to store Hurd translator information. For this to work I'm applying the following patch to e2fsprogs:

--- 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);

I'm unsure why I limited the allowed xattr to security.capability in the first place. Is that necessary?