[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Tue Oct 27 13:58:21 UTC 2015


The branch, master has been updated
       via  21cb6c8 torture: Use a short torture socket dir
       via  be46c97 swrap: Fix recvmsg() with UDP
      from  73b2b4f swrap: Fix compare of signed and unsigned integer expressions

https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 21cb6c86761c6a2db85a81d85395315d83f0cb52
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Oct 27 10:03:06 2015 +0100

    torture: Use a short torture socket dir
    
    This makes sure we do not run into a regression.
    
    Thanks to Grigorij Demidov <grigorii.demidov at nic.cz>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

commit be46c97142b9e79c45c8fdf078ac5245813738ba
Author: Andreas Schneider <asn at samba.org>
Date:   Tue Oct 27 09:26:40 2015 +0100

    swrap: Fix recvmsg() with UDP
    
    This worked if the unix path was bigger than sizeof(struct sockaddr_in6).
    With a short unix socket pathname the buffer was to small to store the
    address and convert_un_in() failed.
    
    Thanks to Grigorij Demidov <grigorii.demidov at nic.cz>
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 src/socket_wrapper.c | 10 ++++++++++
 tests/torture.c      |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 6691738..3c0c279 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -4603,6 +4603,9 @@ static ssize_t swrap_recvmsg(int s, struct msghdr *omsg, int flags)
 	struct swrap_address from_addr = {
 		.sa_socklen = sizeof(struct sockaddr_un),
 	};
+	struct swrap_address convert_addr = {
+		.sa_socklen = sizeof(struct sockaddr_storage),
+	};
 	struct socket_info *si;
 	struct msghdr msg;
 	struct iovec tmp;
@@ -4661,6 +4664,13 @@ static ssize_t swrap_recvmsg(int s, struct msghdr *omsg, int flags)
 	}
 #endif
 
+	/*
+	 * We convert the unix address to a IP address so we need a buffer
+	 * which can store the address in case of SOCK_DGRAM, see below.
+	 */
+	msg.msg_name = &convert_addr.sa;
+	msg.msg_namelen = convert_addr.sa_socklen;
+
 	rc = swrap_recvmsg_after(s,
 				 si,
 				 &msg,
diff --git a/tests/torture.c b/tests/torture.c
index 821f0ab..d3ad84a 100644
--- a/tests/torture.c
+++ b/tests/torture.c
@@ -55,7 +55,7 @@
 #define TORTURE_ECHO_SRV_IPV6 "fd00::5357:5f0a"
 #define TORTURE_ECHO_SRV_PORT 7
 
-#define TORTURE_SOCKET_DIR "/tmp/test_socket_wrapper_XXXXXX"
+#define TORTURE_SOCKET_DIR "/tmp/w_XXXXXX"
 #define TORTURE_ECHO_SRV_PIDFILE "echo_srv.pid"
 #define TORTURE_PCAP_FILE "socket_trace.pcap"
 


-- 
Socket Wrapper Repository



More information about the samba-cvs mailing list