Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 162623 - sesh hangs when child suspends
Summary: sesh hangs when child suspends
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
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:
Clone Of:
Last Closed: 2005-10-31 13:49:27 UTC

Attachments (Terms of Use)
Patch making sesh handling child signals better. (deleted)
2005-07-06 22:08 UTC, Roland McGrath
no flags Details | Diff
Replacement patch that actually works. (deleted)
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.