Hi,

Thanks for this fix. Systemd-ask-password now works!

On Wed, Dec 9, 2015 at 3:03 PM, Gert Doering <g...@greenie.muc.de> wrote:

> +  if ( !isatty(0) && !isatty(2) )
> +    {
> +      int fd = open( "/dev/tty", O_RDWR );
> +      if ( fd < 0 )
>

This doesn't allow for reading passwords from pipes -- not relevant if
getpass doesn't fall back to a non-tty stdin if /dev/tty open fails -- does
it? Not saying pipes should be supported --- whatever is consistent with
getpass should be fine.


> +       { msg(M_FATAL, "neither stdin nor stderr are a tty device and you
> have neither a controlling tty nor systemd - can't ask for '%s'.  If you
> used --daemon, you need to use --askpass to make passphrase-protected keys
> work, and you can not use --auth-nocache.", prompt ); }
> +      close(fd);
>

The error message is still incomplete/confusing when the triggered by
auth-user-pass
without a filename (i.e stdin), and not by a passphrase-protected key. In
the former case a reference to the need for management-query or a
username-password
file is helpful.

Other than that, the patch does the right thing, and works well. Tested
using git- master with and without systemd. ACK from me.

Selva

Reply via email to