GNU bug report logs -
#6323
Enhancement request: Add wronly to Coreutils
Previous Next
Full log
Message #14 received at 6323 <at> debbugs.gnu.org (full text, mbox):
Daniel Trebbien wrote:
> `sudo` with the `-S` option causes it to write the password prompt (if
> it requires a password at that time) to standard error and read the
> password from standard in. The problem is: how do I know if `sudo`
> requires a password? I need to try to read the password prompt from
> standard error, but if the password is not required, then the parent
> process will wait for data on standard error while the child process
> (`wronly` by this time) waits for data on standard in.
There is always the sudo -k option. If the user isn't configured with
NOPASSWD then sudo -k ignores the timestamp file and will always ask
for a password. That would make it more consistent.
Newish sudo commands include a -A option along with a SUDO_ASKPASS
variable. It will invoke a helper program to read the password. I
would probably go that route myself.
Bob
This bug report was last modified 15 years and 78 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.