(minor) fixes to lint program, mainly usage message

This commit is contained in:
Sitaram Chamarty 2012-11-20 06:32:53 +05:30
parent a26532d635
commit 2018267a45

View file

@ -73,7 +73,7 @@ for my $pkf (@pubkeyfiles) {
my $fp = fprint($pkf); my $fp = fprint($pkf);
next unless $fp; next unless $fp;
msg 1, "$pkfsn appears to be a COPY of $pkf_by_fp{$fp}\n" if $pkf_by_fp{$fp}; msg 1, "$pkfsn appears to be a COPY of $pkf_by_fp{$fp}\n" if $pkf_by_fp{$fp};
$pkf_by_fp{$fp} ||= $pkf; $pkf_by_fp{$fp} ||= $pkfsn;
my $fpu = ( $seen_fprints{$fp}{user} || 'no access' ); my $fpu = ( $seen_fprints{$fp}{user} || 'no access' );
msg 0, "$pkfsn maps to $fpu\n"; msg 0, "$pkfsn maps to $fpu\n";
} }
@ -170,17 +170,20 @@ sub fprint {
sub usage { sub usage {
print <<EOF; print <<EOF;
sshkeys-lint expects Usage: gitolite sshkeys-lint [-q] [optional list of pubkey filenames]
- the contents of an authorized_keys file via STDIN (optionally, STDIN can be a pipe or redirected from a file; see below)
- one or more pubkey filenames as arguments
sample use to check all keys on gitolite server: Look for potential problems in ssh keys.
cd ~/.gitolite/keydir
cat ~/.ssh/authorized_keys | sshkeys-lint `find . -name "*.pub"`
# or supply only one pubkey file to check only that:
cat ~/.ssh/authorized_keys | sshkeys-lint YourName.pub
Note that it runs ssh-keygen -l for each line in the authkeys file and each sshkeys-lint expects:
- the contents of an authorized_keys file via STDIN, otherwise it uses
$HOME/.ssh/authorized_keys
- one or more pubkey filenames as arguments, otherwise it uses all the keys
found (recursively) in $HOME/.gitolite/keydir
The '-q' option will print only warnings instead of all mappings.
Note that this runs ssh-keygen -l for each line in the authkeys file and each
pubkey in the argument list, so be wary of running it on something huge. This pubkey in the argument list, so be wary of running it on something huge. This
is meant for troubleshooting. is meant for troubleshooting.