AgentD / squashfs-tools-ng

A new set of tools and libraries for working with SquashFS images
Other
194 stars 30 forks source link

gensquashfs(1) does not apply extended attributes when using `--pack-file` #122

Closed danfe closed 8 months ago

danfe commented 8 months ago

Looks like currently --xattr-file, -A only respected when squashing an entire directory, while it would be very handy if it also worked together with --pack-file because the latter allows to specify desired ownership and permissions. I'm attaching a quick'n'dirty patch for your consideration which could be probably improved.

AgentD commented 8 months ago

Hi @danfe ,

yes, the original pull request for the Xattr files only applies them when scanning a directory.

For the manifest/pack file, xattrs can currently only come from an selinux label file. I guess your patch is based on that code path?

In commit 084deb9, I massaged the changes from your patch into the same SELinux relabeling code, so that the attributes are applied in one shot and we can have both a label file and an Xattr file.

danfe commented 8 months ago

I guess your patch is based on that code path?

That's right. FWIW, I've applied that commit against version 1.2.0 and looks like it's working fine in my scenario, thank you for the quick (and better) fix! Guess we can close this issue now.