Red Hat Bugzilla – Bug 56551
Race in /bin/login causing loss of job control
Last modified: 2007-04-18 12:38:22 EDT
Description of Problem:
A race condition in /bin/login may cause loss of job control. This
is noticed mainly in tcsh that loses most of its interactive features.
Version-Release number of selected component (if applicable):
util-linux-2.11f-11.7.1 (in Redhat Linux 7.1 updates)
util-linux-2.11f-12 (in RedHat Linux 7.2 updates)
Steps to Reproduce:
1. Telnet and login again and again until you get the problem.
2. Usually it takes me 5 to 10 attampts on an idle computer
(686 single processor). Less on a busy SMP computer.
3. Using tcsh makes the problem more noticable.
(in tcsh, immediately after login)
Warning: no access to tty (Inappropriate ioctl for device).
Thus no job control in this shell.
Then when I get the prompt I cannot use arrow keys to edit
line. When an app is running I cannot use CTRL-C or CTRL-Z
to kill or suspend the app.
I expect full functionality of tcsh.
See also bug #56121 which is open against tcsh.
Code (inside #ifdef USE_PAM) is calling
ioctl(0, TIOCNOTTY, NULL);
in the parent process immediately AFTER a fork().
The child process is doing
opentty(ttyn); (really re-opening the tty)
Bahavior depends on the order in which things
happen. If the ioctl happens first things
work OK. If the ioctl comes after the open we
start tcsh without a controlling tty and hence
*** This bug has been marked as a duplicate of 54741 ***