public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Johannes Schauer Marin Rodrigues <josch@mister-muffin.de>
To: linux-ext4@vger.kernel.org
Subject: misc/create_inode_libarchive.c: also allow gnu.translator xattrs
Date: Fri, 11 Oct 2024 10:10:44 +0200	[thread overview]
Message-ID: <172863424488.2407118.13900202892540655392@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 1276 bytes --]

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:


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

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

[-- Attachment #2: signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEElFhU6KL81LF4wVq58sulx4+9g+EFAmcI3YQACgkQ8sulx4+9
g+Eq+w//XJveIfv4nYHMrwchOuvJW2g1OlEMCvb1jdTIY48uXTrLCyikC6bri/WM
P64tXoiWzTHbFXOrDHXRBQBoa+XiGuWKaKtxr5cDJOL40rECY/eHbuTd+kgFy0jM
DlJFTcpH3suyBXqxugZAuTEkwiZYBad7gI44ofidpK4q68Xe71mAgnNt+ijGMPD2
edeOeByQJEF9iZ/KKf6lc2nFNxwLxcjekLkW7tkdRhTlbUVd4nEuhqJWkOjsdRlw
n2pXAaEICrBWIco9U7ixC0hnfeiow80QdTyNFvdH+N/AbdMiOzuf42GyS3YdquXn
eoVw7mupaWknUC8xcou8EwcNoDrn4WfOeDOaZOQccsersXZz9E+VW3DEa+X4XHad
SHmqlDuSatT5Zb7xpwOLJ5zcZ06yEaJcFKsnM20Ek2kuIRv8Us7uXazocYPx6Bn6
vStENKOvOOpQU+xA0Xf+K9WWdDoXAi4s38GCb5YyQEX5Q6GCACx/vZajCslQbSmO
BgP2yDhrxsDdBLvCL6Pv0t0pvzSsnNYe3uHWtI/KjWSxVuuarF1KpiRgd3YKRtMc
TaIxRYXw+SwgRBQdi0dO9BMsmU7oo32XBavutWqSvG6cmnDeDNfc31O6IfyFxISl
7bkRd9p4h1on9nBuHnopru64aH4Au1LNMIyuKjSp0RaoMYTMK2o=
=5QTa
-----END PGP SIGNATURE-----

                 reply	other threads:[~2024-10-11  8:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=172863424488.2407118.13900202892540655392@localhost \
    --to=josch@mister-muffin.de \
    --cc=linux-ext4@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox