aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2016-01-12 23:48:31 -0800
committerRobin H. Johnson <robbat2@gentoo.org>2016-01-12 23:48:31 -0800
commit71abc8579a2598add1b938a62ba09845adc9de31 (patch)
tree00268d6d4b805b1621840624fba9882018e8feef
parentMerge remote-tracking branch 'upstream/master' (diff)
parentssh-authkeys-split: avoid creating invalid keyfiles (diff)
downloadgitolite-gentoo-71abc8579a2598add1b938a62ba09845adc9de31.tar.gz
gitolite-gentoo-71abc8579a2598add1b938a62ba09845adc9de31.tar.bz2
gitolite-gentoo-71abc8579a2598add1b938a62ba09845adc9de31.zip
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-xsrc/triggers/post-compile/ssh-authkeys-split14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/triggers/post-compile/ssh-authkeys-split b/src/triggers/post-compile/ssh-authkeys-split
index b978ef5..bf8c8e7 100755
--- a/src/triggers/post-compile/ssh-authkeys-split
+++ b/src/triggers/post-compile/ssh-authkeys-split
@@ -18,8 +18,6 @@
# - assumes you don't have a subdir in keydir called "__split_keys__"
-# - God help you if you try to throw in a putty key in there.
-
# - RUNNING "GITOLITE SETUP" WILL LOSE ALL THESE KEYS. So if you ever do
# that, you will then need to make a dummy push to the admin repo to add
# them back. If all your **admin** keys were in split keys, then you lost
@@ -30,8 +28,7 @@
# SUPPORT
# -------
#
-# NONE. Mainly because I **know** someone will throw in a putty key. I just
-# know it.
+# NONE.
# USAGE
# -----
@@ -63,7 +60,14 @@ do
seq=1
while read line
do
- echo "$line" > $SKD/$base@$seq.pub
+ f=$SKD/$base@$seq.pub
+ echo "$line" > $f
+ # similar sanity check as main ssh-authkeys script
+ if ! ssh-keygen -l -f $f
+ then
+ echo 1>&2 "ssh-authkeys-split: bad line $seq in keydir/$k"
+ rm -f $f
+ fi
(( seq++ ))
done < $k