aboutsummaryrefslogtreecommitdiff
path: root/IkiWiki
diff options
context:
space:
mode:
authorJoey Hess <joey@kodama.kitenet.net>2008-01-01 18:48:34 -0500
committerJoey Hess <joey@kodama.kitenet.net>2008-01-01 18:48:34 -0500
commit2269cfda301f0187d41b7b42e5f57f5783afdc11 (patch)
tree97ad0638c69476d4bbc3b9482a9d8aa293ebf213 /IkiWiki
parent5693776ae4f48ee55ea4affa9c060a95dcc4b1be (diff)
downloadikiwiki-2269cfda301f0187d41b7b42e5f57f5783afdc11.tar
ikiwiki-2269cfda301f0187d41b7b42e5f57f5783afdc11.tar.gz
* Split error messages for failures to drop real uid and gid.
* Retry dropping uid and gid, possibly this will help with the "Resource temporarily unavailable" failures I've experienced under xen.
Diffstat (limited to 'IkiWiki')
-rw-r--r--IkiWiki/Wrapper.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/IkiWiki/Wrapper.pm b/IkiWiki/Wrapper.pm
index dcf3e5c36..16e5bd350 100644
--- a/IkiWiki/Wrapper.pm
+++ b/IkiWiki/Wrapper.pm
@@ -91,8 +91,14 @@ $envsave
newenviron[i]=NULL;
environ=newenviron;
- if (setregid(getegid(), -1) != 0 || setreuid(geteuid(), -1) != 0) {
- perror("failed to drop real uid/gid");
+ if (setregid(getegid(), -1) != 0 &&
+ setregid(getegid(), -1) != 0) {
+ perror("failed to drop real gid");
+ exit(1);
+ }
+ if (setreuid(geteuid(), -1) != 0 &&
+ setreuid(geteuid(), -1) != 0) {
+ perror("failed to drop real uid");
exit(1);
}