]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Wrapper.pm
Merge branch 'master' into sipb
[ikiwiki.git] / IkiWiki / Wrapper.pm
index ff110b5ffb9763cb5fbb9248c0b5d95bc52fb5e1..31b4f30414cd90a6304050d39508283dd6712ba9 100644 (file)
@@ -28,7 +28,7 @@ sub gen_wrapper () {
        my @envsave;
        push @envsave, qw{REMOTE_ADDR QUERY_STRING REQUEST_METHOD REQUEST_URI
                       CONTENT_TYPE CONTENT_LENGTH GATEWAY_INTERFACE
-                      HTTP_COOKIE REMOTE_USER HTTPS REDIRECT_STATUS
+                      HTTP_COOKIE REMOTE_USER HTTPS SSL_CLIENT_S_DN_CN REDIRECT_STATUS
                       REDIRECT_URL} if $config{cgi};
        my $envsave="";
        foreach my $var (@envsave) {
@@ -142,12 +142,12 @@ $pre_exec
 }
 EOF
 
-       my $cc=exists $ENV{CC} ? possibly_foolish_untaint($ENV{CC}) : 'cc';
-       if (system($cc, "$wrapper.c", "-o", "$wrapper.new") != 0) {
+       my @cc=exists $ENV{CC} ? possibly_foolish_untaint($ENV{CC}) : 'cc';
+       push @cc, possibly_foolish_untaint($ENV{CFLAGS}) if exists $ENV{CFLAGS};
+       if (system(@cc, "$wrapper.c", "-o", "$wrapper.new") != 0) {
                #translators: The parameter is a C filename.
                error(sprintf(gettext("failed to compile %s"), "$wrapper.c"));
        }
-       unlink("$wrapper.c");
        if (defined $config{wrappergroup}) {
                my $gid=(getgrnam($config{wrappergroup}))[2];
                if (! defined $gid) {