summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--contrib/ssh-copy-id9
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 69221ad96..2bd3e3351 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
120130516
2 - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be
3 executed if mktemp failed; bz#2105 ok dtucker@
4
120130510 520130510
2 - (djm) OpenBSD CVS Cherrypick 6 - (djm) OpenBSD CVS Cherrypick
3 - djm@cvs.openbsd.org 2013/04/11 02:27:50 7 - djm@cvs.openbsd.org 2013/04/11 02:27:50
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
index af18a1929..9f2817b6b 100644
--- a/contrib/ssh-copy-id
+++ b/contrib/ssh-copy-id
@@ -165,6 +165,9 @@ done
165 165
166eval set -- "$SAVEARGS" 166eval set -- "$SAVEARGS"
167 167
168if [ $# == 0 ] ; then
169 usage
170fi
168if [ $# != 1 ] ; then 171if [ $# != 1 ] ; then
169 printf '%s: ERROR: Too many arguments. Expecting a target hostname, got: %s\n\n' "$0" "$SAVEARGS" >&2 172 printf '%s: ERROR: Too many arguments. Expecting a target hostname, got: %s\n\n' "$0" "$SAVEARGS" >&2
170 usage 173 usage
@@ -196,7 +199,11 @@ populate_new_ids() {
196 199
197 umask 0177 200 umask 0177
198 local L_TMP_ID_FILE=$(mktemp ~/.ssh/ssh-copy-id_id.XXXXXXXXXX) 201 local L_TMP_ID_FILE=$(mktemp ~/.ssh/ssh-copy-id_id.XXXXXXXXXX)
199 trap "rm -f $L_TMP_ID_FILE*" EXIT TERM INT QUIT 202 if test $? -ne 0 || test "x$L_TMP_ID_FILE" = "x" ; then
203 echo "mktemp failed" 1>&2
204 exit 1
205 fi
206 trap "rm -f $L_TMP_ID_FILE ${L_TMP_ID_FILE}.pub" EXIT TERM INT QUIT
200 printf '%s: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n' "$0" >&2 207 printf '%s: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n' "$0" >&2
201 NEW_IDS=$( 208 NEW_IDS=$(
202 eval $GET_ID | { 209 eval $GET_ID | {