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
This commit is contained in:
parent
1b9c1552b4
commit
621fb8bd8b
@ -48,8 +48,8 @@ main(int argc, char *argv[])
|
|||||||
err(1, "jail_attach(): %d", jid);
|
err(1, "jail_attach(): %d", jid);
|
||||||
if (chdir("/") == -1)
|
if (chdir("/") == -1)
|
||||||
err(1, "chdir(): /");
|
err(1, "chdir(): /");
|
||||||
if (execv(argv[2], argv + 2) == -1)
|
if (execvp(argv[2], argv + 2) == -1)
|
||||||
err(1, "execv(): %s", argv[2]);
|
err(1, "execvp(): %s", argv[2]);
|
||||||
exit(0);
|
exit(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user