X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/af9566ff1ae55d273ff96c7ca39e34265623a55d..db15adb019142cc5e6c17bf5f90e9544f758cee1:/IkiWiki/Wrapper.pm diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm index 52a7ca2c7..4a98af622 100644 --- a/IkiWiki/Wrapper.pm +++ b/IkiWiki/Wrapper.pm @@ -46,6 +46,12 @@ EOF asprintf(&newenviron[i++], "%s=%s", "REV", s); EOF } + 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']); @@ -58,6 +64,7 @@ EOF /* A wrapper for ikiwiki, can be safely made suid. */ #define _GNU_SOURCE #include +#include #include #include #include @@ -75,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);