Bug 131673 - faxrunq incompatible with current bash
Summary: faxrunq incompatible with current bash
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: mgetty
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jason Vas Dias
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: FC3Target FC4Target
TreeView+ depends on / blocked
 
Reported: 2004-09-03 02:05 UTC by Jonathan Kamens
Modified: 2007-11-30 22:10 UTC (History)
0 users

Fixed In Version: bash-3.0+
Clone Of:
Environment:
Last Closed: 2005-02-21 16:23:16 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch to change trap usage (910 bytes, patch)
2004-09-03 02:06 UTC, Jonathan Kamens
no flags Details | Diff

Description Jonathan Kamens 2004-09-03 02:05:40 UTC
The "trap 0 ..." syntax in /usr/bin/faxrunq in mgetty-sendfax is
incompatible with bash 3.  See attached patch.

Comment 1 Jonathan Kamens 2004-09-03 02:06:29 UTC
Created attachment 103418 [details]
patch to change trap usage

Comment 2 Jason Vas Dias 2004-09-03 14:41:25 UTC
 I don't understand the point of these changes - please explain
 the problem they are designed to solve.
 
 The meaning of the 'trap' command usage does not seem to have 
 changed:

 From the bash-2.0 (1996) manpage:
   
 trap [-lp] [arg] [sigspec]
   The  command  arg  is  to  be  read  and executed when the shell
   receives signal(s) sigspec.  If arg is absent or -,  all  speci-
   fied signals are reset to their original values (the values they
   had upon entrance to the shell).  If arg is the null string this
   signal  is  ignored by the shell and by the commands it invokes.

 From the bash-3.0.5 (latest version) manpage:

 trap [-lp] [[arg] sigspec ...]
   The command arg is to  be  read  and  executed  when  the  shell
   receives  signal(s)  sigspec.   If arg is absent (and there is a
   single sigspec) or -, each specified  signal  is  reset  to  its
   original  disposition  (the  value  it  had upon entrance to the
   shell).  If arg is the null string the signal specified by  each
   sigspec  is ignored by the shell and by the commands it invokes.

So the intent of the commands such as
   trap 0 1 2 3 15
is to cause all the listed signals to be 
   "ignored by the shell and by the commands it invokes"
which is the same behaviour in bash-2.0 as in bash-3.0.5 .

So your changes will reset the signals to their original
disposition without ignoring them; this is not the intent
of the original commands, which is to ignore the signals.

Please explain why you want these changes made and what
problems they solve.



Comment 3 Jonathan Kamens 2004-09-03 15:48:09 UTC
The point of these changes is that when bash 3.0 is run as /bin/sh 
instead of /bin/bash, "trap 0" syntax is not accepted:

$ /bin/bash
$ trap 0
$ exit
exit
$ /bin/sh
$ trap 0
trap: usage: trap [-lp] [arg|-] [signal_spec ...]
$ exit
exit
$ 


Comment 4 Jason Vas Dias 2004-09-03 17:07:20 UTC
 I see the problem now - the bash maintainer confirms that
 bash-as-sh was changed intentionally to conform to POSIX
 syntax in this respect.
 
 Actually, on further investigation, the '#!@SHELL@' is 
 a configure-time option, and at the moment I can see no
 reason not to make @SHELL@ /bin/bash, which would also
 fix the problem with less patching required - I will test
 this, and if there are any problems, will revert to your
 patch with SHELL=/bin/sh.
   
 In any case, this will be fixed in the next mgetty release
 (mgetty-1.1.31-3).  


Comment 5 Jason Vas Dias 2005-02-21 16:23:16 UTC
This is now fixed with bash-3.0-27 .


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