#1111651 login: instant logout after upgrade to trixie

Package:
login
Source:
login
Description:
system login tools
Submitter:
Marc Lehmann
Date:
2025-08-20 16:39:01 UTC
Severity:
normal
#1111651#5
Date:
2025-08-20 15:24:06 UTC
From:
To:
Dear Maintainer,

I've upgraded a server using rlogin/rsh-redone-server to trixie. Specifically, I upgraded
1:4.13+dfsg1-1+deb12u1 to 1:4.16.0-2+really2.41-5

After that, login via rlogin was rarely possible. That is, it sometimes worked, but in the majority of cases
(say, nine out of ten), the result was an instant connection close, for no apparant reason.

I tried downgradiong various components (switch inetd, switch rsh-server)
but as it turned out, the problematic component is login. Downgrading
just the login package to bookworm makes the login 100% reliable again,
upgrading login to trixie, no longer works.

I've provided two strace's created with the trixie login package, one with successful login
and one with failure:

http://data.plan9.de/login-success.txt
http://data.plan9.de/login-failure.txt

The crucial difference seems to be this (a good search point is "vhanghup"):

   37352 access("/dev/pts/9", R_OK|W_OK)   = 0
   37352 ioctl(0, TIOCGWINSZ, {ws_row=56, ws_col=120, ws_xpixel=1320, ws_ypixel=1064}) = 0
   37352 ioctl(0, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lf
   lag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
   37352 fchown(0, 0, 0)                   = 0
   37352 fchmod(0, 0600)                   = 0
   37352 ioctl(0, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lf
   lag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
   37352 ioctl(0, TCSETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lf
   lag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
   37352 ioctl(0, TCGETS, {c_iflag=ICRNL|IXON, c_oflag=NL0|CR0|TAB0|BS0|VT0|FF0|OPOST|ONLCR, c_cflag=B38400|CS8|CREAD, c_lf
   lag=ISIG|ICANON|ECHO|ECHOE|ECHOK|IEXTEN|ECHOCTL|ECHOKE, ...}) = 0
   37352 close(0)                          = 0
   37352 close(1)                          = 0
   37352 close(2)                          = 0
   37351 <... pselect6 resumed>)           = 1 (in [3])
   37352 rt_sigaction(SIGHUP, {sa_handler=SIG_IGN, sa_mask=[HUP], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f8f79febd
   f0},  <unfinished ...>
   37351 read(3,  <unfinished ...>
   37352 <... rt_sigaction resumed>{sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
   37351 <... read resumed>0x7ffc095bcf10, 1025) = -1 EIO (Input/output error)
   37352 vhangup( <unfinished ...>

What happens here is that login (37352) closes 0, 1 2, and this causes
the rlogind (37351) to get an instant HUP on it's pty fd, closing the
connection.

The success case looks very similar, except that the parent does not get an instant HUP and everything continues.

I haven't delved into the code, but it seems in the failure case either
login closes all fds to the tty, causing the pty to HUP, or maybe it's a
race.

In any case, this of course breaks all rlogin packages.

#1111651#10
Date:
2025-08-20 16:38:25 UTC
From:
To:
Could you try the login package from unstable, which installs the
"remote" PAM config file.

Maybe that's already enough.

Chris