summaryrefslogtreecommitdiff
path: root/libpiny/lib/Piny
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@cobain.omgwallhack.org>2011-12-05 21:43:41 -0800
committerJoe Rayhawk <jrayhawk@cobain.omgwallhack.org>2011-12-05 21:43:41 -0800
commit0cddd39752de56fb0fa407d66140502d89c741a8 (patch)
treec67ce436d6bd4453c8e27a17149f553625f78bbe /libpiny/lib/Piny
parentac0d783204c7c1612aaf5b8bb04b8c390d6e5b78 (diff)
downloadpiny-code-0cddd39752de56fb0fa407d66140502d89c741a8.tar.gz
piny-code-0cddd39752de56fb0fa407d66140502d89c741a8.zip
Piny::Repo: Adding -H to sudo invocations to get rid of problems with unreadable homedirs.
Diffstat (limited to 'libpiny/lib/Piny')
-rw-r--r--libpiny/lib/Piny/Repo.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index eee8f90..a4b1890 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -333,7 +333,7 @@ sub rebuild_ikiwiki {
unless( -d $s->ikiwiki_srcdir . ".git" ) {
# do this after the chown -R because there are a lot of object hardlinks flying around that don't want to chown
- system( "/usr/bin/sudo", "-u", $ikiuser->name, "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!";
+ system( "/usr/bin/sudo", "-H", "-u", $ikiuser->name, "/usr/bin/git", "clone", "--quiet", $s->path, $s->ikiwiki_srcdir ) and die "Could not clone repo to ikiwiki srcdir!";
};
open( WIKILIST, ">", "/etc/ikiwiki/wikilist.d/" . $s->name ) or die "Could not create wikilist.d file: $!";
@@ -342,7 +342,7 @@ sub rebuild_ikiwiki {
$s->rebuild_wikilist;
- system( "/usr/bin/sudo", "-u", $ikiuser->name, "/usr/bin/ikiwiki", "--setup", "/etc/ikiwiki/piny/" . $s->name . ".setup" ) and die "Could not do initial compile of ikiwiki!";
+ system( "/usr/bin/sudo", "-H", "-u", $ikiuser->name, "/usr/bin/ikiwiki", "--setup", "/etc/ikiwiki/piny/" . $s->name . ".setup" ) and die "Could not do initial compile of ikiwiki!";
my $globaltemp = File::Temp->new( ) or die "Could not create temporary file: $!";
$globaltemp->unlink_on_destroy( 0 );
@@ -482,7 +482,7 @@ sub create {
chdir( "/srv/git" ); # so git-clone can do the work of resolving local repo names for us
if ( defined $remote ) {
system( "/bin/chown", $user->name, $repo->path ) and die "Could not change ownership of repo path!"; # permissions are overridden later
- if ( system( "/usr/bin/sudo", "-u", $user->name, "/usr/bin/git", "clone", "--bare", "--no-hardlinks", "--quiet", $remote, $repo->path ) ) { # sudo -u $user needed in order to test user readability of whatever they want to clone. the mode o+rx should probably be masked off if we want private repos to stay private.
+ if ( system( "/usr/bin/sudo", "-H", "-u", $user->name, "/usr/bin/git", "clone", "--bare", "--no-hardlinks", "--quiet", $remote, $repo->path ) ) { # sudo -u $user needed in order to test user readability of whatever they want to clone. the mode o+rx should probably be masked off if we want private repos to stay private.
system( "/bin/rm", "-r", $repo->path ) and die "Failed to clean up after failed clone operation!";
die( "Could not clone repository!\n" );
} else {