Bug 186879 - su -c "command" has no controlling terminal anymore
Summary: su -c "command" has no controlling terminal anymore
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: coreutils
Version: 5
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Tim Waugh
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-03-27 08:32 UTC by Karel van Houten
Modified: 2017-03-11 22:27 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2006-03-27 08:40:22 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Karel van Houten 2006-03-27 08:32:12 UTC
Description of problem:

When using su -c "bash" (for example), the resulting bash shell has no access to
its controlling terminal (/dev/tty), so there is no job-control possible, and
tools like 'resize' fail.

Version-Release number of selected component (if applicable):
coreutils 5.93 (bug was not present in the FC4 version 5.2.1)

How reproducible: allways.


Steps to Reproduce:
1. su root -c "bash" (enter password)
2. cat
3. type ^C to interrupt.
  
Actual results:
[karel@fc5 karel]$ /bin/su root -c "bash"
Password: 
[root@fc5 karel]# cat
(type ^C)
Session terminated, killing shell... ...killed.
(session hangs, with 2 processes reading from terminal)

Expected results:
[karel@fc5 karel]$ /tmp/su4 root -c "bash"
Password: 
[root@fc5 karel]# cat
(type ^C)
[root@fc5 karel]# exit
exit


Additional info:

Comment 1 Tim Waugh 2006-03-27 08:40:22 UTC
Use '-s' to run a particular shell.  -c is not for interactive commands.

Comment 2 Karel van Houten 2006-03-28 05:37:20 UTC
I've made a workaround based on the -s option. But I disagree that this is not a
bug. I have scripts, that start an interactive command, using su -c, where the
command has to accept arguments. This is not possible with the -s option.  These
scripts have worked on all unix versions (hpux, solaris), up to Fedora 4, and
now starting with Fedora 5, I have to code these scripts different for linux and
other unices. I don't think that is the way to go for unix.

Regards,
Karel.


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