Bug 56551 - Race in /bin/login causing loss of job control
Summary: Race in /bin/login causing loss of job control
Keywords:
Status: CLOSED DUPLICATE of bug 54741
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: util-linux
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Elliot Lee
QA Contact: Ben Levenson
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-11-20 20:44 UTC by Itai Nahshon
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2001-11-20 20:45:01 UTC
Embargoed:


Attachments (Terms of Use)

Description Itai Nahshon 2001-11-20 20:44:54 UTC
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)

How Reproducible:
Always

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.

Actual Results:
(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.

Expected Results:
I expect full functionality of tcsh.

Additional Information:
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
  setsid();
  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
the problem.

Comment 1 Elliot Lee 2001-11-20 20:49:29 UTC

*** This bug has been marked as a duplicate of 54741 ***


Note You need to log in before you can comment on or make changes to this bug.