From 7abd611a2396bad9d93d18681a2c59cb1ea0e158 Mon Sep 17 00:00:00 2001 From: "Barton E. Schaefer" Date: Thu, 6 Nov 2014 10:50:20 -0800 Subject: 33614 (based on RedHat BZ-978613): signal safety when updating global state in execshfunc() --- Src/exec.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Src/exec.c') diff --git a/Src/exec.c b/Src/exec.c index d2d4e800b..042215d34 100644 --- a/Src/exec.c +++ b/Src/exec.c @@ -4555,6 +4555,7 @@ execshfunc(Shfunc shf, LinkList args) fputc('\n', xtrerr); fflush(xtrerr); } + queue_signals(); ocs = cmdstack; ocsp = cmdsp; cmdstack = (unsigned char *) zalloc(CMDSTACKSZ); @@ -4562,7 +4563,11 @@ execshfunc(Shfunc shf, LinkList args) if ((osfc = sfcontext) == SFC_NONE) sfcontext = SFC_DIRECT; xtrerr = stderr; + unqueue_signals(); + doshfunc(shf, args, 0); + + queue_signals(); sfcontext = osfc; free(cmdstack); cmdstack = ocs; @@ -4570,6 +4575,7 @@ execshfunc(Shfunc shf, LinkList args) if (!list_pipe) deletefilelist(last_file_list, 0); + unqueue_signals(); } /* -- cgit v1.2.3