X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/ccbf965e6b875c9cfa2ef681c85a224439928a69..723ba5793b3bf588941aa7643814090515aefbe6:/IkiWiki/Wrapper.pm diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 7d27abd06..4a98af622 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -46,10 +46,12 @@ EOF asprintf(&newenviron[i++], "%s=%s", "REV", s); EOF } - - # This is only set by plugins, which append to it on startup, so - # avoid storing it in the wrapper. - $config{headercontent}=""; + if ($config{rcs} eq "tla" && $config{notify}) { + $envsave.=<<"EOF" + if ((s=getenv("ARCH_VERSION"))) + asprintf(&newenviron[i++], "%s=%s", "ARCH_VERSION", s); +EOF + } $Data::Dumper::Indent=0; # no newlines my $configstring=Data::Dumper->Dump([\%config], ['*config']); @@ -62,6 +64,7 @@ EOF /* A wrapper for ikiwiki, can be safely made suid. */ #define _GNU_SOURCE #include +#include #include #include #include @@ -79,6 +82,11 @@ $envsave newenviron[i]=NULL; environ=newenviron; + if (setregid(getegid(), -1) != 0 || setreuid(geteuid(), -1) != 0) { + perror("failed to drop real uid/gid"); + exit(1); + } + execl("$this", "$this", NULL); perror("failed to run $this"); exit(1);