Blame openssh-6.8p1-fix-ssh-copy-id-on-non-sh-shell.patch
|
Jakub Jelen |
6df422 |
diff --git a/contrib/ssh-copy-id b/contrib/ssh-copy-id
|
|
Jakub Jelen |
6df422 |
index 8e1091c..4bba5d6 100644
|
|
Jakub Jelen |
6df422 |
--- a/contrib/ssh-copy-id
|
|
Jakub Jelen |
6df422 |
+++ b/contrib/ssh-copy-id
|
|
Jakub Jelen |
3e3570 |
@@ -274,9 +274,7 @@ case "$REMOTE_VERSION" in
|
|
Jakub Jelen |
6df422 |
populate_new_ids 0
|
|
Jakub Jelen |
6df422 |
fi
|
|
Jakub Jelen |
6df422 |
[ "$DRY_RUN" ] || printf '%s\n' "$NEW_IDS" | ssh "$@" "
|
|
Jakub Jelen |
6df422 |
- umask 077 ;
|
|
Jakub Jelen |
3e3570 |
+ 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'" \
|
|
Jakub Jelen |
3e3570 |
- mkdir -p .ssh && cat >> .ssh/authorized_keys || exit 1 ;
|
|
Jakub Jelen |
6df422 |
- if type restorecon >/dev/null 2>&1 ; then restorecon -F .ssh .ssh/authorized_keys ; fi" \
|
|
Jakub Jelen |
6df422 |
|| exit 1
|
|
Jakub Jelen |
6df422 |
ADDED=$(printf '%s\n' "$NEW_IDS" | wc -l)
|
|
Jakub Jelen |
6df422 |
;;
|