diff options
author | Sitaram Chamarty <sitaram@atc.tcs.com> | 2016-09-08 20:13:40 +0530 |
---|---|---|
committer | Sitaram Chamarty <sitaram@atc.tcs.com> | 2016-09-08 21:42:08 +0530 |
commit | b79494923b6f7780a8409472da5ce01897846518 (patch) | |
tree | 927136bfe7bab19ebe538fef63bb8bdfbe09d04a /src | |
parent | minor README change (diff) | |
download | gitolite-gentoo-b79494923b6f7780a8409472da5ce01897846518.tar.gz gitolite-gentoo-b79494923b6f7780a8409472da5ce01897846518.tar.bz2 gitolite-gentoo-b79494923b6f7780a8409472da5ce01897846518.zip |
fix 'access' command behaviour for 'C' and 'D' perms
Thanks to Alexander Groß for catching this. Basically, the access command was
ignoring the presence or absence
Diffstat (limited to 'src')
-rwxr-xr-x | src/commands/access | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/commands/access b/src/commands/access index 4209b7e..f02e533 100755 --- a/src/commands/access +++ b/src/commands/access @@ -57,7 +57,7 @@ my $ret = ''; if ( $repo ne '%' and $user ne '%' ) { # single repo, single user; no STDIN - $ret = access( $repo, $user, $aa, $ref ); + $ret = access( $repo, $user, adjust_aa($repo, $aa), $ref ); show($ret) if $s; @@ -79,10 +79,17 @@ while (<>) { my @in = split; my $r = $repo || shift @in; my $u = $user || shift @in; - $ret = access( $r, $u, $aa, $ref ); + $ret = access( $r, $u, adjust_aa($r, $aa), $ref ); print "$r\t$u\t$ret\n"; } +sub adjust_aa { + my ($repo, $aa) = @_; + $aa = '+' if $aa eq 'C' and not option($repo, 'CREATE_IS_C'); + $aa = '+' if $aa eq 'D' and not option($repo, 'DELETE_IS_D'); + return $aa; +} + sub show { my $ret = shift; die "repo already exists; ^C won't work\n" if $ret =~ /DENIED by existence/; |