bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] trap -p does not display ignored signals inherited from pare


From: Eric Blake
Subject: Re: [PATCH] trap -p does not display ignored signals inherited from parent by a bash process
Date: Thu, 25 Mar 2010 07:49:42 -0600
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100301 Fedora/3.0.3-1.fc12 Lightning/1.0b1 Thunderbird/3.0.3

[please keep the list in the loop]

On 03/25/2010 12:20 AM, Siddhesh Poyarekar wrote:
> On Tue, Mar 23, 2010 at 9:30 PM, Siddhesh Poyarekar
> <address@hidden> wrote:
>>> I see no bug - bash is within its rights to pretend that an inherited
>>> ignored SIGINT has no trap setting, seeing as how the user cannot modify
>>> that through any use of trap.  That is, 'trap -p' is designed to output
>>> the text that will restore traps to their normal state, but since there
>>> is no way to change the state of SIGINT from being ignored, there is
>>> nothing needed in the output.
>>>
>>
>> Thanks for that explanation. I guess we can also detect if a signal is
>> being ignored by trying to set a trap for that signal and verify that
>> it has not been set. This was my original problem and I went about
>> trying to fix it in code rather than reading the docs carefully :)
>>
> 
> I was wondering if this could be added as a feature to the trap
> behaviour, perhaps a non-standard extension like 'trap -i' which lists
> ignored signals. If not, we could modify the manpage contents to read
> as:
> 
> "Signals ignored upon entry to the shell cannot be trapped, reset or listed."
> 
> so as to make this even clearer.

Technically, this is only a POSIX requirement on non-interactive shells.
 Interactive shells may reset ignored signals on entry, effectively
starting life as if nothing had been inherited ignored.  But I don't
know (without looking at the sources) whether bash explicitly modifies
inherited ignored signals in interactive shells.

> 
> I'm asking this because I have a query from a customer (I work in Red
> Hat Support: <address@hidden>) for this and I had originally
> written the patch for RHEL-5. I've already let him know that the patch
> in the original form has been rejected and he has reverted with these
> questions.

I'm not the bash maintainer.  It's up to Chet if he'd like to provide
such an extension in the upstream sources.  But the beauty of open
source is that you can use your patch, whether or not Chet applies it
upstream; it's just that it becomes more of a maintenance burden on you
if you have to maintain it as a fork.

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-- 
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]