-
-
Notifications
You must be signed in to change notification settings - Fork 278
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
File push with ..-ending src behaves unexpectedly #1808
Milestone
Comments
stgraber
added a commit
to stgraber/incus
that referenced
this issue
Mar 18, 2025
Not too sure why we were using Split rather than Dir given we were discarding the Base part of the path. But it looks like Split gets a bit confused by relative parent paths (..) whereas Dir doesn't. Closes lxc#1808 Signed-off-by: Stéphane Graber <[email protected]>
stgraber
added a commit
to stgraber/incus
that referenced
this issue
Mar 18, 2025
When going through either .Split() or .Base(), a source path of ".." is incorrectly treated as an empty source directory and so processed the same as ".". This is obviously incorect behavior which then leads to files landing in the wrong directory on the server side. I couldn't find a good way with pure filepath calls to handle this, so instead we've got to hardcode the logic for the parent paths. Any path containing a separator (/) are handled correctly though. Closes lxc#1808 Signed-off-by: Stéphane Graber <[email protected]>
stgraber
added a commit
to stgraber/incus
that referenced
this issue
Mar 18, 2025
When going through either .Split() or .Base(), a source path of ".." is incorrectly treated as an empty source directory and so processed the same as ".". This is obviously incorect behavior which then leads to files landing in the wrong directory on the server side. I couldn't find a good way with pure filepath calls to handle this, so instead we've got to hardcode the logic for the parent paths. Any path containing a separator (/) are handled correctly though. Closes lxc#1808 Signed-off-by: Stéphane Graber <[email protected]>
stgraber
added a commit
that referenced
this issue
Mar 28, 2025
When going through either .Split() or .Base(), a source path of ".." is incorrectly treated as an empty source directory and so processed the same as ".". This is obviously incorect behavior which then leads to files landing in the wrong directory on the server side. I couldn't find a good way with pure filepath calls to handle this, so instead we've got to hardcode the logic for the parent paths. Any path containing a separator (/) are handled correctly though. Closes #1808 Signed-off-by: Stéphane Graber <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Required information
Issue description
Pushing a directory ending in
..
does not behave as I would expect it to. I would expect the following to move the parent directory inside the/opt/target
directory but it insteads copies it to the/opt
directory.Steps to reproduce
Although not equivalent, in
u2
, I believedir
should be insidetarget
but it is instead at/opt/dir
.I am not certain if this will be considered a bug or not but since I hit it and had to fiddle a bit to find the issue, I figured I'd let our benevolent dictators decide. ;)
Thanks.
PS: The issue template is not working anymore, github did you dirty.
The text was updated successfully, but these errors were encountered: