aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-05-26 15:24:17 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-05-26 15:24:17 -0700
commit3085f5089bd81e86c7a783fd44cc3f3ccbdcb02e (patch)
tree811b545294d5d56b73d80f2afb695b1375bb1cf8
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadgitolite-gentoo-3.6.3.1.tar.gz
gitolite-gentoo-3.6.3.1.tar.bz2
gitolite-gentoo-3.6.3.1.zip
Permit empty lines or comments in the public key file that is passed to setup.gitolite-gentoo-3.6.3.1
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--src/lib/Gitolite/Setup.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/Gitolite/Setup.pm b/src/lib/Gitolite/Setup.pm
index 43de5d9..0c445ae 100644
--- a/src/lib/Gitolite/Setup.pm
+++ b/src/lib/Gitolite/Setup.pm
@@ -86,7 +86,8 @@ sub args {
if ($pubkey) {
$pubkey =~ /\.pub$/ or _die "'$pubkey' name does not end in .pub";
tsh_try("cat $pubkey") or _die "'$pubkey' not a readable file";
- tsh_lines() == 1 or _die "'$pubkey' must have exactly one line";
+ @lines = grep {!/^(#|$)/} tsh_lines();
+ scalar(@lines) == 1 or _die "'$pubkey' must have exactly one non-empty, non-comment line";
tsh_try("ssh-keygen -l -f $pubkey") or _die "'$pubkey' does not seem to be a valid ssh pubkey file";
$admin = $pubkey;