httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jaillet...@apache.org
Subject svn commit: r1598946 - in /httpd/httpd/trunk: CHANGES modules/proxy/mod_proxy_fdpass.c
Date Sun, 01 Jun 2014 06:54:16 GMT
Author: jailletc36
Date: Sun Jun  1 06:54:15 2014
New Revision: 1598946

URL: http://svn.apache.org/r1598946
Log:
Fix computation of the size of 'struct sockaddr_un' when passed to 'connec()'.
Use the same logic as the one in ' in 'proxy_util.c'.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1598946&r1=1598945&r2=1598946&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sun Jun  1 06:54:15 2014
@@ -1,6 +1,10 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.0
 
+  *) mod_proxy_fdpass: Fix computation of the size of 'struct sockaddr_un'
+     when passed to 'connec()'.
+     [Graham Dumpleton <grahamd apache org>]
+
   *) mod_socache_shmcb: Correct counting of expirations for status display.
      Expirations happening during retrieval were not counted. [Rainer Jung]
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c?rev=1598946&r1=1598945&r2=1598946&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_fdpass.c Sun Jun  1 06:54:15 2014
@@ -55,6 +55,7 @@ static int proxy_fdpass_canon(request_re
 }
 
 /* TODO: In APR 2.x: Extend apr_sockaddr_t to possibly be a path !!! */
+/* XXX: The same function exists in proxy_util.c */
 static apr_status_t socket_connect_un(apr_socket_t *sock,
                                       struct sockaddr_un *sa)
 {
@@ -73,8 +74,9 @@ static apr_status_t socket_connect_un(ap
     }
 
     do {
-        rv = connect(rawsock, (struct sockaddr*)sa,
-                               sizeof(*sa) + strlen(sa->sun_path));
+        const socklen_t addrlen = APR_OFFSETOF(struct sockaddr_un, sun_path)
+                                  + strlen(sa->sun_path) + 1;
+        rv = connect(rawsock, (struct sockaddr*)sa, addrlen);
     } while (rv == -1 && errno == EINTR);
 
     if ((rv == -1) && (errno == EINPROGRESS || errno == EALREADY)



Mime
View raw message