Skip to content

Commit

Permalink
daemon: handle EISDIR error from runtime
Browse files Browse the repository at this point in the history
Go 1.20 made a change to the behaviour of package "os/exec" which was
not mentioned in the release notes:
golang/go@2b8f214
Attempts to execute a directory now return syscall.EISDIR instead of
syscall.EACCESS. Check for EISDIR errors from the runtime and set the
exit code appropriately.

Signed-off-by: Cory Snider <csnider@mirantis.com>
  • Loading branch information
corhere committed Feb 3, 2023
1 parent f32bf64 commit 6f4839a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func setExitCodeFromError(setExitCode func(exitStatus), err error) error {
}

// set to 126 for container cmd can't be invoked errors
if contains(errDesc, syscall.EACCES.Error()) {
if contains(errDesc, syscall.EACCES.Error()) || contains(errDesc, syscall.EISDIR.Error()) {
setExitCode(exitEaccess)
return startInvalidConfigError(errDesc)
}
Expand Down

0 comments on commit 6f4839a

Please sign in to comment.