From 6aa3eacc5e5f39702b6dd5b27970d9fd97bc2383 Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 16 May 2013 11:10:17 +1000 Subject: - (djm) [contrib/ssh-copy-id] Fix bug that could cause "rm *" to be executed if mktemp failed; bz#2105 ok dtucker@ --- contrib/ssh-copy-id | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'contrib/ssh-copy-id') 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 eval set -- "$SAVEARGS" +if [ $# == 0 ] ; then + usage +fi if [ $# != 1 ] ; then printf '%s: ERROR: Too many arguments. Expecting a target hostname, got: %s\n\n' "$0" "$SAVEARGS" >&2 usage @@ -196,7 +199,11 @@ populate_new_ids() { umask 0177 local L_TMP_ID_FILE=$(mktemp ~/.ssh/ssh-copy-id_id.XXXXXXXXXX) - trap "rm -f $L_TMP_ID_FILE*" EXIT TERM INT QUIT + if test $? -ne 0 || test "x$L_TMP_ID_FILE" = "x" ; then + echo "mktemp failed" 1>&2 + exit 1 + fi + trap "rm -f $L_TMP_ID_FILE ${L_TMP_ID_FILE}.pub" EXIT TERM INT QUIT printf '%s: INFO: attempting to log in with the new key(s), to filter out any that are already installed\n' "$0" >&2 NEW_IDS=$( eval $GET_ID | { -- cgit v1.2.3 From b4e00949f01176cd4fae3e0cef5ffa8dea379042 Mon Sep 17 00:00:00 2001 From: Darren Tucker Date: Wed, 5 Jun 2013 22:48:44 +1000 Subject: - (dtucker) [contrib/ssh-copy-id] bz#2117: Use portable operator in test. Patch from cjwatson at debian. --- ChangeLog | 6 ++++-- contrib/ssh-copy-id | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'contrib/ssh-copy-id') diff --git a/ChangeLog b/ChangeLog index ad5b66a78..00c74c3e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 20130605 - - (dtucker) Enable sha256 kex methods based on the presence of the necessary - functions, not from the openssl version. + - (dtucker) [myproposal.h] Enable sha256 kex methods based on the presence of + the necessary functions, not from the openssl version. + - (dtucker) [contrib/ssh-copy-id] bz#2117: Use portable operator in test. + Patch from cjwatson at debian. 20130602 - (tim) [Makefile.in] Make Solaris, UnixWare, & OpenServer linkers happy diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id index 9f2817b6b..ae88e9958 100644 --- a/contrib/ssh-copy-id +++ b/contrib/ssh-copy-id @@ -165,7 +165,7 @@ done eval set -- "$SAVEARGS" -if [ $# == 0 ] ; then +if [ $# = 0 ] ; then usage fi if [ $# != 1 ] ; then -- cgit v1.2.3