-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
podman create with non-existing --authfile should error on pull #18938
Comments
Which revealed that absent --authfile's are ignored but shouldn't. The issue is now being tracked in containers#18938. Signed-off-by: Valentin Rothberg <[email protected]>
Ah, OK. That is actually expected behavior in c/image. Authfiles are not expected to exist: I am personally OK with this behavior but desire consistency across commands. As shown above, @Luap99 WDYT? |
That is pretty much the same discussion as in #18413. If c/image silently ignores a non existing path then I agree we should error out in podman. However I still believe the correct thing is to only error out at the place were the file is actually used, otherwise we will always face TOCTOU bugs, but if c/image never does that then it is unavoidable I guess. And I really do not get why c/image would behave in such a way, AFAICT it does so since the beginning: containers/image@f28367e1a Fixing this in the podman cli seems wrong as it duplicates the checks for each individual command. And then how does this compare to skopeo, buildah and cri-o? Do they also make sure to check for that?! cc @mtrmac |
I quite agree that a library, when explicitly instructed to read a path, should fail if that path is missing. (Especially now that setting OTOH when the user does not make any such explicit instruction, and the library is reading the default location, silently ignoring a missing file is very often the right thing to do — consider a fresh user account running an anonymous Where this gets difficult is that Podman, and other callers, like to set the c/image options without user input, e.g. podman/cmd/podman/images/pull.go Line 108 in 3907df6
So failing if c/image sees (Not centralizing the defaults deep in c/image leads to such things. OTOH c/image would prefer to not silently depend on environment variables, so a reasonably clean solution accommodating both, something like https://github.com/containers/image/blob/main/pkg/cli/environment/environment.go , is more work for both the caller and the callee.) |
I do not feel strongly unless we risk breaking existing workloads / users. Once we've settled on how we want things to behave, we can make sure --authfile works consistently across the various commands. |
Can we check if the caller is using a default value, if yes then don't complain on NOEXIST, else complain? |
We can’t tell by the value. We would need a new field in |
A friendly reminder that this issue had no activity for 30 days. |
I believe @vrothberg is working on this one. |
It's very low on my priority list so I unassigned to make space if others want to tackle it. |
Ok I think if the client specifies a path, then the path should be verified. |
Fixes: containers#18938 Signed-off-by: Daniel J Walsh <[email protected]>
podman create
seems to ignore (or not use?) the non-existing authfile whilepodman pull
fails immediately.Detected in #18931 (comment) where the test must be fixed as well.
The text was updated successfully, but these errors were encountered: