]>
git.proxmox.com Git - mirror_lxc.git/commit
lxc/attach: Detect EACCES from execvp and convert to 126 exit status
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>