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

Hard coded CLI flags break containers.podman.podman_unshare support for become_method #588

Open
Gaibhne opened this issue May 13, 2023 · 1 comment
Labels
needs_info More information about case is required

Comments

@Gaibhne
Copy link

Gaibhne commented May 13, 2023

Despite become_method being mentioned in the documentation and evaluated when set, containers.podman.podman_unshare is unable to function with any value for become_method other than sudo, due to forcibly injecting sudo-specific CLI parameters without respect for the become method select (so even if you use su, you will still get sudo parameters appended to the attempted call leading to an error.

The culprit is in

# -i is required, because
# podman unshare should be executed in a login shell to avoid chdir permission errors
cmdlist.append('-iu %s' % user)
where the CLI parameters are added despite checking the become method a line earlier; I would think they should be added conditionally (and ideally, become_flags should be respected at that point as well). I'm not sure why become_exe is documented and used at all, it seems sudo is the only possible value that can run without error.

The current code makes it completely impossible to use containers.podman.podman_unshare with a loginless account, the forced injection of -i even prevents you from manually appending -s because -i and -s are mutually exclusive.

@sshnaidm
Copy link
Member

@Gaibhne can you please attach task that illustrates this use case and the desired outcome?
Thanks

@sshnaidm sshnaidm added the needs_info More information about case is required label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs_info More information about case is required
Projects
None yet
Development

No branches or pull requests

2 participants