Bug#708419: openssh-client: ssh-copy-id leads to rm -f * (local vs. dash)
Package: openssh-client
Version: 1:6.2p1-1
Severity: serious
Tags: upstream
Justification: leads to data loss
Hi,
ssh-copy-id uses "local" while pretending to be POSIX compliant (/bin/sh
as a shebang). Unfortunately, lack of error handling meands that this
isn't caught:
local L_TMP_ID_FILE=$(mktemp ~/.ssh/ssh-copy-id_id.XXXXXXXXXX)
trap "rm -f $L_TMP_ID_FILE*" EXIT TERM INT QUIT
mktemp succeeds but dash doesn't like local:
| $ dash
| $ local foo=bar
| dash: 1: local: not in a function
| $ echo $foo
|
| $
Which leads to:
rm -f *
=> Nasty!
Traced back to 1:6.2p1-1 due to:
- Update ssh-copy-id to Phil Hands' greatly revised version
(closes: #99785, #322228, #620428; LP: #518883, #835901, #1074798).
(Tagging "upstream" as it's also mention in upstream's ChangeLog.)
debdiffing both 6.1p1-4 and 1:6.2p1-1 confirms that the regression
was introduced in the latter (there was no "local" before).
Mraw,
KiBi.
Reply to: