Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
auth: dont allow trailing slash in reponames...
...like "git clone host:foo/", even if it matches "repo foo/.*"

NOTE: I expect a few more of these special cases to be found as time
goes on and people find new ways to abuse the regex system, whether it
is done intentionally or not.  Anything not fixable by changing the
config file will be fixed in the code asap.

This one, for instance, seems fixable by using "foo/.+" instead of
"foo/.*".  But it actually isn't; the user can do "git clone host:foo//"
and bypass that :(

Still I suspect most situations will get an entry in the "then don't do
that" file :)

----

    patient: "doc, it hurts when I do this"
    doc:     "then don't do that"
  • Loading branch information
Sitaram Chamarty committed Dec 11, 2009
1 parent ff28acb commit a15e910
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/gl-auth-command
Expand Up @@ -103,6 +103,7 @@ my ($verb, $repo) = ($cmd =~ /^\s*(git\s+\S+|\S+)\s+'\/?(.*?)(?:.git)?'/);
die "bad command: $cmd. Make sure the repo name is exactly as in your config\n"
unless ( $verb and ( $verb =~ $R_COMMANDS or $verb =~ $W_COMMANDS )
and $repo and $repo =~ $REPONAME_PATT );
die "$repo ends with a slash; I don't like that\n" if $repo =~ /\/$/;

# ----------------------------------------------------------------------------
# first level permissions check
Expand Down

0 comments on commit a15e910

Please sign in to comment.