GNU bug report logs - #17839
24.4.50; read-passwd echoes password input in non-interactive sessions

Previous Next

Package: emacs;

Reported by: Sebastian Wiesner <swiesner <at> lunaryorn.com>

Date: Mon, 23 Jun 2014 15:37:02 UTC

Severity: normal

Found in version 24.4.50

Fixed in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #91 received at 17839 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Michael Albinus <michael.albinus <at> gmx.de>
Cc: schwab <at> suse.de, 17839 <at> debbugs.gnu.org, monnier <at> iro.umontreal.ca,
 swiesner <at> lunaryorn.com
Subject: Re: bug#17839: 24.4.50;
 read-passwd echoes password input in non-interactive sessions
Date: Fri, 11 Jul 2014 18:46:16 +0300
> From: Michael Albinus <michael.albinus <at> gmx.de>
> Cc: monnier <at> iro.umontreal.ca,  schwab <at> suse.de,  17839 <at> debbugs.gnu.org,  swiesner <at> lunaryorn.com
> Date: Fri, 11 Jul 2014 16:57:40 +0200
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> > The result is not 100% satisfactory, as one needs to press RET twice
> > to finish the input, and it looks like some garbage is left in the
> > input buffer, since the following (normal) input gets something
> > strange.  A workaround is to press C-z, which produces EOF, instead of
> > RET, when password entry is finished.
> 
> Maybe because just "\n" is sent by fprintf()? In the Windows case,
> "\r\n" might be the better choice?

I don't think so.  The problem is not what is printed, the problem is
that the loop is not exited on the 1st RET, and in fact it looks like
nothing is returned by getchar until you press the 2nd RET.

> And maybe we must handle the case, that RET sends 2 characters, which
> must be handled by a double call of getchar()?

It doesn't look like it sends 2 characters: the next call to getchar
after exiting the loop waits for more input.

> When I've read the code of read_minibuf_noninteractive for the first
> time, I've seen that just CR was used for finishing input

You mean, just the newline, right?

> and I've thought that nobody ever used this for MS Windows.

That code worked perfectly well with cooked input mode, since then RET
is converted to a newline by the stdio machinery (as it uses text
mode).

And that just gave me an idea: switch stdin to binary when not echoing
input.  Which solved the problem of double RET (and now it's clear why
it was being eaten up).

Thanks.




This bug report was last modified 10 years and 295 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.