Fossil SCM

Extra efforts to close higher-numbered file descriptors prior to starting CGI.

drh 2018-08-01 06:49 failed-fix
Commit d6053249ecf38e4946324956742650ce9a25ed590054cf34eef9455b89a878ed
1 file changed +1 -1
+1 -1
--- src/main.c
+++ src/main.c
@@ -2022,11 +2022,11 @@
20222022
fossil_binary_mode(g.httpOut);
20232023
fossil_binary_mode(g.httpIn);
20242024
#if !defined(_WIN32)
20252025
/* Work around a bug in older versions of althttpd by making sure no
20262026
** 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++){} }
20282028
#endif
20292029
g.cgiOutput = 1;
20302030
blob_read_from_file(&config, zFile, ExtFILE);
20312031
while( blob_line(&config, &line) ){
20322032
if( !blob_token(&line, &key) ) continue;
20332033
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button