Paulo César Pereira de Andrade
2017-05-30 15:56:03 UTC
Hi,
I have a ksh user that relied on previous behaviour of ksh (not posix)
functions trap handling.
The change in question is src/cmd/ksh93/sh/xec.c:sh_funscope()
that now only "forwards" a signal for SIGINT and SIGQUIT.
if (r>SH_EXITSIG && ((r&SH_EXITMASK)==SIGINT || r&SH_EXITMASK)==SIGQUIT)
kill(getpid(),r&SH_EXIMASK);
previously it would call sh_fault() on any signal.
I see the patch is explicit, but I fail to understand the reason of the
behavior change, e.g. if executing nested non posix functions, and
a non posix function traps signals, it now may ignore signals that by
default would have terminated the script/execution.
One example is the attached script. Note that fixing the test case
is trivial. The issue is the user relying on previous behavior.
Thanks,
Paulo
I have a ksh user that relied on previous behaviour of ksh (not posix)
functions trap handling.
The change in question is src/cmd/ksh93/sh/xec.c:sh_funscope()
that now only "forwards" a signal for SIGINT and SIGQUIT.
if (r>SH_EXITSIG && ((r&SH_EXITMASK)==SIGINT || r&SH_EXITMASK)==SIGQUIT)
kill(getpid(),r&SH_EXIMASK);
previously it would call sh_fault() on any signal.
I see the patch is explicit, but I fail to understand the reason of the
behavior change, e.g. if executing nested non posix functions, and
a non posix function traps signals, it now may ignore signals that by
default would have terminated the script/execution.
One example is the attached script. Note that fixing the test case
is trivial. The issue is the user relying on previous behavior.
Thanks,
Paulo