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

chrootarchive: propagate env from parent #1327

Merged
merged 2 commits into from
Sep 9, 2022

Conversation

giuseppe
Copy link
Member

@giuseppe giuseppe commented Sep 8, 2022

propagate the environment variables from the current process since they are needed by pkg/unshare to read the UID for the user that created the user namespace (through the _CONTAINERS_ROOTLESS_UID env variable).

Signed-off-by: Giuseppe Scrivano [email protected]

@nalind
Copy link
Member

nalind commented Sep 8, 2022

This currently changes two of the places where we call userns.RunningInUserNS() without touching several others. What's the rationale?

@giuseppe giuseppe force-pushed the fix-apply-layer-in-userns branch from af94af0 to 431ee8c Compare September 8, 2022 21:05
@giuseppe
Copy link
Member Author

giuseppe commented Sep 8, 2022

This currently changes two of the places where we call userns.RunningInUserNS() without touching several others. What's the rationale?

I've touched only the file that I was working on as part of the fix. I agree it makes no sense to change only that, so I've adapted other files as well and pushed a new version

@giuseppe giuseppe force-pushed the fix-apply-layer-in-userns branch from 431ee8c to 96ea882 Compare September 8, 2022 21:06
use the function in containers/storage that has the same
functionalities.

Signed-off-by: Giuseppe Scrivano <[email protected]>
propagate the environment variables from the current process since
they are needed by pkg/unshare to read the UID for the user that
created the user namespace (through the _CONTAINERS_ROOTLESS_UID env
variable).

Signed-off-by: Giuseppe Scrivano <[email protected]>
@giuseppe giuseppe force-pushed the fix-apply-layer-in-userns branch from 96ea882 to 9ecda58 Compare September 8, 2022 21:07
@rhatdan
Copy link
Member

rhatdan commented Sep 8, 2022

LGTM

@Luap99
Copy link
Member

Luap99 commented Sep 9, 2022

I applied this fix in containers/podman#15695 and it seems to work (at least the compose and API tests which failed previously are now green).

Copy link
Collaborator

@flouthoc flouthoc left a comment

Choose a reason for hiding this comment

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

LGTM

@rhatdan rhatdan merged commit b321881 into containers:main Sep 9, 2022
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.

5 participants