X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/17fdb8028bfb2722c120b229c2131598affbddd6..6ebea774c85502377681165e27093a3bd3a61f30:/IkiWiki/Render.pm?ds=inline diff --git a/IkiWiki/Render.pm b/IkiWiki/Render.pm index c241fd40b..990fcaaa1 100644 --- a/IkiWiki/Render.pm +++ b/IkiWiki/Render.pm @@ -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 }