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.
This commit is contained in:
Sascha Schumann 2003-01-21 11:03:58 +00:00
parent 961c9856ef
commit 294e776d95
3 changed files with 46 additions and 1 deletions

View file

@ -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
};
/* }}} */