Subject: bug#17839: 24.4.50; read-passwd echoes password input in non-interactive sessions

From: Stefan Monnier <[email-masked]>
Date: Thu, 10 Jul 2014 12:43:46 -0400

> Well, I've tried this 'cos I believe it is important.  The idea is to
> give the prompt in read-passwd the text property 'hide-chars.  In
> noninteractive mode, emacs writes "." instead of echoing the password
> while typing. You can test it with

I think a more idiomatic way to do that would be to use a global Lisp
var that's let-bound in read-passwd.

> +      else if (hide_chars && (c == 127)) /* DEL */
> +	{
> +	  /* Unfortunately, we cannot edit stdout.  */
> +	  // fprintf (stdout, "%c", c);
> +	  /* Hmm, this doesn't work for multi-byte characters.  */
> +	  (len > 0) && len--;
> +	}

I don't think that's worth the trouble.

        Stefan