Permalink
Browse files

remove restriction on @ in setup -pk

  • Loading branch information...
1 parent 0458bdf commit 744335d593ae1e2b6fef1ca4364029a4dc41d210 @sitaramc committed Feb 27, 2013
Showing with 5 additions and 3 deletions.
  1. +5 −3 src/lib/Gitolite/Setup.pm
@@ -85,14 +85,16 @@ sub args {
if ($pubkey) {
$pubkey =~ /\.pub$/ or _die "'$pubkey' name does not end in .pub";
- $pubkey =~ /\@/ and _die "'$pubkey' name contains '\@'";
tsh_try("cat $pubkey") or _die "'$pubkey' not a readable file";
tsh_lines() == 1 or _die "'$pubkey' must have exactly one line";
tsh_try("ssh-keygen -l -f $pubkey") or _die "'$pubkey' does not seem to be a valid ssh pubkey file";
$admin = $pubkey;
- $admin =~ s(.*/)();
- $admin =~ s/\.pub$//;
+ # next 2 lines duplicated from args() in ssh-authkeys
+ $admin =~ s(.*/)(); # foo/bar/baz.pub -> baz.pub
+ $admin =~ s/(\@[^.]+)?\.pub$//; # baz.pub, baz@home.pub -> baz
+ $pubkey =~ /\@/ and print STDERR "NOTE: the admin username is '$admin'\n";
+
}
return ( $admin || '', $pubkey || '', $h_only || 0, $argv );

0 comments on commit 744335d

Please sign in to comment.