Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Check for *host* non-root uid when setting unsquashfs flags #267

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

dtrudg
Copy link
Member

@dtrudg dtrudg commented Aug 19, 2021

Description of the Pull Request (PR):

We were previously setting --user-xattrs / --no-xattrs based on
the current euid when calling unsquashfs. However, in a non-setuid
install --fakeroot build the euid is 0, so the flags will not be
set. On distributions other than EL / Fedora (i.e. Debian / Ubuntu
which are not selinux native), this can cause failed extraction.

Decide if we are performing a rootless extraction based on the host
uid, outside of any namespace that is in play.

This fixes or addresses the following GitHub issues:

See also apptainer/singularity#6113

Before submitting a PR, make sure you have done the following:

@dtrudg dtrudg added the bug Something isn't working label Aug 19, 2021
@dtrudg dtrudg added this to the SingularityCE 3.9.0 milestone Aug 19, 2021
@dtrudg dtrudg self-assigned this Aug 19, 2021
We were previously setting `--user-xattrs` / `--no-xattrs` based on
the current euid when calling `unsquashfs`. However, in a non-setuid
install `--fakeroot` build the euid is 0, so the flags will not be
set. On distributions other than EL / Fedora (i.e. Debian / Ubuntu
which are not selinux native), this can cause failed extraction.

Decide if we are performing a rootless extraction based on the host
uid, outside of any namespace that is in play.

Fixes: sylabs#266
@dtrudg dtrudg added the ci:e2e label Aug 19, 2021
@dtrudg dtrudg marked this pull request as ready for review August 19, 2021 14:16
@dtrudg dtrudg mentioned this pull request Aug 19, 2021
Copy link
Contributor

@EmmEff EmmEff left a comment

Choose a reason for hiding this comment

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

LGTM

@dtrudg dtrudg merged commit 13e5621 into sylabs:master Aug 19, 2021
@dtrudg dtrudg deleted the issue266 branch August 19, 2021 14:34
dtrudg added a commit that referenced this pull request Aug 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working ci:e2e
Projects
None yet
Development

Successfully merging this pull request may close these issues.

unsquashfs flag handling incorrect for --fakeroot mode
2 participants