| Summary: | In batch mode sftp echoes the prompt and the commands back | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Portable OpenSSH | Reporter: | Enzo <vincenzo.romano> | ||||||
| Component: | sftp | Assignee: | Damien Miller <djm> | ||||||
| Status: | CLOSED FIXED | ||||||||
| Severity: | enhancement | CC: | ahmedsayeed1982, djm, dtucker | ||||||
| Priority: | P5 | ||||||||
| Version: | 7.7p1 | ||||||||
| Hardware: | amd64 | ||||||||
| OS: | Linux | ||||||||
| Bug Depends on: | |||||||||
| Bug Blocks: | 2915 | ||||||||
| Attachments: |
|
||||||||
|
Description
Enzo
2018-11-04 03:48:52 AEDT
Created attachment 3199 [details]
allow '@' prefix to suppress command echo
The prefix is a good idea. This implements '@command' to suppress echo.
Comment on attachment 3199 [details] allow '@' prefix to suppress command echo >+ if (!interactive && *cmd != '@') { > mprintf("sftp> %s", cmd); You're only checking the first character but the man page says - and @ can be supplied in any order, so -@ is not going to do what the man page says. Created attachment 3200 [details]
Allow @ and - to appear in any order
Darren points out that, despite what I advertised in the manpage, my previous patch did not allow '-' and '@' to appear in any order. This fixes this by moving the echo until after the entire command has been parsed.
Patch is committed and will be in OpenSSH 8.0 At the section "Lines 1282-1294 parse_args(const char **cpp, int *ignore_errors, int *aflag," I see a possible bug.
You can intercept the "-" and the "@" at any place in the command string.
Which can lead to unwanted results.
IMHO the correct code could begin with something like:
for (char* cpend=cp+2;*cp != '\0' && cp < cpend; cp++) {
closing resolved bugs as of 8.6p1 release [spam removed] |