From: Ilia Alshanetsky Date: Mon, 23 Sep 2002 18:51:34 +0000 (+0000) Subject: Fixed bug #17466 X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~221 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=44d42b8e1345ef5bcfeb44dc2ccfce8515878289;p=php Fixed bug #17466 --- diff --git a/sapi/apache2filter/php_apache.h b/sapi/apache2filter/php_apache.h index d65bc6de3c..0fde7c515e 100644 --- a/sapi/apache2filter/php_apache.h +++ b/sapi/apache2filter/php_apache.h @@ -38,6 +38,8 @@ typedef struct php_struct { int post_len; /* Index for reading from buffer */ int post_idx; + /* stat structure of the current file */ + struct stat finfo; /* Buffer for request body filter */ char *post_data; /* Whether or not we've processed PHP in the output filters yet. */ diff --git a/sapi/apache2filter/sapi_apache2.c b/sapi/apache2filter/sapi_apache2.c index db396ace0c..33bc5a4242 100644 --- a/sapi/apache2filter/sapi_apache2.c +++ b/sapi/apache2filter/sapi_apache2.c @@ -149,6 +149,23 @@ php_apache_sapi_read_post(char *buf, uint count_bytes TSRMLS_DC) return n; } +static struct stat* +php_apache_sapi_get_stat(TSRMLS_D) +{ + php_struct *ctx = SG(server_context); + + ctx->finfo.st_uid = ctx->r->finfo.user; + ctx->finfo.st_gid = ctx->r->finfo.group; + ctx->finfo.st_ino = ctx->r->finfo.inode; + ctx->finfo.st_atime = ctx->r->finfo.atime/1000000; + ctx->finfo.st_mtime = ctx->r->finfo.mtime/1000000; + ctx->finfo.st_ctime = ctx->r->finfo.ctime/1000000; + ctx->finfo.st_size = ctx->r->finfo.size; + ctx->finfo.st_nlink = ctx->r->finfo.nlink; + + return &ctx->finfo; +} + static char * php_apache_sapi_read_cookies(TSRMLS_D) { @@ -264,7 +281,7 @@ static sapi_module_struct apache2_sapi_module = { php_apache_sapi_ub_write, /* unbuffered write */ php_apache_sapi_flush, /* flush */ - NULL, /* get uid */ + php_apache_sapi_get_stat, /* get uid */ php_apache_sapi_getenv, /* getenv */ php_error, /* error handler */