1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-28 15:01:21 +02:00

23008: failure to output error message could alter exit status

This commit is contained in:
Peter Stephenson 2006-11-19 21:34:58 +00:00
parent 7c98ca21f5
commit 6d0dc9e0eb
2 changed files with 8 additions and 3 deletions

@ -1,3 +1,8 @@
2006-11-19 Peter Stephenson <p.w.stephenson@ntlworld.com>
* 23008: Src/exec.c: failure to output error message could
alter exit status.
2006-11-18 Clint Adams <clint@zsh.org>
* 23005: Completion/Unix/Command/_toilet: completion

@ -522,12 +522,12 @@ execute(LinkList args, int dash, int defpath)
}
for (s = arg0; *s; s++)
if (*s == '/') {
errno = zexecve(arg0, argv);
int lerrno = zexecve(arg0, argv);
if (arg0 == s || unset(PATHDIRS) ||
(arg0[0] == '.' && (arg0 + 1 == s ||
(arg0[1] == '.' && arg0 + 2 == s)))) {
zerr("%e: %s", errno, arg0);
_exit((errno == EACCES || errno == ENOEXEC) ? 126 : 127);
zerr("%e: %s", lerrno, arg0);
_exit((lerrno == EACCES || lerrno == ENOEXEC) ? 126 : 127);
}
break;
}