Re: scp/sftp -R broken?
On Tue, 6 Jun 2023, Michael van Elst wrote: When I try to recursively copy a directory with "scp -r" or sftp's "put -Rp" between a -current and a NetBSD 9, I see: # scp -r a netbsd-9: scp: realpath ./a: No such file scp: upload "./a": path canonicalization failed scp: failed to upload directory a to . That was a known issue with sftp when the target directory (in this case that's netbsd-9:./a) does not exist and the OpenSSH 9 server apparently has fixed it. Yup, this is realpath() failing on a non-existent directory. In the old sftp-server server (see process_realpath() in src/crypto/external/bsd/openssh/dist/sftp-server.c), realpath() is called directly, and this will fail when there are non-existent components in the path to be resolved. In the new sftp-server, a wrapper function `sftp_realpath()' which allows the _last_ component to not exist is used instead (just like what realpath(1) in 10.x does). If you want to patch this, you can bring in the new sftp-realpath.c file and call sftp_realpath() instead of the bare realpath(). -RVP
Re: scp/sftp -R broken?
w...@netbsd.org (Thomas Klausner) writes: >Hi! >When I try to recursively copy a directory with "scp -r" or sftp's >"put -Rp" between a -current and a NetBSD 9, I see: ># scp -r a netbsd-9: >scp: realpath ./a: No such file >scp: upload "./a": path canonicalization failed >scp: failed to upload directory a to . That was a known issue with sftp when the target directory (in this case that's netbsd-9:./a) does not exist and the OpenSSH 9 server apparently has fixed it. I doubt that anyone fixes OpenSSH 8, so using -O for the scp protocol fallback is the only thing you can do.
Re: scp/sftp -R broken?
Hi Thomas, On 06.06.23 00:40, Thomas Klausner wrote: Hi! When I try to recursively copy a directory with "scp -r" or sftp's "put -Rp" between a -current and a NetBSD 9, I see: # scp -r a netbsd-9: scp: realpath ./a: No such file scp: upload "./a": path canonicalization failed scp: failed to upload directory a to . # ssh -V OpenSSH_9.1 NetBSD_Secure_Shell-20221004-hpn13v14-lpk, OpenSSL 3.0.8 7 Feb 2023 netbsd-9# ssh -V OpenSSH_8.0 NetBSD_Secure_Shell-20220604-hpn13v14-lpk, OpenSSL 1.1.1k 25 Mar 2021 scp of single files works. The same command works if I copy it onto the same machine (and thus same ssh on the other side), both current -> current and netbsd9 -> netbsd9. Any ideas why this doesn't work, and what the error message wants to tell me?? I'm sorry, I've forgotten the specifics, but I've encountered the problem before as well. I was able to solve it using the -O option. In the scp man page, it's mentioned that this option switches to the legacy SCP protocol if the server doesn't support SFTP. So it seems like more of a workaround, but maybe it will help you? Does anyone have more details on this? Kind regards Matthias smime.p7s Description: S/MIME Cryptographic Signature
scp/sftp -R broken?
Hi! When I try to recursively copy a directory with "scp -r" or sftp's "put -Rp" between a -current and a NetBSD 9, I see: # scp -r a netbsd-9: scp: realpath ./a: No such file scp: upload "./a": path canonicalization failed scp: failed to upload directory a to . # ssh -V OpenSSH_9.1 NetBSD_Secure_Shell-20221004-hpn13v14-lpk, OpenSSL 3.0.8 7 Feb 2023 netbsd-9# ssh -V OpenSSH_8.0 NetBSD_Secure_Shell-20220604-hpn13v14-lpk, OpenSSL 1.1.1k 25 Mar 2021 scp of single files works. The same command works if I copy it onto the same machine (and thus same ssh on the other side), both current -> current and netbsd9 -> netbsd9. Any ideas why this doesn't work, and what the error message wants to tell me?? Thomas