vishalmishra434 / rpms / openssh

Forked from rpms/openssh a month ago
Clone
Jakub Jelen 8622e3
diff -up openssh-7.9p1/contrib/ssh-copy-id.ssh-copy-id openssh-7.9p1/contrib/ssh-copy-id
Jakub Jelen e8524a
--- openssh-7.9p1/contrib/ssh-copy-id.ssh-copy-id	2018-10-17 02:01:20.000000000 +0200
Jakub Jelen e8524a
+++ openssh-7.9p1/contrib/ssh-copy-id	2019-01-23 20:49:30.513393667 +0100
Jakub Jelen e8524a
@@ -112,7 +112,8 @@ do
Jakub Jelen e8524a
         usage
Jakub Jelen e8524a
   }
Jakub Jelen e8524a
 
Jakub Jelen e8524a
-  OPT= OPTARG=
Jakub Jelen e8524a
+  OPT=
Jakub Jelen e8524a
+  OPTARG=
Jakub Jelen e8524a
   # implement something like getopt to avoid Solaris pain
Jakub Jelen e8524a
   case "$1" in
Jakub Jelen e8524a
     -i?*|-o?*|-p?*)
Jakub Jelen e8524a
@@ -261,7 +262,7 @@ populate_new_ids() {
Jakub Jelen e8524a
   fi
Jakub Jelen e8524a
   if [ -z "$NEW_IDS" ] ; then
Jakub Jelen e8524a
     printf '\n%s: WARNING: All keys were skipped because they already exist on the remote system.\n' "$0" >&2
Jakub Jelen e8524a
-    printf '\t\t(if you think this is a mistake, you may want to use -f option)\n\n' "$0" >&2
Jakub Jelen e8524a
+    printf '\t\t(if you think this is a mistake, you may want to use -f option)\n\n' >&2
Jakub Jelen e8524a
     exit 0
Jakub Jelen e8524a
   fi
Jakub Jelen e8524a
   printf '%s: INFO: %d key(s) remain to be installed -- if you are prompted now it is to install the new keys\n' "$0" "$(printf '%s\n' "$NEW_IDS" | wc -l)" >&2
Jakub Jelen e8524a
@@ -296,7 +297,7 @@ case "$REMOTE_VERSION" in
Jakub Jelen 8622e3
     # in ssh below - to defend against quirky remote shells: use 'exec sh -c' to get POSIX;
Jakub Jelen 8622e3
     #     'cd' to be at $HOME; add a newline if it's missing; and all on one line, because tcsh.
Jakub Jelen 8622e3
     [ "$DRY_RUN" ] || printf '%s\n' "$NEW_IDS" | \
Jakub Jelen 8622e3
-      ssh "$@" "exec sh -c 'cd ; umask 077 ; mkdir -p .ssh && { [ -z "'`tail -1c .ssh/authorized_keys 2>/dev/null`'" ] || echo >> .ssh/authorized_keys ; } && cat >> .ssh/authorized_keys || exit 1 ; if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi'" \
Jakub Jelen 8622e3
+      ssh "$@" "exec sh -c 'cd ; umask 077 ; mkdir -p .ssh && { [ -z "'`tail -1c .ssh/authorized_keys 2>/dev/null`'" ] || echo >> .ssh/authorized_keys || exit 1; } && cat >> .ssh/authorized_keys || exit 1 ; if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi'" \
Jakub Jelen 8622e3
       || exit 1
Jakub Jelen 8622e3
     ADDED=$(printf '%s\n' "$NEW_IDS" | wc -l)
Jakub Jelen 8622e3
     ;;