HomeFreeBSD

sh: Do not ignore INTOFF during a trap

Description

sh: Do not ignore INTOFF during a trap

INTOFF postpones SIGINT processing and INTON enables it again. This is
important so an interactive shell can return to the top level prompt when
Ctrl+C is pressed.

Given that INTON is automatically done when a builtin completes, the part
where onsig() ignores suppressint when in_dotrap is true is both unnecessary
and unsafe. If the trap is for some other signal than SIGINT, arbitrary code
could have been interrupted.

Historically, INTOFF remained in effect for longer.

Reviewed by: bdrewery
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D25270

Details

Provenance
jillesAuthored on
Reviewer
bdrewery
Differential Revision
D25270: sh: Do not ignore INTOFF during a trap
Parents
rS363056: MFC of 362560
Branches
Unknown
Tags
Unknown