From 30f49dc5550f9b551eee374f547997c73af0c99b Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Fri, 21 Sep 2018 09:10:39 +0530 Subject: block access() to repos being imported dc13dfc introduced a block on accessing repos which are in the process of being moved into gitolite's control. This block was (a) in gitolite-shell, which would catch all git-client activity and (b) in list_phy_repos(), which would prevent those repos from being seen by the 'info' command. Unfortunately that was stupid; it also blocked 'gitolite setup' itself, because setup uses list_phy_repos! The correct place to put this was always going to be access(), but I had initially shied away from that because it would cause a slight glitch in the working of any POST_COMPILE trigger scripts that used the access() function on any of the newly migrated repos. But nothing else really works. As a result, the step where you run `gitolite setup` when importing now becomes: gitolite compile gitolite setup --hooks-only gitolite trigger POST_COMPILE --- src/gitolite-shell | 7 ------- src/lib/Gitolite/Common.pm | 2 -- src/lib/Gitolite/Conf/Load.pm | 1 + 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gitolite-shell b/src/gitolite-shell index 6c4c462..072e0ff 100755 --- a/src/gitolite-shell +++ b/src/gitolite-shell @@ -113,13 +113,6 @@ sub main { $ENV{GL_REPO} = $repo; my $aa = ( $verb =~ 'upload' ? 'R' : 'W' ); - # catch rare race when moving repos into gitolite control - _die "$aa any $repo $user DENIED by fallthru" . - "\n(or you mis-spelled the reponame)" - unless update_hook_present($repo); - # this error message is exactly the same as that from elsewhere in the - # code, for the usual reasons (avoid leaking information) - # set up env vars from options set for this repo env_options($repo); diff --git a/src/lib/Gitolite/Common.pm b/src/lib/Gitolite/Common.pm index 3f47b37..af9c875 100644 --- a/src/lib/Gitolite/Common.pm +++ b/src/lib/Gitolite/Common.pm @@ -239,8 +239,6 @@ sub cleanup_conf_line { $repo =~ s(^\./)(); next if $repo =~ m(/$); # tolerate non-bare repos within ~/repositories but silently ignore them - next unless update_hook_present($repo); - # ignore repos that don't yet have the update hook push @phy_repos, $repo; } trace( 3, scalar(@phy_repos) . " physical repos found" ); diff --git a/src/lib/Gitolite/Conf/Load.pm b/src/lib/Gitolite/Conf/Load.pm index e0e4e92..d377bca 100644 --- a/src/lib/Gitolite/Conf/Load.pm +++ b/src/lib/Gitolite/Conf/Load.pm @@ -73,6 +73,7 @@ sub access { trace( 2, $repo, $user, $aa, $ref ); _die "invalid user '$user'" if not( $user and $user =~ $USERNAME_PATT ); sanity($repo); + return "$aa any $repo $user DENIED by fallthru" unless update_hook_present($repo); my @rules; my $deny_rules; -- cgit v1.2.3-65-gdbad From 66a6bec4c62a203a9a54b32d2449bfae8030dfae Mon Sep 17 00:00:00 2001 From: Sitaram Chamarty Date: Sun, 30 Sep 2018 10:07:17 +0530 Subject: v3.6.10 --- CHANGELOG | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 9c3998a..dd5f1d3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,6 @@ +2018-09-30 v3.6.10 fix up boo-boo caused by previous release; see mails on + list for details + 2018-08-07 v3.6.9 prevent racy access to repos in process of migration to gitolite -- cgit v1.2.3-65-gdbad