Comment 8 for bug 716595

Revision history for this message
Martin Pitt (pitti) wrote : Re: gksu ask for password each time with stdout redirection

The root cause of this is sudo itself, after all. It seems to check if any of stdin/out/err is a real PTY and grab the ticket if available. But if all of stdin/out/err are redirected, it doesn't respect the sudo tickets any more either:

  cat | /usr/bin/sudo whoami 2>&1 |cat

always asks for a password. libgksu needs to provides stdin for the password, and redirect stderr for checking if the password was correct. If you now additionally redirect stdout as well, there is no fd left to check the PTY with.

There seems to be another mode with "forkpty()", I'll check this.