The attached patch fixes <http://bugs.php.net/bug.php?id=17858>. Please 
apply. This is definitely a bug people want fixed. There are nine votes 
for it. The patch has been downloaded from my webpage 59 times. It's 
apparently linked to by linuxfr.org. I sent it to this list a week ago 
and got no response.

It doesn't help if people are using non-file generators, but that's 
gotta be like 1% of the usage.

-- 
Scott Lamb
Index: sapi/apache2filter/sapi_apache2.c
===================================================================
RCS file: /repository/php4/sapi/apache2filter/sapi_apache2.c,v
retrieving revision 1.81
diff -u -r1.81 sapi_apache2.c
--- sapi/apache2filter/sapi_apache2.c   28 Jun 2002 14:45:10 -0000      1.81
+++ sapi/apache2filter/sapi_apache2.c   19 Jul 2002 03:50:38 -0000
@@ -208,6 +208,18 @@
        }
 }
 
+static struct stat *php_apache_sapi_get_stat(TSRMLS_D)
+{
+       request_rec *rec;
+       rec = ((php_struct*)SG(server_context))->r;
+       if (stat(rec->canonical_filename, &SG(global_stat)) != 0) {
+               ap_log_error(APLOG_MARK, APLOG_ERR | APLOG_STARTUP,
+                                        0, NULL, "Can't stat \"%s\"", 
+rec->canonical_filename);
+               return NULL;
+       }
+       return &SG(global_stat);
+}
+
 static void php_apache_sapi_log_message(char *msg)
 {
        php_struct *ctx;
@@ -242,7 +254,7 @@
 
        php_apache_sapi_ub_write,                               /* unbuffered write */
        php_apache_sapi_flush,                                  /* flush */
-       NULL,                                                                   /* get 
uid */
+       php_apache_sapi_get_stat,                               /* get uid */
        NULL,                                                                   /* 
getenv */
 
        php_error,                                                              /* 
error handler */

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to