aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/Youri/Repository.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Youri/Repository.pm b/lib/Youri/Repository.pm
index cc02bbc..8aa9cb0 100644
--- a/lib/Youri/Repository.pm
+++ b/lib/Youri/Repository.pm
@@ -305,7 +305,12 @@ sub get_files {
my $grep = "";
$grep = "-regextype posix-egrep -regex '.*\/$pattern'" if ($pattern);
- my @files = map { chop; $_; } `find -L $root/$path $grep -type f`;
+ # XXX: run find in a directory the user is guaranteed to have read
+ # permissions! find simply exits with error if the user doesn't have
+ # read permission on the *current* dir; as this code is run thru many
+ # sudo invocations, sometimes the user calling it has $HOME chmoded to
+ # 0700, making find fail when run as mandrake
+ my @files = map { chop; $_; } `cd && find -L $root/$path $grep -type f`;
die "FATAL: get_files(): find failed!" if ($?);
return @files;