Problem with ssh-copy-id when home folder contains spaces

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hi,

some guy on the Cygwin mailing list found that ssh-copy-id chokes
on directories with spaces, which are quite common on Windows.

He also provided an easy fix, basically just adding quotes, which I
attached to this mail.  Would that be ok to apply upstream?


Thanks,
Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
diff --git a/usr/bin/ssh-copy-id.old b/usr/bin/ssh-copy-id
index afde8b1..bef5c95 100755
--- a/usr/bin/ssh-copy-id.old
+++ b/usr/bin/ssh-copy-id
@@ -233,17 +233,17 @@ populate_new_ids() {
             -o ControlPath=none \
             -o LogLevel=INFO \
             -o PreferredAuthentications=publickey \
-            -o IdentitiesOnly=yes "$@" exit 2>$L_TMP_ID_FILE.stderr </dev/null
+            -o IdentitiesOnly=yes "$@" exit 2>"$L_TMP_ID_FILE.stderr" </dev/null
         if [ "$?" = "$L_SUCCESS" ] ; then
-          : > $L_TMP_ID_FILE
+          : > "$L_TMP_ID_FILE"
         else
-          grep 'Permission denied' $L_TMP_ID_FILE.stderr >/dev/null || {
-            sed -e 's/^/ERROR: /' <$L_TMP_ID_FILE.stderr >$L_TMP_ID_FILE
+          grep 'Permission denied' "$L_TMP_ID_FILE.stderr" >/dev/null || {
+            sed -e 's/^/ERROR: /' <"$L_TMP_ID_FILE.stderr" >"$L_TMP_ID_FILE"
             cat >/dev/null #consume the other keys, causing loop to end
           }
         fi
 
-        cat $L_TMP_ID_FILE
+        cat "$L_TMP_ID_FILE"
       done
     }
   )

Attachment: signature.asc
Description: PGP signature

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux