Bug 198648

Summary: openvt and su: no controlling tty
Product: [Fedora] Fedora Reporter: Stiphane Doyon <s.doyon>
Component: coreutilsAssignee: Tim Waugh <twaugh>
Status: CLOSED NOTABUG QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 5CC: meyering
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-07-12 11:51:04 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description Stiphane Doyon 2006-07-12 10:42:17 EDT
Description of problem:

openvt -s -w -- su - someuser -c "vlock -a"
no longer works: vlock: could not open /dev/tty: No such device or address.

Version-Release number of selected component (if applicable):

Used to work in FC4: coreutils-5.2.1-48.1
No longer works with coreutils-5.96-1.2.

How reproducible:
Systematically.

Steps to Reproduce:
1. openvt -s -w -- su - someuser -c "vlock -a"
2. or to debug: openvt -s -w -- su - someuser -c "vlock -a 2>/tmp/xx"; cat xx
  
Actual results:
vlock: could not open /dev/tty: No such device or address.

Expected results:
[switch VT]
The entire console display is now completely locked.
You will not be able to switch to another virtual console.
Please enter the password to unlock.
someuser's Password:

Additional info:

If I copy /bin/su from an FC4 machine and I do
openvt -s -w -- /tmp/fc4-su - someuser -c "vlock -a"
then it works as before.

From the changelog, I guess this entry must be it:
* Mon Nov 14 2005 Tim Waugh <twaugh@redhat.com> 5.93-2
- Call setsid() in su under some circumstances (bug #173008).

In case someone is wondering, the weird openvt invocation is used
to control access on resume from suspend to RAM, it's called from an
ACPI event handler.
Comment 1 Tim Waugh 2006-07-12 11:51:04 EDT
Well, that change was made in order to prevent a security attack vector, so
can't be changed back. :-/