Bug#1101703: rlogind immediately disconnects
Removing the vhangup() call from "login.c" of the "util-linux" package helps.
But I'm hesitant to patch "login" because of possible security issues.
Instead I took a look at "rlogin.c" from the "rsh-redone-server" package.
The following patch makes rlogin ignore the signal which is sent by the
login process using the vhangup() call:
*** rlogind.c Wed Oct 1 19:16:13 2025
--- rlogind.c.ORIG Wed Oct 1 19:10:53 2025
***************
*** 500,510 ****
asprintf(&envp[0], "TERM=%s", term);
envp[1] = NULL;
- syslog(LOG_NOTICE, "Ignoring SIGHUP (login calls vhangup which kills rlogin)");
- struct sigaction sa;
- sa.sa_handler = SIG_IGN;
- sigaction(SIGHUP, &sa, NULL);
-
/* Spawn login process */
execle("/bin/login", "login", "-p", "-h", host, "-f", pamuser, NULL, envp);
--- 500,505 ----
For some reason it did not suffice to just add this:
signal(SIGHUP, SIG_IGN);
What do you think? Is this a viable way to make rlogin work with again
with a modern version of login?
Thanks,
Andy
Reply to: