public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* getpass and /dev/tty
@ 2012-04-04  6:23 Denis Excoffier
  2012-04-04  8:58 ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Denis Excoffier @ 2012-04-04  6:23 UTC (permalink / raw)
  To: cygwin


Hello!

Would it be possible that getpass() first reads on /dev/tty before
defaulting to stdin?

% uname -a
CYGWIN_NT-5.1 edited 1.7.12(0.260/5/3) 2012-04-03 10:24 i686 Cygwin
% ls /dev/tt*
/dev/tty  /dev/ttyS0  /dev/ttyS2  /dev/ttyS3
% cat foo.c
#include <stdio.h>
#include <unistd.h>

int main () {
  fprintf (stderr, "Press <Return> to continue . . .\n");
  getpass ("");
  return 0;
};
% gcc -O -o ./foo foo.c
% ./foo
Press <Return> to continue . . .
[here you press Return]

% ./foo < /dev/null
Press <Return> to continue . . .

%

[for the second run of ./foo, you cannot press Return]



Regards,

Denis Excoffier.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: getpass and /dev/tty
  2012-04-04  6:23 getpass and /dev/tty Denis Excoffier
@ 2012-04-04  8:58 ` Corinna Vinschen
  2012-04-04 13:00   ` Corinna Vinschen
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2012-04-04  8:58 UTC (permalink / raw)
  To: cygwin

On Apr  4 08:23, Denis Excoffier wrote:
> 
> Hello!
> 
> Would it be possible that getpass() first reads on /dev/tty before
> defaulting to stdin?

Yeah, that makes sense.  I'll rework the function to behave more like
glibc's version of getpass.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: getpass and /dev/tty
  2012-04-04  8:58 ` Corinna Vinschen
@ 2012-04-04 13:00   ` Corinna Vinschen
  2012-04-04 13:47     ` Denis Excoffier
  0 siblings, 1 reply; 4+ messages in thread
From: Corinna Vinschen @ 2012-04-04 13:00 UTC (permalink / raw)
  To: cygwin

Hi Dennis,

On Apr  4 10:58, Corinna Vinschen wrote:
> On Apr  4 08:23, Denis Excoffier wrote:
> > 
> > Hello!
> > 
> > Would it be possible that getpass() first reads on /dev/tty before
> > defaulting to stdin?
> 
> Yeah, that makes sense.  I'll rework the function to behave more like
> glibc's version of getpass.

would you mind to check the latest snapshot ASAP, if the getpass
function now works as expected for you, not only your testcase, but
also your real-life problem?


Thanks,
Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: getpass and /dev/tty
  2012-04-04 13:00   ` Corinna Vinschen
@ 2012-04-04 13:47     ` Denis Excoffier
  0 siblings, 0 replies; 4+ messages in thread
From: Denis Excoffier @ 2012-04-04 13:47 UTC (permalink / raw)
  To: cygwin

On Wed, Apr 04, 2012 at 02:59:24PM +0200, Corinna Vinschen wrote:
>> Hi Dennis,
>> 
>> On Apr  4 10:58, Corinna Vinschen wrote:
>> > On Apr  4 08:23, Denis Excoffier wrote:
>> > > 
>> > > Hello!
>> > > 
>> > > Would it be possible that getpass() first reads on /dev/tty before
>> > > defaulting to stdin?
>> > 
>> > Yeah, that makes sense.  I'll rework the function to behave more like
>> > glibc's version of getpass.
>> 
>> would you mind to check the latest snapshot ASAP, if the getpass
>> function now works as expected for you, not only your testcase, but
>> also your real-life problem?

My real-life problem is not so far than the test case, in particular
i don't use the characters typed in. In any case, both work for me.
Thank you.

Denis Excoffier.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-04 13:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-04  6:23 getpass and /dev/tty Denis Excoffier
2012-04-04  8:58 ` Corinna Vinschen
2012-04-04 13:00   ` Corinna Vinschen
2012-04-04 13:47     ` Denis Excoffier

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).