Bug 162623 - sesh hangs when child suspends
Summary: sesh hangs when child suspends
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo   
(Show other bugs)
Version: 4
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Ben Levenson
Depends On:
TreeView+ depends on / blocked
Reported: 2005-07-06 21:57 UTC by Roland McGrath
Modified: 2007-11-30 22:11 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-10-31 13:49:27 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
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 22:08 UTC, Roland McGrath
no flags Details | Diff
Replacement patch that actually works. (1.23 KB, patch)
2005-07-06 22:19 UTC, Roland McGrath
no flags Details | Diff

Description Roland McGrath 2005-07-06 21:57:38 UTC
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):

How reproducible:

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 22:08:33 UTC
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 22:19:25 UTC
Created attachment 116443 [details]
Replacement patch that actually works.

Comment 3 Karel Zak 2005-09-19 17:25:30 UTC
The patch added to FC5.

Comment 4 Fedora Update System 2005-10-26 17:20:35 UTC
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.