Sending folders from the root of a drive always goes to the same path on the receiver's end
Describe the bug
When trying to send a folder located in the root of a drive (eg. D:\test) it'll try to go to the same path on the receiver's end (ie. D:\test) regardless of where CMD current directory is when croc is ran. If that drive letter doesn't exist in the receiving computer, the transfer just errors with an mkdir error. Using --out doesn't seem to have any effect. Regular files don't cause this, nor do subfolders (for example sending D:\test\subfolder works fine).
To Reproduce
Steps to reproduce the behavior:
- Try to send a folder from the root of a drive (eg. D:\test)
- Accept the folder in a desired location.
- It'll be downloaded to the same drive and location as the sending computer, or error if it doesn't exist.
Expected behaviour
The folder should be downloaded to the same directory as CMD was mounted when running croc.
Version
croc version v9.6.4-1fce28e
Additional context
I recorded a video of the behavior using a VM while testing with the host (at the time I hadn't figured out it was related to being in the root of a drive, but I had suspected different drives had something to do with it.
https://github.com/schollz/croc/assets/5883538/6ccd9a63-516a-485a-b388-d89bb6daa90b
Thanks for the report, will take a PR for this
Stale issue message
@schollz This bug is still present and is a security issue (the sender can effectively pick and write to any folder that exists on the machine of the receiver, and the receiver has no control over this, since --out from the receiver's end is completely ignored in this situation).
Another related issue: --out "C:/" seems to work, but --out "C:" doesn't.
It's been a year and @Delphox made no prs. Will you @vieuxtemps ?