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

[Discussion] Behavior of SUDO_ASKPASS #1696

Open
askoa opened this issue Feb 22, 2025 · 0 comments
Open

[Discussion] Behavior of SUDO_ASKPASS #1696

askoa opened this issue Feb 22, 2025 · 0 comments
Labels
question Further information is requested

Comments

@askoa
Copy link

askoa commented Feb 22, 2025

Is your feature request related to a problem? Please describe.
I created a libvirt container based on doc. I noticed the desktop entry had SUDO_ASKPASS pointing to a generated script.

Exec=env SUDO_ASKPASS="/var/home/user/.local/bin/distrobox_sudo_askpass" DBX_SUDO_PROGRAM="sudo --askpass" /var/home/user/.local/bin/distrobox-enter --root -n libvirt -- /usr/bin/virt-manager

I noticed one of the useful tips mentioned that we can override the behavior by setting SUDO_ASKPASS environment variable. But it was not clear if the behavior is for distrobox-enter or distrobox-create command.

It turns out the distrobox-assemble and consequently distrobox-export command does not respect the SUDO_ASKPASS environment variable. So even if we set the SUDO_ASKPASS environment variable before running distrobox-create command the desktop entry still points to the generated script.

distrobox/distrobox-export

Lines 284 to 287 in 3b9f0e8

if [ -n "${rootful}" ]; then
container_command_prefix="env SUDO_ASKPASS=\"${sudo_askpass_path}\" DBX_SUDO_PROGRAM=\"sudo --askpass\" ${container_command_prefix}"
fi

Describe the solution you'd like
It would be nice for distrobox-export to respect the SUDO_ASKPASS environment variable.

Describe alternatives you've considered
The workaround is to manually edit the SUDO_ASKPASS in the desktop entry created.

@askoa askoa added the question Further information is requested label Feb 22, 2025
@askoa askoa changed the title [Discussion] [Discussion] Behavior of SUDO_ASKPASS Feb 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant