summaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Plugin/ddate.pm2
-rw-r--r--IkiWiki/Plugin/prettydate.pm2
-rw-r--r--IkiWiki/Wrapper.pm18
3 files changed, 17 insertions, 5 deletions
diff --git a/IkiWiki/Plugin/ddate.pm b/IkiWiki/Plugin/ddate.pm
index f4921fdfd..7382d4160 100644
--- a/IkiWiki/Plugin/ddate.pm
+++ b/IkiWiki/Plugin/ddate.pm
@@ -16,7 +16,7 @@ sub checkconfig () { #{{{
}
} #}}}
-sub IkiWiki::displaytime ($) { #{{{
+sub IkiWiki::displaytime ($;$) { #{{{
my $time=shift;
eval q{
use DateTime;
diff --git a/IkiWiki/Plugin/prettydate.pm b/IkiWiki/Plugin/prettydate.pm
index 18ddb9403..b31d30cd0 100644
--- a/IkiWiki/Plugin/prettydate.pm
+++ b/IkiWiki/Plugin/prettydate.pm
@@ -61,7 +61,7 @@ sub checkconfig () { #{{{
}
} #}}}
-sub IkiWiki::displaytime ($) { #{{{
+sub IkiWiki::displaytime ($;$) { #{{{
my $time=shift;
eval q{use Date::Format};
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index 558cdb1cc..6687cace2 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -102,14 +102,26 @@ $envsave
}
EOF
close OUT;
- if (system("gcc", "$wrapper.c", "-o", $wrapper) != 0) {
+ if (system("gcc", "$wrapper.c", "-o", "$wrapper.new") != 0) {
#translators: The parameter is a C filename.
error(sprintf(gettext("failed to compile %s"), "$wrapper.c"));
}
unlink("$wrapper.c");
+ if (defined $config{wrappergroup}) {
+ my $gid=(getgrnam($config{wrappergroup}))[2];
+ if (! defined $gid) {
+ error(sprintf("bad wrappergroup"));
+ }
+ if (! chown(-1, $gid, "$wrapper.new")) {
+ error("chown $wrapper.new: $!");
+ }
+ }
if (defined $config{wrappermode} &&
- ! chmod(oct($config{wrappermode}), $wrapper)) {
- error("chmod $wrapper: $!");
+ ! chmod(oct($config{wrappermode}), "$wrapper.new")) {
+ error("chmod $wrapper.new: $!");
+ }
+ if (! rename("$wrapper.new", $wrapper)) {
+ error("rename $wrapper.new $wrapper: $!");
}
#translators: The parameter is a filename.
printf(gettext("successfully generated %s"), $wrapper);