[Top][All Lists]

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

Re: su command displays password

From: Bob Proulx
Subject: Re: su command displays password
Date: Thu, 29 Jul 2004 22:07:49 -0600
User-agent: Mutt/1.3.28i

Ismo Puustinen wrote:
> I have bad habit: when I type 'su', I start writing the password
> almost right away. If the computer is slow, the password prompt takes
> some time to appear. In this case, the password letters I have already
> written before the password prompt appeared are displayed on the
> screen. This is very inconvenient and bad user interface design.

This is a consequence of the fundamental design of the unix tty
driver and I/O subsystem.

  stty -a | grep echo
  isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt

The tty driver echos output characters.  Commands that read passwords
turn echo off.  It is the tty driver which is echoing your characters
before the program is started.

  $ sleep 10
  echo one two three
  $ echo one two three
  one two three

That sleep is not echoing the characters.  It is the tty driver.  When
the sleep exits the shell continues processing, sees the echo and acts
on it.

> A better solution would be to start reading the stdin immediately
> after the program is launched. This could be done in a separate thread
> while starting up the program. Implementing this behaviour would mean
> less frustration and less passwords that are forced to be changed
> prematurely.
> Will this proposal be considered? Thanks in advance!

That won't work.  The whole problem you are seeing is that the
characters are typed and echoed before the program is started.  Since
the program has not started yet it can't have any affect yet no matter
what it tries to do.

Sorry but I don't see a solution.

I suggest you use sudo.  At least you will be typing your password
less often.


reply via email to

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