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

Full log


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

Received: (at 512004) by bugs.debian.org; 16 Jan 2009 08:22:55 +0000
From [email protected] Fri Jan 16 08:22:55 2009
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rietz.debian.org
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 21; hammy, 141; neutral, 68; spammy,
	2. spammytokens:0.913-+--our, 0.892-+--product hammytokens:0.000-+--reportbug,
	 0.000-+--mismatch, 0.000-+--symlink, 0.000-+--HX-Cloudmark-SP-Filtered:true,
	0.000-+--HX-Cloudmark-SP-Result:1.0
X-Spam-Status: No, score=-4.0 required=4.0 tests=AWL,BAYES_00,HAS_BUG_NUMBER,
	MURPHY_DRUGS_REL8 autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Return-path: <[email protected]>
Received: from idcmail-mo1so.shaw.ca ([24.71.223.10])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <[email protected]>)
	id 1LNjyh-0003BZ-FK
	for [email protected]; Fri, 16 Jan 2009 08:22:55 +0000
Received: from pd2ml2so-ssvc.prod.shaw.ca ([10.0.141.134])
  by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 16 Jan 2009 01:22:49 -0700
X-Cloudmark-SP-Filtered: true
X-Cloudmark-SP-Result: v=1.0 c=0 a=C5TSDx71ujqGvTofk8gA:9 a=DyVcN_HvQcQdwQ5qJ6XKkLeHtVMA:4 a=LgHrHOF5vhoA:10 a=O8Ranyc2ds4A:10
Received: from s0106000a9595fc8a.cg.shawcable.net (HELO debianlenny.capp-sysware.com) ([70.75.10.156])
  by pd2ml2so-dmz.prod.shaw.ca with ESMTP; 16 Jan 2009 01:22:49 -0700
Received: from ppcmac.capp-sysware.com ([192.168.67.128])
	by debianlenny.capp-sysware.com with esmtp (Exim 4.69)
	(envelope-from <[email protected]>)
	id 1LNjyb-0003Us-A6
	for [email protected]; Fri, 16 Jan 2009 01:22:49 -0700
User-Agent: Microsoft-Entourage/11.4.0.080122
Date: Fri, 16 Jan 2009 01:22:48 -0700
Subject: Re: Bug#512004: Info received (Patch file missing in original
 report)
From: Michael Petch <[email protected]>
To: <[email protected]>
Message-ID: <C59591E8.7821D%[email protected]>
Thread-Topic: Bug#512004: Info received (Patch file missing in original
 report)
Thread-Index: Acl3s51g3BryPuOmEd2mQwAKlZX8ig==
In-Reply-To: <[email protected]>
Mime-version: 1.0
Content-type: text/plain;
	charset="US-ASCII"
Content-transfer-encoding: 7bit
X-SA-Exim-Connect-IP: 192.168.67.128
X-SA-Exim-Mail-From: [email protected]
X-SA-Exim-Scanned: No (on debianlenny.capp-sysware.com); SAEximRunCond expanded to false
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 18:49:13 2025; Machine Name: bembo

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.