Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 196995 - app-shells/bash restrictions on use of "wait" builtin excessively restrictive
Summary: app-shells/bash restrictions on use of "wait" builtin excessively restrictive
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High minor (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-25 03:21 UTC by Jakub Sadowski
Modified: 2007-10-26 09:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Sadowski 2007-10-25 03:21:07 UTC
The bash shell restricts the wait builtin to operating on child processes of the current shell or script.  This is an excessive restriction as it should be restricted to processes owned by the same user as that of the current shell or script.

Crude but equivalent functionality can be achieved with (but shouldn't need to be worked around with using such a kludge):
while kill -CONT [pid] 1>/dev/null 2>&1; do sleep 1; done

Reproducible: Always

Steps to Reproduce:
To see the restriction in action:
1. Do a "ps -ef | grep $USER"
2. Select a pid from the list of processes
3. Do a "wait [pidnum]" on the chosen pid.
Actual Results:  
The builtin fails with "bash: wait: pid [pid] is not a child of this shell"

Expected Results:  
The shell should wait until the process exits as long as the process is owned by the same user.

This can be attempted with the script sample above and will not fail as long as user can send signals to (i.e. "owns") the process in question.

This restriction should be more appropriate.
Comment 1 Jakub Moc (RETIRED) gentoo-dev 2007-10-25 05:18:10 UTC
Could you explain why's this a Gentoo-specific issue?
Comment 2 Jakub Sadowski 2007-10-25 21:57:13 UTC
(In reply to comment #1)
> Could you explain why's this a Gentoo-specific issue?
> 

It is not and has been filed at bug-bash@gnu.org.
Comment 3 Jakub Moc (RETIRED) gentoo-dev 2007-10-26 09:27:36 UTC
Well, then marking UPSTREAM; providing a link would be useful, BTW :)
Comment 4 Jakub Moc (RETIRED) gentoo-dev 2007-10-26 09:27:54 UTC
UPSTREAM.