rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone

Blame SOURCES/openssh-6.6p1-fix-ssh-copy-id-on-non-sh-shell.patch

674526
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
674526
index 8e1091c..4bba5d6 100644
674526
--- a/contrib/ssh-copy-id
674526
+++ b/contrib/ssh-copy-id
674526
@@ -274,9 +274,7 @@ case "$REMOTE_VERSION" in
674526
       populate_new_ids 0
674526
     fi
674526
     [ "$DRY_RUN" ] || printf '%s\n' "$NEW_IDS" | ssh "$@" "
674526
-		umask 077 ;
674526
+		exec sh -c 'umask 077; mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1; if type restorecon >/dev/null 2>&1; then restorecon -F .ssh .ssh/authorized_keys; fi'" \
674526
-		mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ;
674526
-		if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi" \
674526
       || exit 1
674526
     ADDED=$(printf '%s\n' "$NEW_IDS" | wc -l)
674526
     ;;