mirror of
https://github.com/wahyd4/gitolite.git
synced 2026-08-09 04:55:55 +10:00
puppet wants to send in keys with comment lines
This commit is contained in:
@@ -1077,6 +1077,7 @@ sub setup_authkeys
|
||||
local $/ = undef;
|
||||
local @ARGV = ($pubkey);
|
||||
$pubkey_content = <>;
|
||||
$pubkey_content =~ s/^\s*#.*\n//gm;
|
||||
}
|
||||
$pubkey_content =~ s/\s*$/\n/;
|
||||
# don't trust files with multiple lines (i.e., something after a newline)
|
||||
|
||||
+1
-1
@@ -38,7 +38,7 @@ print "\n";
|
||||
my @pubkeys = sort glob("*.pub");
|
||||
die "no *.pub files here\n" unless @pubkeys;
|
||||
for my $pub (@pubkeys) {
|
||||
my @lines = filelines($pub);
|
||||
my @lines = grep { ! /^\s*#/ } filelines($pub);
|
||||
die "$pub has more than one line\n" if @lines > 1;
|
||||
die "$pub does not start with ssh-rsa or ssh-dss\n" unless $lines[0] =~ /^(?:ssh-rsa|ssh-dss) (\S+)/;
|
||||
my $key = $1;
|
||||
|
||||
Reference in New Issue
Block a user