Skip to content

Commit 1cee6c5

Browse files
author
Thies C. Arntzen
committed
@- Fixed closing
1 parent bab3195 commit 1cee6c5

2 files changed

Lines changed: 4 additions & 15 deletions

File tree

sapi/apache/mod_php4.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
# include "mod_dav.h"
6565
#endif
6666

67-
int apache_php_module_main(request_rec *r, int fd, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC);
67+
int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC);
6868
void php_save_umask(void);
6969
void php_restore_umask(void);
7070
int sapi_apache_read_post(char *buffer, uint count_bytes SLS_DC);
@@ -443,7 +443,7 @@ static char *php_apache_get_default_mimetype(request_rec *r SLS_DC)
443443

444444
int send_php(request_rec *r, int display_source_mode, char *filename)
445445
{
446-
int fd, retval;
446+
int retval;
447447
HashTable *per_dir_conf;
448448
SLS_FETCH();
449449
ELS_FETCH();
@@ -480,11 +480,6 @@ int send_php(request_rec *r, int display_source_mode, char *filename)
480480
if (filename == NULL) {
481481
filename = r->filename;
482482
}
483-
/* Open the file */
484-
if ((fd = popenf(r->pool, filename, O_RDONLY, 0)) == -1) {
485-
log_reason("file permissions deny server access", filename, r);
486-
return FORBIDDEN;
487-
}
488483

489484
/* Apache 1.2 has a more complex mechanism for reading POST data */
490485
#if MODULE_MAGIC_NUMBER > 19961007
@@ -518,12 +513,11 @@ int send_php(request_rec *r, int display_source_mode, char *filename)
518513
add_cgi_vars(r);
519514

520515
init_request_info(SLS_C);
521-
apache_php_module_main(r, fd, display_source_mode CLS_CC ELS_CC PLS_CC SLS_CC);
516+
apache_php_module_main(r, display_source_mode CLS_CC ELS_CC PLS_CC SLS_CC);
522517

523518
/* Done, restore umask, turn off timeout, close file and return */
524519
php_restore_umask();
525520
kill_timeout(r);
526-
pclosef(r->pool, fd);
527521
return OK;
528522
}
529523

sapi/apache/sapi_apache.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,23 +59,18 @@
5959
/*#include "mod_php4.h"*/
6060

6161

62-
int apache_php_module_main(request_rec *r, int fd, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC)
62+
int apache_php_module_main(request_rec *r, int display_source_mode CLS_DC ELS_DC PLS_DC SLS_DC)
6363
{
6464
zend_file_handle file_handle;
6565

6666
if (php_request_startup(CLS_C ELS_CC PLS_CC SLS_CC) == FAILURE) {
6767
return FAILURE;
6868
}
69-
#ifdef PHP_WIN32
7069
/* sending a file handle to another dll is not working
7170
// so let zend open it.
7271
*/
7372
file_handle.type = ZEND_HANDLE_FILENAME;
7473
file_handle.handle.fd = 0;
75-
#else
76-
file_handle.type = ZEND_HANDLE_FD;
77-
file_handle.handle.fd = fd;
78-
#endif
7974
file_handle.filename = SG(request_info).path_translated;
8075
file_handle.free_filename = 0;
8176

0 commit comments

Comments
 (0)