bugzilla-daemon at mindrot.org
2020-May-03 21:51 UTC
[Bug 3158] New: ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
https://bugzilla.mindrot.org/show_bug.cgi?id=3158
Bug ID: 3158
Summary: ssh-copy-id raises "expr: syntax error" when
double-hyphen is passed ("--")
Product: Portable OpenSSH
Version: 8.2p1
Hardware: All
OS: Linux
Status: NEW
Severity: minor
Priority: P5
Component: ssh-copy-id
Assignee: unassigned-bugs at mindrot.org
Reporter: rf at rufflewind.com
Assuming an identity file exists at ~/.ssh/id_rsa.pub, the following
command, which adds a preventative double-dash ("--"):
ssh-copy-id -i ~/.ssh/id_rsa.pub -- remote-server
will result in the following error:
expr: syntax error: unexpected argument ?[-]i?
The error is non-fatal, but it may be confusing to users.
I suspect this is caused by line 110:
[ "${SEEN_OPT_I}" ] && expr "$1" :
"[-]i" >/dev/null && {
Here, "$1" is passed to expr without being validated, so if $1 is
"--"
as shown in the command above, this will confuse expr. I think expr
should be called with "--" to prevent this:
[ "${SEEN_OPT_I}" ] && expr -- "$1" :
"[-]i" >/dev/null && {
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2020-Sep-17 06:25 UTC
[Bug 3158] ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
https://bugzilla.mindrot.org/show_bug.cgi?id=3158
Philip Hands <phil at hands.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |phil at hands.com
--- Comment #1 from Philip Hands <phil at hands.com> ---
ssh-copy-id has switched to using getopts for this, rather than the
previous hand-rolled option handling, so I beleive that once that
version is included in openssh this problem will be solved.
Perhaps you'd be so kind as to check that -- you can find the latest
version here:
https://gitlab.com/phil_hands/ssh-copy-id
Cheers, Phil.
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2020-Sep-20 00:17 UTC
[Bug 3158] ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
https://bugzilla.mindrot.org/show_bug.cgi?id=3158 --- Comment #2 from rf at rufflewind.com --- The issue appears to be fixe din the new ssh-copy-id. Thanks! -- You are receiving this mail because: You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2020-Sep-20 06:30 UTC
[Bug 3158] ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
https://bugzilla.mindrot.org/show_bug.cgi?id=3158
Philip Hands <phil at hands.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED
--
You are receiving this mail because:
You are watching the assignee of the bug.
bugzilla-daemon at mindrot.org
2021-Mar-03 22:52 UTC
[Bug 3158] ssh-copy-id raises "expr: syntax error" when double-hyphen is passed ("--")
https://bugzilla.mindrot.org/show_bug.cgi?id=3158
Damien Miller <djm at mindrot.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |CLOSED
--- Comment #3 from Damien Miller <djm at mindrot.org> ---
close bugs that were resolved in OpenSSH 8.5 release cycle
--
You are receiving this mail because:
You are watching the assignee of the bug.