]>
Commit | Line | Data |
---|---|---|
bfc879b9 ER |
1 | diff -Naurd build-tree.orig/apache_1.3.34/src/support/suexec.c build-tree/apache_1.3.34/src/support/suexec.c |
2 | --- build-tree.orig/apache_1.3.34/src/support/suexec.c 2004-08-23 23:36:55.000000000 +0200 | |
3 | +++ build-tree/apache_1.3.34/src/support/suexec.c 2004-08-23 23:40:35.000000000 +0200 | |
4 | @@ -49,6 +49,10 @@ | |
5 | #include <stdarg.h> | |
6 | #include <strings.h> | |
7 | ||
8 | +/* for fcntl(fileno(log), F_SETFD, FD_CLOEXEC); */ | |
9 | +#include <unistd.h> | |
10 | +#include <fcntl.h> | |
11 | + | |
12 | #include "suexec.h" | |
13 | ||
14 | /* | |
15 | @@ -151,6 +155,8 @@ | |
16 | perror("fopen"); | |
17 | exit(1); | |
18 | } | |
19 | + /* Set the close-on-exec flag -- Liyang HU <liyang@nerv.cx> */ | |
20 | + fcntl(fileno(log), F_SETFD, FD_CLOEXEC); | |
21 | } | |
22 | ||
23 | time(&timevar); | |
24 | @@ -823,20 +829,6 @@ | |
25 | umask(SUEXEC_UMASK); | |
26 | #endif /* SUEXEC_UMASK */ | |
27 | ||
28 | - /* | |
29 | - * Be sure to close the log file so the CGI can't | |
30 | - * mess with it. If the exec fails, it will be reopened | |
31 | - * automatically when log_err is called. Note that the log | |
32 | - * might not actually be open if LOG_EXEC isn't defined. | |
33 | - * However, the "log" cell isn't ifdef'd so let's be defensive | |
34 | - * and assume someone might have done something with it | |
35 | - * outside an ifdef'd LOG_EXEC block. | |
36 | - */ | |
37 | - if (log != NULL) { | |
38 | - fclose(log); | |
39 | - log = NULL; | |
40 | - } | |
41 | - | |
42 | /* | |
43 | * Execute the command, replacing our image with its own. | |
44 | */ |