-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Emit error when binary file not executable #1769
Comments
we'd need to duplicate the code from Would it help if we improve the error message, something like: diff --git a/pkg/config/config.go b/pkg/config/config.go
index 2e352db4..318015f1 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -1146,9 +1146,13 @@ func (c *Config) FindHelperBinary(name string, searchPATH bool) (string, error)
}
}
if searchPATH {
- return exec.LookPath(name)
+ p, err := exec.LookPath(name)
+ if errors.Is(err, exec.ErrNotFound) {
+ return "", fmt.Errorf("could not find %q in $PATH (the file might be present but not executable): %w", name, err)
+ }
+ return p, err
}
- configHint := "To resolve this error, set the helper_binaries_dir key in the `[engine]` section of containers.conf to the directory containing your helper binaries."
+ configHint := "To resolve this error, set the helper_binaries_dir key in the `[engine]` section of containers.conf to the directory containing your helper binaries and make sure the file has the executable bit set."
if len(c.Engine.HelperBinariesDir.Get()) == 0 {
return "", fmt.Errorf("could not find %q because there are no helper binary directories configured. %s", name, configHint)
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
the
FindBinaryHelper
should emit an error if it finds the binary but it is not exectable instead of claiming it could not find it.https://github.com/containers/common/blob/main/pkg/config/config.go#L1110
The text was updated successfully, but these errors were encountered: