public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* misc/create_inode_libarchive.c: also allow gnu.translator xattrs
@ 2024-10-11  8:10 Johannes Schauer Marin Rodrigues
  0 siblings, 0 replies; only message in thread
From: Johannes Schauer Marin Rodrigues @ 2024-10-11  8:10 UTC (permalink / raw)
  To: linux-ext4

[-- 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-----

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-10-11  8:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-11  8:10 misc/create_inode_libarchive.c: also allow gnu.translator xattrs Johannes Schauer Marin Rodrigues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox