Bug 121008

Summary: sudo traps SIGINT
Product: [Fedora] Fedora Reporter: Chris McDonough <chrism>
Component: sudoAssignee: Daniel Walsh <dwalsh>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhideCC: kajtzu, redhat-bugzilla
Target Milestone: ---   
Target Release: ---   
Hardware: athlon   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-02-09 18:55:14 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chris McDonough 2004-04-16 03:55:27 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040312

Description of problem:
The version of sudo shipping with FC2-devel apparently wrongly traps
SIGINT.

For example, if I type "sudo tail -f /var/log/messages", I cannot kill
the tail by pressing Ctrl-C.  I need to visit another terminal and
send the tail process a SIGTERM to get it to release control to the
terminal.  This happens under both gnome-terminal and konsole, so
apparently neither can be blamed.  It also does not happen when
running tail directly when logged in as root (as opposed to using sudo).



Version-Release number of selected component (if applicable):
sudo-1.6.7p5-25

How reproducible:
Always

Steps to Reproduce:
1. add yourself to /etc/sudoers
2. type sudo tail -f /var/log/messages
3. try to exit the tail process by pressing ctrl-C; you cannot.
    

Actual Results:  I was unable to stop the tail process.

Expected Results:  I should have been able to stop the tail process
with a ctrl-C.

Additional info:

Comment 1 Robert Scheck 2004-04-16 06:10:33 UTC
Maybe it's a problem caused by the SELinux support? 

I'm able here to do a Ctrl-C as user as well as root in this situation 
at sudo-1.6.7p5-25 at my system, but my sudo is compiled without 
SELinux support...

Comment 2 Kaj J. Niemi 2004-04-16 15:03:35 UTC
I'm not able to reproduce it as you describe (I run zsh as my default
shell, if it matters) but the following does the trick:

1. sudo vim /tmp/whatever
2. suspend with Ctrl-Z from vim
3. wonder where your prompt is

(and now find the pid of sesh and kill it)

Comment 3 Matthew S. Hallacy 2004-04-18 09:46:49 UTC
I'm having the same problem, although I'm not sure it's sudo's fault:

strace -p `pidof tail`

strace -p 11147
Process 11147 attached - interrupt to quit
setup()                                 = 0
nanosleep({1, 0}, 0)                    = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
setup()                                 = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
setup()                                 = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
setup()                                 = 0
nanosleep({1, 0}, 0)                    = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGINT (Interrupt) @ 0 (0) ---
setup()                                 = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=42514, ...}) = 0
clock_gettime(0, {1082281705, 63286000}) = 0
nanosleep({1, 0}, NULL)                 = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=42514, ...}) = 0
clock_gettime(0, {1082281706, 66032000}) = 0
nanosleep({1, 0}, 0)                    = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGTSTP (Stopped) @ 0 (0) ---
--- SIGTSTP (Stopped) @ 0 (0) ---
setup()                                 = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=42514, ...}) = 0
clock_gettime(0, {1082281707, 69491000}) = 0
nanosleep({1, 0}, 0)                    = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGTSTP (Stopped) @ 0 (0) ---
--- SIGTSTP (Stopped) @ 0 (0) ---
setup()                                 = ? ERESTART_RESTARTBLOCK (To
be restarted)
--- SIGTSTP (Stopped) @ 0 (0) ---
--- SIGTSTP (Stopped) @ 0 (0) ---
setup()                                 = 0
fstat64(3, {st_mode=S_IFREG|0644, st_size=42514, ...}) = 0
clock_gettime(0, {1082281708, 75413000}) = 0
nanosleep({1, 0},  <unfinished ...>
Process 11147 detached


I tried both ^C (SIGINT) ^Z (SIGSTOP) and killall -SIGINT from another
login, this only happens when I sudo, not when I su. A curiousity is
the call to setup(), this doesn't happen under normal tail behavior
(and I was unable to find the function in the entire coreutils package
that tail comes in)

Comment 4 Matthew S. Hallacy 2004-04-18 09:55:25 UTC
Did some more checking, it's definitely sudo+selinux causing the
problem.. downgraded to pre-selinux support and everything is peachy
again.

Comment 5 Daniel Walsh 2004-04-21 11:13:26 UTC
Fixed in sudo-1.6.7p5-26

Comment 6 Daniel Walsh 2005-02-09 18:55:14 UTC
Fixed in current release