Fossil SCM
Extra efforts to close higher-numbered file descriptors prior to starting CGI.
Commit
d6053249ecf38e4946324956742650ce9a25ed590054cf34eef9455b89a878ed
Parent
1073593e901e179…
1 file changed
+1
-1
+1
-1
| --- src/main.c | ||
| +++ src/main.c | ||
| @@ -2022,11 +2022,11 @@ | ||
| 2022 | 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | 2024 | #if !defined(_WIN32) |
| 2025 | 2025 | /* Work around a bug in older versions of althttpd by making sure no |
| 2026 | 2026 | ** file descriptors other than 0, 1, and 2 are open. */ |
| 2027 | - { int i; for(i=3; close(i)==0; i++){} } | |
| 2027 | + { int i; for(i=3; close(i)==0 || i<6; i++){} } | |
| 2028 | 2028 | #endif |
| 2029 | 2029 | g.cgiOutput = 1; |
| 2030 | 2030 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2031 | 2031 | while( blob_line(&config, &line) ){ |
| 2032 | 2032 | if( !blob_token(&line, &key) ) continue; |
| 2033 | 2033 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2022,11 +2022,11 @@ | |
| 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | #if !defined(_WIN32) |
| 2025 | /* Work around a bug in older versions of althttpd by making sure no |
| 2026 | ** file descriptors other than 0, 1, and 2 are open. */ |
| 2027 | { int i; for(i=3; close(i)==0; i++){} } |
| 2028 | #endif |
| 2029 | g.cgiOutput = 1; |
| 2030 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2031 | while( blob_line(&config, &line) ){ |
| 2032 | if( !blob_token(&line, &key) ) continue; |
| 2033 |
| --- src/main.c | |
| +++ src/main.c | |
| @@ -2022,11 +2022,11 @@ | |
| 2022 | fossil_binary_mode(g.httpOut); |
| 2023 | fossil_binary_mode(g.httpIn); |
| 2024 | #if !defined(_WIN32) |
| 2025 | /* Work around a bug in older versions of althttpd by making sure no |
| 2026 | ** file descriptors other than 0, 1, and 2 are open. */ |
| 2027 | { int i; for(i=3; close(i)==0 || i<6; i++){} } |
| 2028 | #endif |
| 2029 | g.cgiOutput = 1; |
| 2030 | blob_read_from_file(&config, zFile, ExtFILE); |
| 2031 | while( blob_line(&config, &line) ){ |
| 2032 | if( !blob_token(&line, &key) ) continue; |
| 2033 |