Commit 631c07d4 by David Ward Committed by Daniel Lezcano

lxc-attach: use execvp instead of execve

execvp does not require specifying the full path to the executable (e.g., "ls" instead of "/bin/ls"), making the operation of 'lxc-attach' consistent with 'lxc-start' and 'lxc-execute'. Signed-off-by: 's avatarDavid Ward <david.ward@ll.mit.edu> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 910bb4fa
......@@ -89,7 +89,7 @@ Options :\n\
.checker = NULL,
};
int main(int argc, char *argv[], char *envp[])
int main(int argc, char *argv[])
{
int ret;
pid_t pid, init_pid;
......@@ -212,7 +212,7 @@ int main(int argc, char *argv[], char *envp[])
lxc_sync_fini(handler);
if (my_args.argc) {
execve(my_args.argv[0], my_args.argv, envp);
execvp(my_args.argv[0], my_args.argv);
SYSERROR("failed to exec '%s'", my_args.argv[0]);
return -1;
}
......@@ -232,7 +232,7 @@ int main(int argc, char *argv[], char *envp[])
NULL,
};
execve(args[0], args, envp);
execvp(args[0], args);
SYSERROR("failed to exec '%s'", args[0]);
return -1;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment