two significant fixes to load:

- don't look for user-roles if the repo is missing (doesn't make sense
    and because we roll in the <perm> = CREATOR function into that, it
    causes bugs like [1] below)

  - allow ^CREATOR/ in repo names (i.e., don't insist it has to be
    /CREATOR/)

----

[1] here's the bug

    repo foo/..*
        C   =   u1
        RW+ =   CREATOR # <--- this line
        R   =   READERS
        RW  =   WRITERS

    causes
        GL_USER=u2 gitolite info

    to print
        hello u2, this is gitolite3 (unknown) on git 1.7.7.6

         R W  	foo/..*
         R W  	testing

    when in reality it should not be looking at CREATOR at all.
This commit is contained in:
Sitaram Chamarty 2012-03-20 09:13:05 +05:30
parent 545c00aa26
commit ed47d1aef8

View file

@ -282,7 +282,7 @@ sub memberships {
}
}
if ( $type eq 'user' and $repo ) {
if ( $type eq 'user' and $repo and not repo_missing($repo) ) {
# find the roles this user has when accessing this repo and add those
# in as groupnames he is a member of. You need the already existing
# memberships for this; see below this function for an example
@ -361,7 +361,9 @@ sub generic_name {
# In particular, 'gitolite access' can't be used to check ^C perms.
$creator = creator($base);
( $base2 = $base ) =~ s(/$creator/)(/CREATOR/) if $creator;
$base2 = $base;
$base2 =~ s(/$creator/)(/CREATOR/) if $creator;
$base2 =~ s(^$creator/)(CREATOR/) if $creator;
$base2 = '' if $base2 eq $base; # if there was no change
return $base2;