diff options
author | Pierre Joye <pajoye@php.net> | 2008-12-11 10:22:12 +0000 |
---|---|---|
committer | Pierre Joye <pajoye@php.net> | 2008-12-11 10:22:12 +0000 |
commit | cd57fe323d3373c6d0137ed95f9143e025a3f9a5 (patch) | |
tree | 57f7fdd848fb34ee724800aff0c30641fa2e32ec /sapi/cgi | |
parent | 4faa1f1624e67df783678a7bdef1189877a086b3 (diff) | |
download | php-git-cd57fe323d3373c6d0137ed95f9143e025a3f9a5.tar.gz |
- WS
Diffstat (limited to 'sapi/cgi')
-rw-r--r-- | sapi/cgi/fastcgi.c | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/sapi/cgi/fastcgi.c b/sapi/cgi/fastcgi.c index 559ef22b20..42be67fc45 100644 --- a/sapi/cgi/fastcgi.c +++ b/sapi/cgi/fastcgi.c @@ -267,63 +267,63 @@ void fcgi_shutdown(void) */ static PACL prepare_named_pipe_acl(PSECURITY_DESCRIPTOR sd, LPSECURITY_ATTRIBUTES sa) { - DWORD req_acl_size; - char everyone_buf[32], owner_buf[32]; - PSID sid_everyone, sid_owner; - SID_IDENTIFIER_AUTHORITY - siaWorld = SECURITY_WORLD_SID_AUTHORITY, - siaCreator = SECURITY_CREATOR_SID_AUTHORITY; - PACL acl; + DWORD req_acl_size; + char everyone_buf[32], owner_buf[32]; + PSID sid_everyone, sid_owner; + SID_IDENTIFIER_AUTHORITY + siaWorld = SECURITY_WORLD_SID_AUTHORITY, + siaCreator = SECURITY_CREATOR_SID_AUTHORITY; + PACL acl; - sid_everyone = (PSID)&everyone_buf; - sid_owner = (PSID)&owner_buf; + sid_everyone = (PSID)&everyone_buf; + sid_owner = (PSID)&owner_buf; - req_acl_size = sizeof(ACL) + - (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + GetSidLengthRequired(1))); + req_acl_size = sizeof(ACL) + + (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + GetSidLengthRequired(1))); - acl = malloc(req_acl_size); + acl = malloc(req_acl_size); - if (acl == NULL) { - return NULL; - } + if (acl == NULL) { + return NULL; + } - if (!InitializeSid(sid_everyone, &siaWorld, 1)) { - goto out_fail; - } - *GetSidSubAuthority(sid_everyone, 0) = SECURITY_WORLD_RID; + if (!InitializeSid(sid_everyone, &siaWorld, 1)) { + goto out_fail; + } + *GetSidSubAuthority(sid_everyone, 0) = SECURITY_WORLD_RID; - if (!InitializeSid(sid_owner, &siaCreator, 1)) { - goto out_fail; - } - *GetSidSubAuthority(sid_owner, 0) = SECURITY_CREATOR_OWNER_RID; + if (!InitializeSid(sid_owner, &siaCreator, 1)) { + goto out_fail; + } + *GetSidSubAuthority(sid_owner, 0) = SECURITY_CREATOR_OWNER_RID; - if (!InitializeAcl(acl, req_acl_size, ACL_REVISION)) { - goto out_fail; - } + if (!InitializeAcl(acl, req_acl_size, ACL_REVISION)) { + goto out_fail; + } - if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_GENERIC_READ | FILE_GENERIC_WRITE, sid_everyone)) { - goto out_fail; - } + if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_GENERIC_READ | FILE_GENERIC_WRITE, sid_everyone)) { + goto out_fail; + } - if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_ALL_ACCESS, sid_owner)) { - goto out_fail; - } + if (!AddAccessAllowedAce(acl, ACL_REVISION, FILE_ALL_ACCESS, sid_owner)) { + goto out_fail; + } - if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) { - goto out_fail; - } + if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) { + goto out_fail; + } - if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) { - goto out_fail; - } + if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) { + goto out_fail; + } - sa->lpSecurityDescriptor = sd; + sa->lpSecurityDescriptor = sd; - return acl; + return acl; out_fail: - free(acl); - return NULL; + free(acl); + return NULL; } #endif @@ -397,9 +397,9 @@ int fcgi_listen(const char *path, int backlog) } } else { #ifdef _WIN32 - SECURITY_DESCRIPTOR sd; - SECURITY_ATTRIBUTES sa; - PACL acl; + SECURITY_DESCRIPTOR sd; + SECURITY_ATTRIBUTES sa; + PACL acl; HANDLE namedPipe; memset(&sa, 0, sizeof(sa)); @@ -514,8 +514,8 @@ void fcgi_init_request(fcgi_request *req, int listen_socket) req->in_len = 0; req->in_pad = 0; - req->out_hdr = NULL; - req->out_pos = req->out_buf; + req->out_hdr = NULL; + req->out_pos = req->out_buf; #ifdef _WIN32 req->tcp = !GetNamedPipeInfo((HANDLE)_get_osfhandle(req->listen_socket), NULL, NULL, NULL, NULL); @@ -960,13 +960,13 @@ int fcgi_accept_request(fcgi_request *req) int n = 0; int allowed = 0; - while (allowed_clients[n] != INADDR_NONE) { - if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { - allowed = 1; - break; - } - n++; - } + while (allowed_clients[n] != INADDR_NONE) { + if (allowed_clients[n] == sa.sa_inet.sin_addr.s_addr) { + allowed = 1; + break; + } + n++; + } if (!allowed) { fprintf(stderr, "Connection from disallowed IP address '%s' is dropped.\n", inet_ntoa(sa.sa_inet.sin_addr)); closesocket(req->fd); |