aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki/Wrapper.pm
diff options
context:
space:
mode:
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-04 03:38:02 +0000
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>2006-09-04 03:38:02 +0000
commitea95624e2d22fc1142d9a96acfcc9c6134395b4d (patch)
treea4ab61011f2c0b6ffeb0de4b03987e9ef3ef41ae /IkiWiki/Wrapper.pm
parent69336315018287f8fab97bf2c17d10b8e3d712fc (diff)
downloadikiwiki-ea95624e2d22fc1142d9a96acfcc9c6134395b4d.tar
ikiwiki-ea95624e2d22fc1142d9a96acfcc9c6134395b4d.tar.gz
* Drop real uid/gid in the suid wrapper, thus allowing commits to remote
subversion repos and fixing some other issues.
Diffstat (limited to 'IkiWiki/Wrapper.pm')
-rw-r--r--IkiWiki/Wrapper.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index 52a7ca2c7..deba58d28 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -75,6 +75,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);