diff options
author | bmilekic <bmilekic@FreeBSD.org> | 2003-07-04 19:14:27 +0000 |
---|---|---|
committer | bmilekic <bmilekic@FreeBSD.org> | 2003-07-04 19:14:27 +0000 |
commit | 621fb8bd8b186d74314fb6fe1bbb1b00d58aae6f (patch) | |
tree | ad739891150e48020eec28200897be1648546d3d /usr.sbin/jexec/jexec.c | |
parent | 1b9c1552b4a154f6ce14d85f2a2bd0e967f92e4c (diff) | |
download | FreeBSD-src-621fb8bd8b186d74314fb6fe1bbb1b00d58aae6f.zip FreeBSD-src-621fb8bd8b186d74314fb6fe1bbb1b00d58aae6f.tar.gz |
Make jexec duplicate the actions of the shell searching for an
executable file even if the specified action/filename does not
contain a '/' character; convert execv() to execvp().
Submitted by: Christian S.J. Peron <maneo@bsdpro.com>
PR: bin/54109
Diffstat (limited to 'usr.sbin/jexec/jexec.c')
-rw-r--r-- | usr.sbin/jexec/jexec.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/jexec/jexec.c b/usr.sbin/jexec/jexec.c index 90f117e..089a896 100644 --- a/usr.sbin/jexec/jexec.c +++ b/usr.sbin/jexec/jexec.c @@ -48,8 +48,8 @@ main(int argc, char *argv[]) err(1, "jail_attach(): %d", jid); if (chdir("/") == -1) err(1, "chdir(): /"); - if (execv(argv[2], argv + 2) == -1) - err(1, "execv(): %s", argv[2]); + if (execvp(argv[2], argv + 2) == -1) + err(1, "execvp(): %s", argv[2]); exit(0); } |