Third part of this patch submission series. The patch below (by cworth)
is currently in use in cairographics.org's version of ikiwiki. Since the
subject matches, I am sending this to an existing bug report.

Subject: [PATCH] Explicitly set umask to 0002 in wrapper

Without this, the CGI was creating web pages that had no
other-read permissions, (which meant that apache couldn't
serve them unless they happened to belong to the same group
as the apache process (www-data I believe?)).
---
 Wrapper.pm |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/Wrapper.pm b/Wrapper.pm
index 558cdb1..4301aed 100644
--- a/Wrapper.pm
+++ b/Wrapper.pm
@@ -66,6 +66,7 @@ EOF
 /* A wrapper for ikiwiki, can be safely made suid. */
 #include <stdio.h>
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
@@ -96,6 +97,8 @@ $envsave
                exit(1);
        }
 
+       umask (S_IWOTH);
+
        execl("$this", "$this", NULL);
        perror("exec $this");
        exit(1);



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to