]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Render.pm
Merge branch 'master' into pedigree
[git.ikiwiki.info.git] / IkiWiki / Render.pm
index 5184be2df0129bf9837aaabd91133dd1b1e3ba96..990fcaaa111d3d48985eff126fbdd30bd0d17003 100644 (file)
@@ -80,7 +80,7 @@ sub genpage ($$) { #{{{
        my $actions=0;
 
        if (length $config{cgiurl}) {
        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++;
        }
                $template->param(prefsurl => cgiurl(do => "prefs"));
                $actions++;
        }
@@ -229,10 +229,14 @@ sub render ($) { #{{{
                will_render($file, $file, 1);
                
                if ($config{hardlink}) {
                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
                }
                        }
                        # if hardlink fails, fall back to copying
                }