Subject: Re: Bug#512004: Info received (Patch file missing in original report)

From: Michael Petch <[email-masked]>
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.