[scponly] --enable-passwd-compat and echo'd passwords

David Ramsden david at hexstream.eu.org
Thu Mar 24 11:58:15 EST 2005


On Thu, Mar 24, 2005 at 04:49:03PM +0000, David Ramsden wrote:
> On Thu, Mar 24, 2005 at 08:33:21AM -0800, Kaleb Pederson wrote:
> [snip]
> > 
> > The above happens on Linux.  Does anybody else see the same behavior?  Anybody 
> > know how to fix it offhand?
> > 
> 
> I've not tested this yet but to turn off echo you can use "stty -echo".
> I've noted "man 2 stty" - maybe this is what you need?
> 

Done a little more research and stumbled across some code which might do
what you need. I've tested it under Linux by calling ttyecho(0, 0) which
turns off echo and I can't see my keystrokes. Calling ttyecho(0, 1)
turns echo back on.

Code is as follows:

#include <stdio.h>
#include <termios.h>

int ttyecho(int fd, int on)
{
        struct termios term;

        if (tcgetattr(fd, &term) == -1)
                return -1;

        if (on)
                term.c_lflag |= ECHO;
        else
                term.c_lflag &= ~ECHO;

        return tcsetattr(fd, TCSADRAIN, &term);
}

Regards,
David.
-- 
 .''`.     David Ramsden <david at hexstream.eu.org>
: :'  :    http://david.hexstream.eu.org/
`. `'`     PGP key ID: 507B379B on wwwkeys.pgp.net
  `-  Debian - when my girlfriend's away and there's nothing better to do.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 232 bytes
Desc: not available
Url : https://lists.ccs.neu.edu/pipermail/scponly/attachments/20050324/7866acbf/attachment.bin


More information about the scponly mailing list