pajoye          Thu Dec 11 10:20:30 2008 UTC

  Modified files:              
    /php-src/sapi/cgi   fastcgi.c 
  Log:
  - WS
  
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/fastcgi.c?r1=1.51&r2=1.52&diff_format=u
Index: php-src/sapi/cgi/fastcgi.c
diff -u php-src/sapi/cgi/fastcgi.c:1.51 php-src/sapi/cgi/fastcgi.c:1.52
--- php-src/sapi/cgi/fastcgi.c:1.51     Thu Dec 11 00:15:05 2008
+++ php-src/sapi/cgi/fastcgi.c  Thu Dec 11 10:20:30 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: fastcgi.c,v 1.51 2008/12/11 00:15:05 pajoye Exp $ */
+/* $Id: fastcgi.c,v 1.52 2008/12/11 10:20:30 pajoye Exp $ */
 
 #include "php.h"
 #include "fastcgi.h"
@@ -267,63 +267,63 @@
  */
 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;
-
-  sid_everyone = (PSID)&everyone_buf;
-  sid_owner = (PSID)&owner_buf;
-
-  req_acl_size = sizeof(ACL) +
-    (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + 
GetSidLengthRequired(1)));
-
-  acl = malloc(req_acl_size);
-
-  if (acl == NULL) {
-    return NULL;
-  }
-
-  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 (!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_ALL_ACCESS, sid_owner)) {
-    goto out_fail;
-  }
-
-  if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) {
-    goto out_fail;
-  }
-
-  if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) {
-    goto out_fail;
-  }
+       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;
 
-  sa->lpSecurityDescriptor = sd;
+       sid_everyone = (PSID)&everyone_buf;
+       sid_owner = (PSID)&owner_buf;
 
-  return acl;
+       req_acl_size = sizeof(ACL) +
+               (2 * ((sizeof(ACCESS_ALLOWED_ACE) - sizeof(DWORD)) + 
GetSidLengthRequired(1)));
+
+       acl = malloc(req_acl_size);
+
+       if (acl == NULL) {
+               return NULL;
+       }
+
+       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 (!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_ALL_ACCESS, 
sid_owner)) {
+               goto out_fail;
+       }
+
+       if (!InitializeSecurityDescriptor(sd, SECURITY_DESCRIPTOR_REVISION)) {
+               goto out_fail;
+       }
+
+       if (!SetSecurityDescriptorDacl(sd, TRUE, acl, FALSE)) {
+               goto out_fail;
+       }
+
+       sa->lpSecurityDescriptor = sd;
+
+       return acl;
 
 out_fail:
-  free(acl);
-  return NULL;
+       free(acl);
+       return NULL;
 }
 #endif
 
@@ -960,13 +960,13 @@
                                                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);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to