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

add askpass named pipe support (GSUDO_ASKPASS_NAMED_PIPE) #388

Merged
merged 1 commit into from
Jan 20, 2025

Conversation

awakecoding
Copy link

We're integrating gsudo in Remote Desktop Manager, and one thing we're missing is a way to inject the password to launch the process as another user. One way we've done this in the past was to patch software to accept a named pipe name through an optional environment variable, and treat it as an "askpass" named pipe that just serves the password once. The named pipe is only used as a replacement for the current prompt if the GSUDO_ASKPASS_NAMED_PIPE environment variable has been set.

Alternatively, we could add a command-line parameter to pass the optional "askpass named pipe" name, but we're happy with just this environment variable, unless you wish to have it changed or done differently.

@gerardog
Copy link
Owner

Hi @awakecoding. Apologies for not responding earlier, I've been thru some personal things in the family so my priorities shifted a little bit.
I understand the approach, and the reason I haven't endeavor on this topic earlier is because it's quite hard to secure the communication of the password. In your scenario, the named pipes listener must validate it's gsudo connecting, before pushing the string.
Also, to be honest the build pipelines just broke by time passing, I will need to fix that in order to release. Are you interested in Nuget publishing?

@awakecoding
Copy link
Author

Hi Gerardo,

No problem for the delay, I understand

For the named pipe security, it is served only once, after which the temporary named pipe server is closed. It's ephemeral during the gsudo process launching, and it's not a named pipe which can be grabbed at any time in the background.

In any case, the named pipe technique fits our requirements, it doesn't leak credentials like environment variables or command-line arguments.

If there is no other concern other than fixing the CI, we would appreciate having a new release once it is merged. Initially, our RDM integration will just require that gsudo be preinstalled, so we're not going to use the nuget package, at least not not. Maybe we'll ship a copy from the nuget package later, but not now.

Thanks!

@gerardog gerardog merged commit ebea006 into gerardog:master Jan 20, 2025
2 of 3 checks passed
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.

None yet

2 participants