diff options
| author | Shane Caraveo <shane@php.net> | 2002-03-18 04:48:34 +0000 |
|---|---|---|
| committer | Shane Caraveo <shane@php.net> | 2002-03-18 04:48:34 +0000 |
| commit | c806dca62cc881759aeb0c7c1d5a92a3326fed06 (patch) | |
| tree | 776af278a4d8b51608812d1d9aa9a12e48e11a47 /sapi/cgi/cgi_main.c | |
| parent | b84c61f314ea568feb9f9a3f83475e75c57d0e9b (diff) | |
| download | php-git-c806dca62cc881759aeb0c7c1d5a92a3326fed06.tar.gz | |
add security impersonation feature for running under IIS security
Diffstat (limited to 'sapi/cgi/cgi_main.c')
| -rw-r--r-- | sapi/cgi/cgi_main.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index d45037150e..a94b26669d 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -81,6 +81,9 @@ #ifdef PHP_FASTCGI #include "fcgi_config.h" #include "fcgiapp.h" +/* don't want to include fcgios.h, causes conflicts */ +extern int OS_SetImpersonate(void); + FCGX_Stream *in, *out, *err; FCGX_ParamArray envp; @@ -475,6 +478,9 @@ int main(int argc, char *argv[]) int max_requests = 500; int requests = 0; int fastcgi = !FCGX_IsCGI(); +#ifdef PHP_WIN32 + int impersonate = 0; +#endif if (fastcgi) { /* Calculate environment size */ @@ -729,6 +735,18 @@ If you are running IIS, you may safely set cgi.force_redirect=0 in php.ini.\n\ #ifdef PHP_FASTCGI /* start of FAST CGI loop */ + +#ifdef PHP_WIN32 + /* attempt to set security impersonation for fastcgi + will only happen on NT based OS, others will ignore it. */ + if (fastcgi) { + if (cfg_get_long("fastcgi.impersonate", &impersonate) == FAILURE) { + impersonate = 0; + } + if (impersonate) OS_SetImpersonate(); + } +#endif + while (!fastcgi || FCGX_Accept( &in, &out, &err, &cgi_env ) >= 0) { |
