-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Fail to remove volume with semi-colliding names #26168
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
Comments
Oh my, looks like our SQL db queries are not safe
Therefore the db returns two return values when asking for |
Oh and it is even worse as LIKE is not case sensitive either by default, a volume name |
Marking as bug week and self-assigning |
A simple fix, would be go through the results when more then one returned and only return exact match, or just use a different call into database. |
Or escaping the characters Edit: it won't work for the case-insensitive issue, but I would expect that vol names should probably be case-insensitive |
Specifically, this does two things: 1. Turn on case-sensitive LIKE queries. Technically, this is not specific to volumes, as it will also affect container and pod lookups - but there, it only affects IDs. So `podman rm abc123` will not be the same as `podman rm ABC123` but I don't think anyone was manually entering uppercase SHA256 hash IDs so it shouldn't matter. 2. Escape the _ and % characters in volume lookup queries. These are SQLite wildcards, and meant that `podman volume rm test_1` would also match `podman volume rm testa2` (or any character in place of the underscore). This isn't done with pod and container lookups, but again those just use LIKE for IDs - so technically `podman volume rm abc_123` probably works and removes containers with an ID matching that pattern... I don't think that matters though. Fixes containers#26168 Signed-off-by: Matthew Heon <matthew.heon@pm.me>
Issue Description
If you happen to have two volume names that have almost the same name, but separated by commas and underlines respectively, removing the one with underlines will fail.
Steps to reproduce the issue
Steps to reproduce the issue
podman volume create test-test
podman volume create test_test
podman volume rm test_test
Describe the results you received
It errors with the message:
Describe the results you expected
It should simply output the volume name instead. Now if you try and remove the
test-test
first, it will work.I haven't tested many operations with this behavior yet, but I'm assuming there are other flows that probably behave equally when facing collision in container names.
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
Yes
Additional environment details
N/A
Additional information
N/A
The text was updated successfully, but these errors were encountered: