Debian Bug report logs - #512004
mgetty: Symlinked devices cause problems for getlogin() and utmp/wtmp records

version graph

Package: mgetty; Maintainer for mgetty is Package Salvaging Team <[email protected]>; Source for mgetty is src:mgetty (PTS, buildd, popcon).

Reported by: Michael Petch <[email protected]>

Date: Fri, 16 Jan 2009 08:06:01 UTC

Severity: normal

Found in version mgetty/1.1.35-3

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], [email protected], Andreas Barth <[email protected]>:
Bug#512004; Package mgetty. (Fri, 16 Jan 2009 08:06:03 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Petch <[email protected]>:
New Bug report received and forwarded. Copy sent to [email protected], Andreas Barth <[email protected]>. (Fri, 16 Jan 2009 08:06:04 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Michael Petch <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: mgetty: Symlinked devices cause problems for getlogin() and utmp/wtmp records
Date: Fri, 16 Jan 2009 01:01:55 -0700
Package: mgetty
Version: 1.1.35-3
Severity: normal



-- System Information:
Debian Release: 4.0
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-6-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages mgetty depends on:
ii  libc6                  2.3.6.ds1-13etch7 GNU C Library: Shared libraries
ii  logrotate              3.7.1-3           Log rotation utility

mgetty recommends no packages.

-- no debconf information




Information forwarded to [email protected], Andreas Barth <[email protected]>:
Bug#512004; Package mgetty. (Fri, 16 Jan 2009 08:18:02 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Petch <[email protected]>:
Extra info received and forwarded to list. Copy sent to Andreas Barth <[email protected]>. (Fri, 16 Jan 2009 08:18:02 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Michael Petch <[email protected]>
To: <[email protected]>
Subject: Patch file missing in original report
Date: Fri, 16 Jan 2009 01:17:00 -0700
[Message part 1 (text/plain, inline)]
I forgot to attach the patch to my original report. Here it is.

[mgetty-1.1.35-3-quortech2.patch (application/octet-stream, attachment)]

Information forwarded to [email protected], Andreas Barth <[email protected]>:
Bug#512004; Package mgetty. (Fri, 16 Jan 2009 08:24:03 GMT) (full text, mbox, link).


Acknowledgement sent to Michael Petch <[email protected]>:
Extra info received and forwarded to list. Copy sent to Andreas Barth <[email protected]>. (Fri, 16 Jan 2009 08:24:03 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Michael Petch <[email protected]>
To: <[email protected]>
Subject: Re: Bug#512004: Info received (Patch file missing in original report)
Date: Fri, 16 Jan 2009 01:22:48 -0700
It also seems reportbug left my problem report blank. Here is the original
problem that should have appeared in the original bug report:

------

I have used mgetty for many years. Recently we began using the debian
package cyclades-serial-client to connect external modems. This package
allows you to create devices that connect to remote modems via tcp/ip.
One thing this product does is create symbolic links in /dev/ that point
to corresponding pseduo tty's in /dev/pts.

This causes a bit of confusion for programs like pppd which may be spawned
by mgetty. I configure mgetty to use the symlinked /dev entries
(Like /dev/ttyC01). All seems to run. The modem is accessed properly by
mgetty,
but the problems start when a PPP session is found and pppd is spawned. In
our
case we spawn a shell script that eventually launches pppd. pppd can end
up calling getlogin() to determine the user of the controlling tty.
getlogin()
queries the utmp records of the controlling tty. The controlling tty that
pppd (or any spwaned process sees) is the non-symlinked device entry, not
the
original symlinked device that mgetty may have used.

This mismatch causes pppd to fail when it calls getlogin() because it looks
up the actual device name, while mgetty wrote the symlinked entry into
utmp with the symlinked name. I believe that utmp/wtmp should have the real
device names written to them, so that spawned programs can query with
getlogin() and have returned the appropriate user. This patch follows
any device that is a symlink to its real device name, and records that in
the utmp/wtmp records.

In our case, the failure causes pppd to determine the wrong user of the
controlling tty, and then used a default that caused the pppd environment
variables to be set incorrectly.








Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Thu May 15 16:15:58 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.