From 383357ea4b083d224ab2fcf3d58321b8667c578a Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Tue, 24 May 2011 20:27:24 -0700 Subject: libpiny: $repo.git/config should probably be world-readable, but git-config likes setting it to core.sharedrepository mask --- libpiny/lib/Piny/Repo.pm | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'libpiny') diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm index 5dc390c..82f651d 100644 --- a/libpiny/lib/Piny/Repo.pm +++ b/libpiny/lib/Piny/Repo.pm @@ -279,14 +279,6 @@ sub rebuild_git { system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/packed-refs -type f -print0 | /usr/bin/xargs -0 /bin/chmod $fileperm" ) and die "Could not chmod shared git resources!"; # most files are either immutable or replaced at link level system( "/usr/bin/find " . $s->path . "/refs " . $s->path . "/info " . $s->path . "/branches " . $s->path . "/objects " . $s->path . "/logs " . $s->path . "/HEAD " . $s->path . "/packed-refs -print0 | /usr/bin/xargs -0 /bin/chgrp " . $s->group->name ) and die "Could not chgrp shared git resources!"; - chown( 0, 0, $s->path ) or die "Could not change ownership of " . $s->path; - chmod( 00755, $s->path ) or die "Could not change mode of " . $s->path; - - foreach( "config", "description", "git-daemon-export-ok" ) { - chown( 0, 0, $s->path . "/" . $_ ) or die "Could not change ownership of $_!"; - chmod( 00644, $s->path . "/" . $_ ) or die "Could not change mode of $_!"; - }; - $ENV{"GIT_DIR"} = $s->path; system( "/usr/bin/git", "config", "gitweb.owner", $s->owner->email->address ) and die "Could not git config gitweb.owner!"; # packed-refs files aren't modifiable under our permission system and are poorly supported on old version of git anyway. @@ -295,6 +287,14 @@ sub rebuild_git { system( "/usr/bin/git", "config", "core.sharedrepository", $s->config->core_sharedrepository ) and die "Could not git config core.sharedrepository!"; delete $ENV{"GIT_DIR"}; + chown( 0, 0, $s->path ) or die "Could not change ownership of " . $s->path; + chmod( 00755, $s->path ) or die "Could not change mode of " . $s->path; + + foreach( "config", "description", "git-daemon-export-ok" ) { + chown( 0, 0, $s->path . "/" . $_ ) or die "Could not change ownership of $_!"; + chmod( 00644, $s->path . "/" . $_ ) or die "Could not change mode of $_!"; + }; + $s->clear_config; $s->config->save; -- cgit v1.2.3