summaryrefslogtreecommitdiff
path: root/bin/ksh/exec.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-29 04:09:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-29 04:09:22 +0000
commit48e72123566c3d7650be6571b80f9f70b41c6724 (patch)
tree0d23d0de2abdb77ca3971067b7984db08dcd8da6 /bin/ksh/exec.c
parentf3f5bf3ebf1aaee9195c0d49323beb781e0c1676 (diff)
Bug fixes from pdksh-unstable-5.2.13.4, including "official" versions of
some that we had already fixed locally. o typeset -f FUNC doesn't print follows command (and expression) substitutions. o when re-allocating memory, too much may be copied from old memory. o set -o printed some options sans names. o emacs mode: <esc>. in very fist command causes core dump. o pdksh dumps core after a cd command. o typeset -i reports on array elements that have no value (at&t ksh reports on array base name - no index). o ulimit -ctn unlimittttted kills shell (resource exceeded). o ". /dev/null" says access denied. o flag field in aliases incorrectly changed (all flags set instead of clearing ISSET) in exec.c(flushcom). o ${#array[*]} prints largest index instead of number of (set) elements in an array (ksh88 does the former). o sys_siglist[] doesn't always have NSIG non-null entries...
Diffstat (limited to 'bin/ksh/exec.c')
-rw-r--r--bin/ksh/exec.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bin/ksh/exec.c b/bin/ksh/exec.c
index 9d0fb9640e2..c7d410cd3fd 100644
--- a/bin/ksh/exec.c
+++ b/bin/ksh/exec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec.c,v 1.12 1998/06/27 15:23:29 deraadt Exp $ */
+/* $OpenBSD: exec.c,v 1.13 1998/10/29 04:09:20 millert Exp $ */
/*
* execute command tree
@@ -1083,7 +1083,7 @@ flushcom(all)
tp->flag &= ~(ALLOC|ISSET);
afree(tp->val.s, APERM);
}
- tp->flag = ~ISSET;
+ tp->flag &= ~ISSET;
}
}
@@ -1103,9 +1103,10 @@ search_access(path, mode, errnop)
ret = eaccess(path, mode);
if (ret < 0)
err = errno; /* File exists, but we can't access it */
- else if (mode == X_OK && (!S_ISREG(statb.st_mode)
- /* This 'cause access() says root can execute everything */
- || !(statb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))))
+ else if (mode == X_OK
+ && (!S_ISREG(statb.st_mode)
+ /* This 'cause access() says root can execute everything */
+ || !(statb.st_mode & (S_IXUSR|S_IXGRP|S_IXOTH))))
{
ret = -1;
err = S_ISDIR(statb.st_mode) ? EISDIR : EACCES;