Open meliot opened 6 years ago
Sorry for being late. I tried to reproduce the problem at https://github.com/hnakamur/go-scp/commit/298399d7b1929931529336272d9c28a8f3bc3f73, but I got a different error.
sink_test.go:224: fail to ReceiveDir; failed to read scp message header: err=scp: /tmp/go-scp-TestReceiveDir-remote868529785/dead-link: No such file or directory
Could you tell me how to reproduce your problem? The vresion of sshd, OS, and distribution might help. Or could you write the failing test?
Thanks!
As title said, ReceiveDir panic when I try to SCP a directory that contains link to files that no longer exists.
The code that perform the call is the following:
The error I get is:
2018/04/15 18:52:10 Unable to SCP directories: failed to read scp message header: err=failed to read scp start directory message header: err=newline in format does not match input
So I suppose the problem lies in this Fscanf: https://github.com/hnakamur/go-scp/blob/master/protocol.go#L213
I think the library should by default, or with a flag, ignore links to death files.