From 0cddd39752de56fb0fa407d66140502d89c741a8 Mon Sep 17 00:00:00 2001 From: Joe Rayhawk Date: Mon, 5 Dec 2011 21:43:41 -0800 Subject: Piny::Repo: Adding -H to sudo invocations to get rid of problems with unreadable homedirs. --- libpiny/lib/Piny/Repo.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libpiny') 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 { -- cgit v1.2.3