unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: schwab@suse.de, 17839@debbugs.gnu.org, swiesner@lunaryorn.com
Subject: bug#17839: 24.4.50; read-passwd echoes password input in non-interactive sessions
Date: Fri, 11 Jul 2014 18:46:16 +0300	[thread overview]
Message-ID: <83sim7aofr.fsf@gnu.org> (raw)
In-Reply-To: <87a98g54ez.fsf@gmx.de>

> From: Michael Albinus <michael.albinus@gmx.de>
> Cc: monnier@iro.umontreal.ca,  schwab@suse.de,  17839@debbugs.gnu.org,  swiesner@lunaryorn.com
> Date: Fri, 11 Jul 2014 16:57:40 +0200
> 
> Eli Zaretskii <eliz@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.





  reply	other threads:[~2014-07-11 15:46 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-23 13:51 bug#17839: 24.4.50; read-passwd echoes password input in non-interactive sessions Sebastian Wiesner
2014-06-23 15:46 ` Andreas Schwab
2014-06-23 16:52   ` Sebastian Wiesner
2014-06-24 18:41     ` Glenn Morris
2014-06-24 22:55       ` Sebastian Wiesner
2014-06-25  7:47         ` Andreas Schwab
2014-06-25  8:01           ` Michael Albinus
2014-06-25  8:15             ` Andreas Schwab
2014-06-25  9:20               ` Michael Albinus
2014-06-25  9:26                 ` Andreas Schwab
2014-06-25 10:03                   ` Michael Albinus
2014-06-25  9:52           ` Sebastian Wiesner
2014-06-25 14:32           ` Stefan Monnier
2014-06-26 19:01             ` Glenn Morris
2014-07-10 14:36             ` Michael Albinus
2014-07-10 16:43               ` Stefan Monnier
2014-07-11  9:15                 ` Michael Albinus
2014-07-11  9:41                   ` Michael Albinus
2014-07-11  9:45                   ` Eli Zaretskii
2014-07-11  9:58                     ` Michael Albinus
2014-07-11 10:13                       ` Eli Zaretskii
2014-07-11 11:32                         ` Michael Albinus
2014-07-11 12:43                         ` Michael Albinus
2014-07-11 14:02                           ` Eli Zaretskii
2014-07-11 14:57                             ` Michael Albinus
2014-07-11 15:46                               ` Eli Zaretskii [this message]
2014-08-05 20:25                                 ` Sebastian Wiesner
2014-08-06 17:39                                   ` Stefan Monnier
2014-08-07 11:12                                     ` Sebastian Wiesner
2014-08-07 13:01                                       ` Stefan Monnier
2014-08-07 13:12                                         ` Sebastian Wiesner
2014-08-07 15:30                                           ` Eli Zaretskii
2014-08-07 16:08                                             ` Sebastian Wiesner
2014-08-07 16:38                                               ` Eli Zaretskii
2014-07-11 10:03                     ` Eli Zaretskii
2014-07-11 10:15                       ` Michael Albinus
2014-07-10 21:46               ` Sebastian Wiesner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83sim7aofr.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=17839@debbugs.gnu.org \
    --cc=michael.albinus@gmx.de \
    --cc=schwab@suse.de \
    --cc=swiesner@lunaryorn.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).