diff options
author | Sascha Schumann <sas@php.net> | 2003-01-21 11:03:58 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2003-01-21 11:03:58 +0000 |
commit | 294e776d950f7393faad5a96988c5122edf23e66 (patch) | |
tree | 491aeb9c2026d989229e120736dd499a74ff04aa /sapi/apache/mod_php4.c | |
parent | 961c9856ef2871325d5eb06760acb454e1b39c9e (diff) | |
download | php-git-294e776d950f7393faad5a96988c5122edf23e66.tar.gz |
add sapi_get_target_uid/_gid for obtaining information about the
non-privileged user the web server is running as. this is useful
for creating shared memory segments which need to be accessed by
the child processes/threads.
Diffstat (limited to 'sapi/apache/mod_php4.c')
-rw-r--r-- | sapi/apache/mod_php4.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/sapi/apache/mod_php4.c b/sapi/apache/mod_php4.c index 0f9eaeb074..0a14fd6804 100644 --- a/sapi/apache/mod_php4.c +++ b/sapi/apache/mod_php4.c @@ -20,6 +20,7 @@ /* $Id$ */ #include "php_apache_http.h" +#include "http_conf_globals.h" #ifdef NETWARE #define SIGPIPE SIGINT @@ -371,6 +372,22 @@ static int sapi_apache_force_http_10(TSRMLS_D) return 0; } +/* {{{ sapi_apache_get_target_uid + */ +static int sapi_apache_get_target_uid(uid_t *obj TSRMLS_DC) +{ + *obj = ap_user_id; + return 0; +} + +/* {{{ sapi_apache_get_target_gid + */ +static int sapi_apache_get_target_gid(gid_t *obj TSRMLS_DC) +{ + *obj = ap_group_id; + return 0; +} + /* {{{ sapi_module_struct apache_sapi_module */ static sapi_module_struct apache_sapi_module = { @@ -415,7 +432,9 @@ static sapi_module_struct apache_sapi_module = { NULL, /* exe location */ 0, /* ini ignore */ sapi_apache_get_fd, - sapi_apache_force_http_10 + sapi_apache_force_http_10, + sapi_apache_get_target_uid, + sapi_apache_get_target_gid }; /* }}} */ |