hpc / charliecloud

Now hosted on GitLab.
https://gitlab.com/charliecloud/main
Apache License 2.0
312 stars 60 forks source link

don’t follow symlinks when setting xattrs #1782

Closed reidpr closed 12 months ago

reidpr commented 1 year ago

The call to os.setxattr erroneously passed our follow_symlinks to flags, not follow_symlinks. Therefore, we always followed symlinks, and set os.XATTR_CREATE if our follow_symlinks was True. This caused failures with image fedora:35 on a Fedora 38 host, which has xattrs on image /etc/mtab, which is a symlink to ../proc/self/mounts, which is broken until containerized (see #1774).

We only ever call Path.setxattr() with follow_symlinks=False, so this PR removes the keyword argument and unconditionally does not follow symlinks.

reidpr commented 1 year ago

@kb1vc, you could try this branch. It should fix your xattrs failure.

kb1vc commented 1 year ago

Reid,

Thank you. —no-xattrs did it.

Now I’m peeling another layer of the onion that is not charliecloud’s fault. (This is all in an effort to build openEMS with its visualization tools in a charliecloud image/container. The task is difficult even on a host system.)

And I’ll try the new branch in a day or so.

Thank you.

matt

On Nov 28, 2023, at 1:42 PM, Reid Priedhorsky @.***> wrote:

@kb1vc https://github.com/kb1vc, you could try this branch. It should fix your xattrs failure.

— Reply to this email directly, view it on GitHub https://github.com/hpc/charliecloud/pull/1782#issuecomment-1830468705, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADL4HCQDPUTSXTHBEIK33S3YGYWADAVCNFSM6AAAAAA76HBKXGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMZQGQ3DQNZQGU. You are receiving this because you were mentioned.

kb1vc commented 12 months ago

That worked! Thank you.

Tested on Fedora 38 building from a Fedora 35 image

reidpr commented 12 months ago

@kb1vc, feel free to wander over to the Discussions if you have any usage questions that you think we might be able to help with, even if not directly Charliecloud’s fault.