croc icon indicating copy to clipboard operation
croc copied to clipboard

Symlink target is created automatically _sometimes_

Open tdussa opened this issue 3 years ago • 0 comments

With the current version of croc, in some instances, when a symlink is transferred, its target is created (as an empty file). Specifically, the first (and as far as I can tell, only the first) file that is transfered during a particular session shows this problem. I haven't been able to pinpoint the problem yet.

Example:

On the sending side, create a file with some generic content (a) and a symlink to it (b), then send it:

~/croctest/send $ echo A > a; ln -s a b; ls -l; croc send b
total 4
-rw-rw-r-- 1 tdussa tdussa 2 Apr 16 08:21 a
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:21 b -> a
Sending 'b' (1 B)
Code is: silicon-east-genesis
On the other computer run

croc silicon-east-genesis

An the receiving side, just receive:

~/croctest/receive $ croc silicon-east-genesis
Accept 'b' (1 B)? (y/n) y

Receiving (<-[::1]:56476)
 100% |████████████████████| ( 0/ 1B, )        
tdussa@aigis ~/croctest/receive $ ls -l
total 0
-rw-rw-r-- 1 tdussa tdussa 1 Apr 16 08:23 a
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:23 b -> a
~/croctest/receive $ cat a
~/croctest/receive $ 

Even though just the symlink has been transferred, the symlink target has also been created (but is empty). This happens only for the first file transfered:

~/croctest/send $ echo A > a; ln -s a b; echo C > c; ln -s c d; ls -l; croc send b d
total 8
-rw-rw-r-- 1 tdussa tdussa 2 Apr 16 08:25 a
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:25 b -> a
-rw-rw-r-- 1 tdussa tdussa 2 Apr 16 08:25 c
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:25 d -> c
Sending 2 files (2 B)
Code is: madonna-blue-stock
On the other computer run

croc madonna-blue-stock

This only creates a, but not c:

~/croctest/receive $ ls -l; croc madonna-blue-stock
total 0
Accept 2 files (2 B)? (y/n) y

Receiving (<-[::1]:56662)
b 100% |████████████████████| ( 0/ 1B, ) 1/2    
d 100% |████████████████████| ( 0/ 1B, ) 2/2    
tdussa@aigis ~/croctest/receive $ ls -l
total 0
-rw-rw-r-- 1 tdussa tdussa 1 Apr 16 08:26 a
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:26 b -> a
lrwxrwxrwx 1 tdussa tdussa 1 Apr 16 08:26 d -> c
~/croctest/receive $ 

tdussa avatar Apr 16 '21 06:04 tdussa