[lxc/lxc] f7cada: lxc/attach: Detect EACCES from execvp and convert ...

0 views
Skip to first unread message

Christian Brauner

unread,
Oct 13, 2022, 11:23:24 AM10/13/22
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/master
Home: https://github.com/lxc/lxc
Commit: f7cadaa346a0233c00bbd60412c5f6148288d217
https://github.com/lxc/lxc/commit/f7cadaa346a0233c00bbd60412c5f6148288d217
Author: Thomas Parrott <thomas....@canonical.com>
Date: 2022-10-13 (Thu, 13 Oct 2022)

Changed paths:
M src/lxc/attach.c

Log Message:
-----------
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....@canonical.com>


Commit: d92710c29d44fbe748a2c06c80fd60057c06a62a
https://github.com/lxc/lxc/commit/d92710c29d44fbe748a2c06c80fd60057c06a62a
Author: Christian Brauner <christia...@ubuntu.com>
Date: 2022-10-13 (Thu, 13 Oct 2022)

Changed paths:
M src/lxc/attach.c

Log Message:
-----------
Merge pull request #4207 from tomponline/tp-attach-permission-denied

lxc/attach: Detect EACCES from execvp and convert to 126 exit status


Compare: https://github.com/lxc/lxc/compare/1ec37707ea8c...d92710c29d44
Reply all
Reply to author
Forward
0 new messages