From c5a891a29d1d4f946181f6699bcf7f6fe35b43e6 Mon Sep 17 00:00:00 2001
From: Peter Stephenson
Date: Tue, 12 Apr 2022 14:10:08 +0100
Subject: 50049: care with signed characters
Some signed-to-unsigned casts needed for a couple of cases of pointers
used as indices.
---
Src/exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'Src/exec.c')
diff --git a/Src/exec.c b/Src/exec.c
index 27d49e005..47753da48 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -561,7 +561,7 @@ zexecve(char *pth, char **argv, char **newenvp)
isbinary = 1;
hasletter = 0;
for (ptr = execvebuf; ptr < ptr2; ptr++) {
- if (islower(*ptr) || *ptr == '$' || *ptr == '`')
+ if (islower(STOUC(*ptr)) || *ptr == '$' || *ptr == '`')
hasletter = 1;
if (hasletter && *ptr == '\n') {
isbinary = 0;
--
cgit v1.2.3
From 0ccc3c149413921fbf5c00696bf350333927eb64 Mon Sep 17 00:00:00 2001
From: Bart Schaefer
Date: Thu, 28 Apr 2022 17:03:31 -0700
Subject: 50162: Fix multios with current-shell "exec" (aka nullexec).
---
ChangeLog | 4 ++++
Etc/BUGS | 6 ------
Src/exec.c | 4 ++++
3 files changed, 8 insertions(+), 6 deletions(-)
(limited to 'Src/exec.c')
diff --git a/ChangeLog b/ChangeLog
index 8ff17f179..b30b646c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2022-04-28 Bart Schaefer
+
+ * 50126: Etc/BUGS, Src/exec.c: Fix multios in current-shell "exec"
+
2022-04-26 dana
* unposted: Completion/Unix/Command/_getopt: Fix util-linux
diff --git a/Etc/BUGS b/Etc/BUGS
index 3121fc9fa..b511ec6d6 100644
--- a/Etc/BUGS
+++ b/Etc/BUGS
@@ -46,12 +46,6 @@ interactive and the subshell is the foreground job. The USEZLE option is
always turned off in subshells, for reasons lost to history. There is a
related, probably obsolete, vared special case for $TERM set to "emacs".
------------------------------------------------------------------------
-users/26150: MULTIOS does not work with "exec":
-
-exec 3>/tmp/test1 3>/tmp/test2
-
-causes a script to hang.
-------------------------------------------------------------------------
47561: [PATCH v4] vcs_info: choose backend by basedir
------------------------------------------------------------------------
39319: () { exit } =(:) doesn't clean up the tempfile
diff --git a/Src/exec.c b/Src/exec.c
index 47753da48..c31089bb5 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -3898,6 +3898,10 @@ execcmd_exec(Estate state, Execcmd_params eparams,
for (i = 0; i < 10; i++)
if (save[i] != -2)
zclose(save[i]);
+ /*
+ * We're done with this job, no need to wait for it.
+ */
+ jobtab[thisjob].stat |= STAT_DONE;
goto done;
}
if (isset(XTRACE)) {
--
cgit v1.2.3
From 8181708feb35c647aa9b9692875a1ebf893ade6b Mon Sep 17 00:00:00 2001
From: Bart Schaefer
Date: Fri, 29 Apr 2022 20:37:09 -0700
Subject: 50136: Fix =(nosuchcommand) race/deadlock first reported in
workers/42609
---
ChangeLog | 3 +++
Etc/BUGS | 2 --
Src/exec.c | 4 ----
3 files changed, 3 insertions(+), 6 deletions(-)
(limited to 'Src/exec.c')
diff --git a/ChangeLog b/ChangeLog
index 7cf99072e..e234b76b6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2022-04-29 Bart Schaefer
+ * 50136: Etc/BUGS, Src/exec.c: Fix =(nosuchcommand) race/deadlock
+ first reported in workers/42609
+
* 50134: Src/jobs.c: Tweak process group handling (workers/43409)
to avoid creating "unkillable" pipelines that ignore signals
diff --git a/Etc/BUGS b/Etc/BUGS
index a0d23eac9..befae4477 100644
--- a/Etc/BUGS
+++ b/Etc/BUGS
@@ -30,8 +30,6 @@ the prefix parameter assignments are examined in execute().
41203 and others: Make it easier to maintain C modules out of tree.
(May require defining a stable API for modules, see 41254)
------------------------------------------------------------------------
-42609: :|: =(hang)
-------------------------------------------------------------------------
44133 debian #924736 (partial patch in 44134) three setopts following ` #`
------------------------------------------------------------------------
44850 terminal issues with continuation markers
diff --git a/Src/exec.c b/Src/exec.c
index c31089bb5..f2911807c 100644
--- a/Src/exec.c
+++ b/Src/exec.c
@@ -4883,13 +4883,9 @@ getoutputfile(char *cmd, char **eptr)
child_unblock();
return nam;
} else if (pid) {
- int os;
-
close(fd);
- os = jobtab[thisjob].stat;
waitforpid(pid, 0);
cmdoutval = 0;
- jobtab[thisjob].stat = os;
return nam;
}
--
cgit v1.2.3