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 /main | |
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 'main')
-rw-r--r-- | main/SAPI.c | 20 | ||||
-rw-r--r-- | main/SAPI.h | 6 |
2 files changed, 26 insertions, 0 deletions
diff --git a/main/SAPI.c b/main/SAPI.c index a11f98c953..d23ec9a4ef 100644 --- a/main/SAPI.c +++ b/main/SAPI.c @@ -869,6 +869,26 @@ SAPI_API int sapi_force_http_10(TSRMLS_D) } } + +SAPI_API int sapi_get_target_uid(uid_t *obj TSRMLS_DC) +{ + if (sapi_module.get_target_uid) { + return sapi_module.get_target_uid(obj TSRMLS_CC); + } else { + return -1; + } +} + +SAPI_API int sapi_get_target_gid(gid_t *obj TSRMLS_DC) +{ + if (sapi_module.get_target_gid) { + return sapi_module.get_target_gid(obj TSRMLS_CC); + } else { + return -1; + } +} + + /* * Local variables: * tab-width: 4 diff --git a/main/SAPI.h b/main/SAPI.h index 81235574ca..75c80fae41 100644 --- a/main/SAPI.h +++ b/main/SAPI.h @@ -190,6 +190,9 @@ SAPI_API void sapi_activate_headers_only(TSRMLS_D); SAPI_API int sapi_get_fd(int *fd TSRMLS_DC); SAPI_API int sapi_force_http_10(TSRMLS_D); +SAPI_API int sapi_get_target_uid(uid_t * TSRMLS_DC); +SAPI_API int sapi_get_target_gid(gid_t * TSRMLS_DC); + struct _sapi_module_struct { char *name; char *pretty_name; @@ -231,6 +234,9 @@ struct _sapi_module_struct { int (*get_fd)(int *fd TSRMLS_DC); int (*force_http_10)(TSRMLS_D); + + int (*get_target_uid)(uid_t * TSRMLS_DC); + int (*get_target_gid)(gid_t * TSRMLS_DC); }; |