Before:
sudo lxc-attach -n test /etc/passwd ; echo $?
lxc-attach: test: ../src/lxc/attach.c: lxc_attach_run_command: 1841 Permission denied - Failed to exec "/etc/passwd"
255
After:
sudo lxc-attach -n test /etc/passwd ; echo $?
lxc-attach: test: ../src/lxc/attach.c: lxc_attach_run_command: 1841 Permission denied - Failed to exec "/etc/passwd"
126
Which better aligns with bash:
/etc/passwd; echo $?
bash: /etc/passwd: Permission denied
126
Signed-off-by: Thomas Parrott <thomas.parrott@canonical.com>
ret = execvp(cmd->program, cmd->argv);
if (ret < 0) {
switch (errno) {
+ case EACCES:
case ENOEXEC:
ret = 126;
break;