X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/0f8ea7ecca27a9e73af5c515f637f543912c7076..a3c8465565cdee1f5d71c4a537329e21593c750a:/IkiWiki/Render.pm?ds=inline diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index 2cdec421f..990fcaaa1 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -80,7 +80,7 @@ sub genpage ($$) { #{{{ 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++; } @@ -180,7 +180,7 @@ sub scan ($) { #{{{ } } #}}} -sub fast_file_copy ($$$$$) { #{{{ +sub fast_file_copy (@) { #{{{ my $srcfile=shift; my $destfile=shift; my $srcfd=shift; @@ -229,10 +229,14 @@ sub render ($) { #{{{ 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 }