my $actions=0;
if (length $config{cgiurl}) {
- $template->param(editurl => cgiurl(do => "edit", page => pagetitle($page, 1)));
+ $template->param(editurl => cgiurl(do => "edit", page => $page));
$template->param(prefsurl => cgiurl(do => "prefs"));
$actions++;
}
}
} #}}}
-sub fast_file_copy ($$$$$) { #{{{
+sub fast_file_copy (@) { #{{{
my $srcfile=shift;
my $destfile=shift;
my $srcfd=shift;
will_render($file, $file, 1);
if ($config{hardlink}) {
- prep_writefile($file, $config{destdir});
- unlink($config{destdir}."/".$file);
- if (link($srcfile, $config{destdir}."/".$file)) {
- return;
+ # only hardlink if owned by same user
+ my @stat=stat($srcfile);
+ if ($stat[4] == $>) {
+ prep_writefile($file, $config{destdir});
+ unlink($config{destdir}."/".$file);
+ if (link($srcfile, $config{destdir}."/".$file)) {
+ return;
+ }
}
# if hardlink fails, fall back to copying
}