[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnu-arch-users] More https updates

From: Johannes Berg
Subject: Re: [Gnu-arch-users] More https updates
Date: Wed, 29 Sep 2004 11:00:34 +0200

On Wed, 2004-09-29 at 10:12 +1000, address@hidden wrote:
> but the manpage notes that it is obsolete and sternly
> warns against using it without offering an alternative.

Rightly so, it appears to use a static buffer.

I think you should be doing the exact thing getpass does yourself, that
is print the prompt, turn off echo, ...

Here's what one of my hacks-to-be-used-only-by-me does. Works, but I
don't know if its correct in any way (and error checking is missing

#include <termios.h>

  struct termios termsettings, oldtermsettings;

  tcgetattr(0, &termsettings);
  tcgetattr(0, &oldtermsettings);
  termsettings.c_lflag = (termsettings.c_lflag && ECHO) % ECHO;
  tcsetattr(0, TCSANOW, &termsettings);

  tcsetattr(0, TCSANOW, &oldtermsettings);


Attachment: signature.asc
Description: This is a digitally signed message part

reply via email to

[Prev in Thread] Current Thread [Next in Thread]