about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorFrank Terbeck <ft@bewatermyfriend.org>2013-05-05 20:17:24 +0200
committerFrank Terbeck <ft@bewatermyfriend.org>2013-05-05 20:33:36 +0200
commit2405b0ac0cc296cc492b8665112e6d05e863b09f (patch)
treec3e38846213692bd945547bdd2ed98d1b6d26dbd /Src
parent9604bc9a9f6a4f308fe8e4e5a11247b90a9d61b7 (diff)
downloadzsh-2405b0ac0cc296cc492b8665112e6d05e863b09f.tar.gz
zsh-2405b0ac0cc296cc492b8665112e6d05e863b09f.tar.xz
zsh-2405b0ac0cc296cc492b8665112e6d05e863b09f.zip
31376: Make sure every execve() is prefixed by winch_unblock()
This was suggested by Bart Schaefer in 31375.
Diffstat (limited to 'Src')
-rw-r--r--Src/exec.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Src/exec.c b/Src/exec.c
index fa148756b..14c2ba003 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -452,6 +452,7 @@ zexecve(char *pth, char **argv, char **newenvp)
 
     if (newenvp == NULL)
 	    newenvp = environ;
+    winch_unblock();
     execve(pth, argv, newenvp);
 
     /* If the execve returns (which in general shouldn't happen),   *
@@ -486,6 +487,7 @@ zexecve(char *pth, char **argv, char **newenvp)
 				(pprog = pathprog(ptr2, NULL))) {
 				argv[-2] = ptr2;
 				argv[-1] = ptr + 1;
+				winch_unblock();
 				execve(pprog, argv - 2, newenvp);
 			    }
 			    zerr("%s: bad interpreter: %s: %e", pth, ptr2,
@@ -494,13 +496,16 @@ zexecve(char *pth, char **argv, char **newenvp)
 			    *ptr = '\0';
 			    argv[-2] = ptr2;
 			    argv[-1] = ptr + 1;
+			    winch_unblock();
 			    execve(ptr2, argv - 2, newenvp);
 			} else {
 			    argv[-1] = ptr2;
+			    winch_unblock();
 			    execve(ptr2, argv - 1, newenvp);
 			}
 		    } else if (eno == ENOEXEC) {
 			argv[-1] = "sh";
+			winch_unblock();
 			execve("/bin/sh", argv - 1, newenvp);
 		    }
 		} else if (eno == ENOEXEC) {
@@ -509,6 +514,7 @@ zexecve(char *pth, char **argv, char **newenvp)
 			    break;
 		    if (t0 == ct) {
 			argv[-1] = "sh";
+			winch_unblock();
 			execve("/bin/sh", argv - 1, newenvp);
 		    }
 		}