Bug 162623 - sesh hangs when child suspends
sesh hangs when child suspends
Status: CLOSED ERRATA
Product: Fedora
Classification: Fedora
Component: sudo (Show other bugs)
4
All Linux
medium Severity medium
: ---
: ---
Assigned To: Karel Zak
Ben Levenson
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-06 17:57 EDT by Roland McGrath
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2005-10-31 08:49:27 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch making sesh handling child signals better. (946 bytes, patch)
2005-07-06 18:08 EDT, Roland McGrath
no flags Details | Diff
Replacement patch that actually works. (1.23 KB, patch)
2005-07-06 18:19 EDT, Roland McGrath
no flags Details | Diff

  None (edit)
Description Roland McGrath 2005-07-06 17:57:38 EDT
Description of problem:

Under SELinux, sudo runs things via "sesh", forks and execs the command and
waits for its result.  This does not cope with the command stopping for job control.

Version-Release number of selected component (if applicable):
sudo-1.6.8p8-2.2


How reproducible:
100%

Steps to Reproduce:
1. sudo -s
2. Type "suspend" in subshell
3. See it sit there.
  
Actual results:
Sits there.

Expected results:

The whole sudo command is suspended and reports to the containing shell.


Additional info:

There was a change to sesh.c to make it fork and wait rather than just exec.
I don't understand why that was needed.  If it just exec'd that would do the
SELinux transition magic I would think, and it would deal with job control
correctly.  If it needs to fork for some reason I don't understand, then it
needs to use WUNTRACED in its waitpid call, and propagate a stop signal by
raising it for sesh itself.
Comment 1 Roland McGrath 2005-07-06 18:08:33 EDT
Created attachment 116438 [details]
Patch making sesh handling child signals better.

Please put this patch in unless you have something better.
This makes sesh handle stop signals properly, fixing this bug.
It also makes it exit with a useful status for a child killed by a signal,
matching what the shell would do if "sh -c" were used instead of sesh.
Comment 2 Roland McGrath 2005-07-06 18:19:25 EDT
Created attachment 116443 [details]
Replacement patch that actually works.
Comment 3 Karel Zak 2005-09-19 13:25:30 EDT
The patch added to FC5.
Comment 4 Fedora Update System 2005-10-26 13:20:35 EDT
From User-Agent: XML-RPC

sudo-1.6.8p8-2.3 has been pushed for FC4, which should resolve this issue.  If these problems are still present in this version, then please make note of it in this bug report.

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