Skip to content

tmpfiles: Tolerate EACCES when resolving declared paths - #2382

Open
gursewak1997 wants to merge 1 commit into
bootc-dev:mainfrom
gursewak1997:bootc2379
Open

tmpfiles: Tolerate EACCES when resolving declared paths#2382
gursewak1997 wants to merge 1 commit into
bootc-dev:mainfrom
gursewak1997:bootc2379

Conversation

@gursewak1997

@gursewak1997 gursewak1997 commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Summary

The path canonicalization added in cfec5cc opens the parent directory of every declared tmpfiles.d path to get its (dev, ino) identity. Entries like selinux-policy's w /sys/fs/selinux/checkreqprot point at virtual filesystem paths that return EACCES in rootless containers. Treat these the same as a missing parent — return None — since the /var walker cannot encounter inaccessible paths either.

Fixes: #2379

Test plan

  • Unit test test_resolve_parent_identity_permission_denied creates a mode-0o000 directory and verifies EACCES returns Ok(None) instead of a fatal error
  • Verified patched binary passes bootc container lint in a rootless quay.io/centos-bootc/centos-bootc:c10s container (which ships the triggering selinux-policy.conf entry)

Assisted-by: AI

Comment thread crates/tmpfiles/src/path_resolution.rs Outdated
Comment on lines +116 to +117
// Tolerate inaccessible paths (EACCES in rootless containers,
// ENOSYS under QEMU emulation).

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ENOSYS is a totally different thing, I don't think we should conflate with EPERM.

In the qemu/ENOSYS case the functionality won't work at all for any file. I think it'd be cleaner for that case to do a "does it work" probe and have a clear warning if it doesn't.

It's just a different bug.

The path canonicalization added in cfec5cc opens the parent directory
of every declared tmpfiles.d path to get its (dev, ino) identity.
Entries like selinux-policy's `w /sys/fs/selinux/checkreqprot` point
at virtual filesystem paths that return EACCES in rootless containers.
Treat these the same as a missing parent — return None — since the
/var walker cannot encounter inaccessible paths either.

Fixes: bootc-dev#2379

Assisted-by: AI
Signed-off-by: gursewak1997 <gursmangat@gmail.com>
@gursewak1997 gursewak1997 changed the title tmpfiles: Tolerate EACCES/ENOSYS when resolving declared paths tmpfiles: Tolerate EACCES when resolving declared paths Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bootc container lint fails with EACCES on /sys/fs/selinux/checkreqprot under rootless podman — regression in 1.16.7 (var-tmpfiles)

2 participants