| Summary: | SFTP Assumes quiet in batch mode - This regression breaks integration | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Matthew Parslow <matt> | ||||||
| Component: | sftp | Assignee: | Damien Miller <djm> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | normal | CC: | djm, dtucker | ||||||
| Priority: | P5 | ||||||||
| Version: | 8.2p1 | ||||||||
| Hardware: | Other | ||||||||
| OS: | Linux | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 3117 | ||||||||
| Attachments: |
|
||||||||
|
Description
Matthew Parslow
2020-03-13 10:21:50 AEDT
I don't understand what you're referring to. sftp does produce output by default in batch mode: $ cat > /tmp/b cd /bin get ls /tmp get xxls /tmp $ sftp -b /tmp/b localhost sftp> cd /bin sftp> get ls /tmp sftp> get xxls /tmp File "/bin/xxls" not found. It does have some output, but it's in quiet mode. https://github.com/openssh/openssh-portable/commit/9303e6527bb5ca7630c765f28624702c212bfd6c?fbclid=IwAR3KCDxObbHrEBsHNUrHDxFfv4FT6wULg2udwPq6ZhPZvHkbwYdA2qbwnYI#diff-bfa9ee6de996100a65619653d189809fR2195 shows where it sets quiet mode. example: $ ls -lrt total 0 $ cat /tmp/test/commands ls /tmp/test/ get /tmp/test/* $ sftp -b /tmp/test/commands testhost sftp> ls /tmp/test /tmp/test/1file /tmp/test/2dir /tmp/test/3file sftp> get /tmp/test/* Cannot download non-regular file: /tmp/test/2dir/ $ ls 1file 3file Compare to: matt@ludev:/tmp/dest$ sftp testhost < /tmp/test/commands Connected to testhost. sftp> ls /tmp/test/ /tmp/test/1file /tmp/test/2dir /tmp/test/3file sftp> get /tmp/test/* Fetching /tmp/test/1file to 1file Fetching /tmp/test/2dir/ to 2dir Cannot download non-regular file: /tmp/test/2dir/ Fetching /tmp/test/3file to 3file Created attachment 3363 [details]
Add -N flag to override quiet mode
Ah, I changed that because a few people thought the verbose output was too noisy for scripted use.
Anyway, this patch adds a -N flag ("noisy") that clears quiet mode:
[djm@djm openssh]$ ./sftp -Nb /tmp/b localhost
Connected to fuyu.
sftp> cd /bin
sftp> get ls /tmp
Fetching /bin/ls to /tmp/ls
sftp> get xxls /tmp
File "/bin/xxls" not found.
Created attachment 3364 [details]
correct patch
oops, wrong patch. This one does it correctly.
this has been committed and will be in openssh-8.3 - thanks close bugs that were resolved in OpenSSH 8.5 release cycle |