image scp: preserve usernames containing an "@"#28897
Conversation
|
[NON-BLOCKING] Packit jobs failed. @containers/packit-build please check. Everyone else, feel free to ignore. |
danishprakash
left a comment
There was a problem hiding this comment.
Overall LGTM, but can you squash your commits into one and sign it?
d2bd334 to
6c69383
Compare
|
check now |
Honny1
left a comment
There was a problem hiding this comment.
I did a fast check, and it seems good. Can you please add an integration test?
6c69383 to
c1a1ffb
Compare
|
Added the integration test as well 👍 |
|
OP from the original issue here, I'd just like to say thanks a lot for implementing this ❤️ |
|
@runiq thanks to you to for helping me find my first issue for contributation 🙇🏼 |
|
LGTM |
Honny1
left a comment
There was a problem hiding this comment.
Overall LGTM. I have a maybe dumb question about an edge case.
Signed-off-by: ROKUMATE <rohitkumawat0110@gmail.com>
c1a1ffb to
b900382
Compare
|
/packit retest-failed |
|
i dont think packit ci failing was cause of mine commit ? ... if yes do tell i will just check myself as |
|
Packit is flaky, and also sometimes our CI is flaky too. So I rerun tests. You can check the RAW logs and check failure if it is not related to your change, you can ask in the comments for a rerun. |
|
will keep in mind next times |
Problem
podman image scpparses theuser@localhost::imageargument by cutting on thefirst
@. When the username itself contains an@— e.g. an Active Directoryaccount like
user@domain— it gets truncated to justuser:Impact
Users on AD-joined (or any
user@domain) machines can't usepodman image scpto copy images between users — the local user lookup fails before the transfer
even starts.
Fix
In
ParseImageSCPArg, the@localhost::case only ever matches that exactseparator, so split the argument on
@localhost::instead of the bare@. Thiskeeps the full username (including any
@domain) and leaves the remoteuser@host::SSH path unchanged.Test
Added
TestParseImageSCPArginpkg/domain/utils/scp_test.gocovering both theplain
userand theuser@domaincases.go test ./pkg/domain/utils/passes.Fixes: #27655