diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2012-05-06 19:15:28 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2012-05-07 15:08:46 +0530 |
commit | fa2893be7c45ac17bac6da570f3270f0e0210103 (patch) | |
tree | d279348e68b3a8c38798c1165422bbcfad70f969 /src/VREF | |
parent | 699bafa096d21e85c281950e98e60d64104637f9 (diff) |
the dupkeys function was already in ssh-authkeys...
...so there's no need for the VREF.
Ironically, while I was arguing with Eli that I wouldn't do it and why,
the code was *already* there, and had been for over a month! (It must
have been there for much longer for me to have forgotten!)
TODO: convert from using fingerprint compute to actual key strings when
the complaints about speed start appearing.
My own personal speed up loop [1] I guess :)
[1]: http://thedailywtf.com/Articles/Classic-WTF-The-Speedup-Loop.aspx
Diffstat (limited to 'src/VREF')
-rwxr-xr-x | src/VREF/DUPKEYS | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/VREF/DUPKEYS b/src/VREF/DUPKEYS deleted file mode 100755 index 7e479fa..0000000 --- a/src/VREF/DUPKEYS +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash - -# gitolite VREF to detect duplicate public keys - -# see gitolite doc/vref.mkd for what the arguments are -sha=$3 - -# git sets this; and we don't want it at this point... -unset GIT_DIR - -# paranoia -set -e - -# setup the temp area -export TMPDIR=$GL_REPO_BASE_ABS -export tmp=$(mktemp -d -t gl-internal-temp-repo.XXXXXXXXXX); -trap "rm -rf $tmp" EXIT; - -git archive $sha keydir | tar -C $tmp -xf - - # DO NOT try, say, 'GIT_WORK_TREE=$tmp git checkout $sha'. It'll screw up - # both the 'index' and 'HEAD' of the repo.git. Screwing up the index is - # BAD because now it goes out of sync with $GL_ADMINDIR. Think of a push - # that had a deleted pubkey but failed a hooklet for some reason. A - # subsequent push that fixes the error will now result in a $GL_ADMINDIR - # that still *has* that deleted pubkey!! - - # And this is equally applicable to cases where you're using a - # post-receive or similar hook to live update a web site or something, - # which is a pretty common usage, I am given to understand. - -cd $tmp - -for f in `find keydir -name "*.pub"` -do - ssh-keygen -l -f "$f" -done | perl -ane ' - die "FATAL: $F[2] is a duplicate of $seen{$F[1]}\n" if $seen{$F[1]}; - $seen{$F[1]} = $F[2]; -' - -# as you can see, a vref can also 'die' if it wishes to, and it'll take the -# whole update with it if it does. No messing around with sending back a -# vref, having it run through the matches, and printing the DENIED message, -# etc. However, if your push is running from a script, and that script is -# looking for the word "DENIED" or something, then this won't work... |