croc icon indicating copy to clipboard operation
croc copied to clipboard

Sending folders from the root of a drive always goes to the same path on the receiver's end

Open Delphox opened this issue 2 years ago • 2 comments

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:

  1. Try to send a folder from the root of a drive (eg. D:\test)
  2. Accept the folder in a desired location.
  3. 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

Delphox avatar May 26 '23 02:05 Delphox

Thanks for the report, will take a PR for this

schollz avatar Sep 20 '23 12:09 schollz

Stale issue message

github-actions[bot] avatar Feb 12 '24 12:02 github-actions[bot]

@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.

vieuxtemps avatar Jul 04 '24 11:07 vieuxtemps

It's been a year and @Delphox made no prs. Will you @vieuxtemps ?

schollz avatar Jul 04 '24 12:07 schollz