summaryrefslogtreecommitdiff
path: root/libpiny/lib/Piny
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-24 20:27:24 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-24 20:27:24 -0700
commit383357ea4b083d224ab2fcf3d58321b8667c578a (patch)
tree59b6fac2826d1d5185fadb7f15a3f62970a3d3ba /libpiny/lib/Piny
parent5cbfc69d7ba82a55835519a7171fce8aade35420 (diff)
downloadpiny-code-383357ea4b083d224ab2fcf3d58321b8667c578a.tar.gz
piny-code-383357ea4b083d224ab2fcf3d58321b8667c578a.zip
libpiny: $repo.git/config should probably be world-readable, but git-config likes setting it to core.sharedrepository mask
Diffstat (limited to 'libpiny/lib/Piny')
-rw-r--r--libpiny/lib/Piny/Repo.pm16
1 files changed, 8 insertions, 8 deletions
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;