bugzilla-daemon at bugzilla.mindrot.org
2017-Dec-08 03:12 UTC
[Bug 2809] New: SCP gives very confusing / wrong error message when -p is used incorrectly
https://bugzilla.mindrot.org/show_bug.cgi?id=2809
Bug ID: 2809
Summary: SCP gives very confusing / wrong error message when -p
is used incorrectly
Product: Portable OpenSSH
Version: 7.5p1
Hardware: Other
OS: Linux
Status: NEW
Severity: normal
Priority: P5
Component: scp
Assignee: unassigned-bugs at mindrot.org
Reporter: mail at nh2.me
When the user assumes `-p` does the same for scp as it does for ssh,
funny things happen:
touch myfile
scp -p 22 myfile targetmachine:targetfile
The above prints "scp: targetfile: No such file or directory", which,
while true (there is no file called "targetfile" on the host -- the
users intent was to put it there), is a very confusing error message.
The problem here is that `-p` doesn't accept an argument for scp as it
does for ssh, and so "22" is treated as a file name. It is the file
"22" that doesn't exist.
Let's
touch ~/targetfile
on `targetmachine`. What happens then?
$ scp -p 22 myfile zh.nh2.me:targetfile
scp: targetfile: Not a directory
Certainly true, targetfile is not a directory. Nevertheless, not quite
the error message the user would hope for.
What if we make `targetfile` a directory then (`rm ~/targetfile &&
mkdir targetdir` on targethost)?
$ scp -p 22 myfile zh.nh2.me:targetdir
22: No such file or directory
myfile 100% 0 0.0KB/s 00:00
Finally an error message that points out what the user did wrong.
Would it be possible to improve scp's error messages, such that for
this very common error of using `-p` incorrectly, the earlier examples
point out more helpfully to the user that "22" doesn't exist?
Thanks!
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Dec-08 18:32 UTC
[Bug 2809] SCP gives very confusing / wrong error message when -p is used incorrectly
https://bugzilla.mindrot.org/show_bug.cgi?id=2809
Niklas Hambuechen <mail at nh2.me> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mail at nh2.me
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2017-Dec-08 20:50 UTC
[Bug 2809] SCP gives very confusing / wrong error message when -p is used incorrectly
https://bugzilla.mindrot.org/show_bug.cgi?id=2809
Kevin Cox <kevincox at kevincox.ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kevincox at kevincox.ca
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Jan-05 02:51 UTC
[Bug 2809] SCP gives very confusing / wrong error message when -p is used incorrectly
https://bugzilla.mindrot.org/show_bug.cgi?id=2809
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WONTFIX
CC| |djm at mindrot.org
Status|NEW |RESOLVED
--- Comment #1 from Damien Miller <djm at mindrot.org> ---
It isn't possible to fix this generally without completely rewriting
getopt() and we aren't prepared to do that, sorry.
--
You are receiving this mail because:
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.
bugzilla-daemon at bugzilla.mindrot.org
2018-Apr-06 02:26 UTC
[Bug 2809] SCP gives very confusing / wrong error message when -p is used incorrectly
https://bugzilla.mindrot.org/show_bug.cgi?id=2809
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #2 from Damien Miller <djm at mindrot.org> ---
Close all resolved bugs after release of OpenSSH 7.7.
--
You are receiving this mail because:
You are watching someone on the CC list of the bug.
You are watching the assignee of the bug.