diff options
-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; |