diff options
author | 2024-01-20 10:10:06 -0800 | |
---|---|---|
committer | 2024-01-20 10:16:59 -0800 | |
commit | 88640bdc0ed8bab49c676af06735124db3de7e41 (patch) | |
tree | e06b37c6d6a6178a7d1dc1625659f9ce7e25983d | |
parent | doc: how to debug failing tests (diff) | |
download | gitolite-gentoo-88640bdc0ed8bab49c676af06735124db3de7e41.tar.gz gitolite-gentoo-88640bdc0ed8bab49c676af06735124db3de7e41.tar.bz2 gitolite-gentoo-88640bdc0ed8bab49c676af06735124db3de7e41.zip |
fix: ensure keydir exists before loading metadata
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r-- | src/lib/Gitolite/Conf/Load.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/lib/Gitolite/Conf/Load.pm b/src/lib/Gitolite/Conf/Load.pm index cc54d7a..8c89759 100644 --- a/src/lib/Gitolite/Conf/Load.pm +++ b/src/lib/Gitolite/Conf/Load.pm @@ -247,9 +247,12 @@ sub env_options { push @pubkeys, $f if -f $f; } # This catches the base 'user.pub', 'user@host.pub', exact matches - push @pubkeys, `find $rc{GL_ADMIN_BASE}/keydir -type f -name "${user}.pub"`; - # this catches 'user@host@NN.pub' variant, for email-named users with multiple keys - push @pubkeys, `find $rc{GL_ADMIN_BASE}/keydir -type f -name "${user}@*.pub"` if $user =~ m/@/; + my $keydir = $rc{GL_ADMIN_BASE}.'/keydir/'; + if(-d $keydir) { + push @pubkeys, `find "$keydir" -type f -name "${user}.pub"`; + # this catches 'user@host@NN.pub' variant, for email-named users with multiple keys + push @pubkeys, `find "$keydir" -type f -name "${user}@*.pub"` if $user =~ m/@/; + } chomp(@pubkeys); return if $#pubkeys <= 0; |