Article View: comp.bugs.sys5
Article #622Re: weird bug with passwd and /dev/syscon
From: Tom Lowe
Date: Mon, 19 Oct 1987 14:07
Date: Mon, 19 Oct 1987 14:07
46 lines
2883 bytes
2883 bytes
In article <933@sauron.Columbia.NCR.COM>, wescott@sauron.Columbia.NCR.COM (Mike Wescott) writes:
> In article <298@boole.acc.virginia.edu> ejc@boole.acc.virginia.edu (Elizabeth Cummings) writes:
> >
> > We noticed the following bug the other day with some of our 3b2's.
> > When /dev/syscon is linked to a tty line, say tty11, you can't run the
> > passwd command on that tty line without giving passwd an argument.
> >
> > Does anyone know why this happens?
>
> passwd (without arguments) is looking in /etc/utmp to find who is logged in.
> It does this by checking to see which tty it has been invoked on and finds
> /dev/syscon. /dev/syscon has an entry in /etc/utmp (probably a dead one)
> and passwd gets confused.
Close...but actually, in /etc/utmp there is an entry for tty11 which is
as it should be because that is what the getty or uugetty knew about. It
is NOT a dead entry....it is very much accurate and up to date. However,
any process that you have running knows its controlling tty only by it's
major and minor numbers. When 'passwd' runs, it calls getlogin() which
looks in /etc/utmp for the login name. It first uses the major and minor
number of its controlling tty to scan the /dev directory for the device
it is on. The first match it finds is syscon. It tries to find syscon
in /etc/utmp, but doesn't find it....Therefore it asks for the argument.
You can see this in action by doing a ps -ef and noticing that the tty
for your processes are syscon and not tty11. Also if you do an 'od' of
/etc/utmp you will see tty11 and not syscon. Also do a 'od' of the /dev
directory and you will see the order of the entries.
>
> An easy workaround is to reorder your /dev directory so that /dev/syscon and
> /dev/systty are after all of the /dev/tty?? entries with no unused entries
> before the last tty?? entry.
This is true...you can use fsdb to change this around.
> --
> -Mike Wescott
> wescott@ncrcae.Columbia.NCR.COM
--
Tom Lowe {rutgers,gatech,huscb,burdvax,ihnp4,cbosgd}!psuvax1!moby!tel
AT&T National Systems Support Center, S. Plainfield, NJ (1-800-922-0354)
Please call only if you have an AT&T computer under Warranty or if you
have an AT&T Maintenance Contract on your equipment.
Technical Details
Message-ID:
<199@Ahab.moby.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!hao!boulder!sunybcs!rutgers!psuvax1!moby!telReferences:
<298@boole.acc.virginia.edu> <933@sauron.Columbia.NCR.COM>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!husc6!hao!boulder!sunybcs!rutgers!psuvax1!moby!tel From: tel@moby.UUCP (Tom Lowe) Newsgroups: comp.bugs.sys5 Subject: Re: weird bug with passwd and /dev/syscon Message-ID: <199@Ahab.moby.UUCP> Date: Mon, 19-Oct-87 10:07:09 EDT Article-I.D.: Ahab.199 Posted: Mon Oct 19 10:07:09 1987 Date-Received: Thu, 22-Oct-87 00:29:04 EDT References: <298@boole.acc.virginia.edu> <933@sauron.Columbia.NCR.COM> Organization: AT&T National Systems Support Center, South Plainfield, NJ Lines: 46 Summary: close