[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Thu Mar 21 13:42:05 UTC 2019


The branch, master has been updated
       via  44d9c59 Bump version to 1.2.3
       via  51d8982 swrap: Add missing NULL checks to socket_wrapper_dir()
       via  b8dc4da swrap: Print a warning if SOCKET_WRAPPER_DIR is not set
      from  a3a3dca Bump version to 1.2.2

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


- Log -----------------------------------------------------------------
commit 44d9c597963c49b739c40f6364b7882eb890f194
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Mar 21 14:18:12 2019 +0100

    Bump version to 1.2.3
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit 51d8982627f0da1715d196fd75ec17d6579a57b0
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Mar 21 14:09:37 2019 +0100

    swrap: Add missing NULL checks to socket_wrapper_dir()
    
    This return either malloc'ed memory or NULL. Make sure there is no
    problem.
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

commit b8dc4da6cb4903fce8f7b468c17caf12e3394c6b
Author: Andreas Schneider <asn at samba.org>
Date:   Thu Mar 21 14:09:19 2019 +0100

    swrap: Print a warning if SOCKET_WRAPPER_DIR is not set
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Ralph Boehme <slow at samba.org>

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

Summary of changes:
 CMakeLists.txt       |  4 ++--
 ChangeLog            |  4 ++++
 src/socket_wrapper.c | 20 ++++++++++++++++++++
 3 files changed, 26 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ab7254c..ef14e57 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 
-project(socket_wrapper VERSION 1.2.2 LANGUAGES C)
+project(socket_wrapper VERSION 1.2.3 LANGUAGES C)
 
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})
@@ -23,7 +23,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
 #     Increment AGE. Set REVISION to 0
 #   If the source code was changed, but there were no interface changes:
 #     Increment REVISION.
-set(LIBRARY_VERSION "0.1.12")
+set(LIBRARY_VERSION "0.1.13")
 set(LIBRARY_SOVERSION "0")
 
 # add definitions
diff --git a/ChangeLog b/ChangeLog
index d0a7285..04a4245 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 ChangeLog
 ==========
 
+version 1.2.3 (released 2019-03-21)
+  * Fixed missing NULL check for socket_wrapper_dir()
+  * Fixes building in Samba source tree
+
 version 1.2.2 (released 2019-03-21)
   * Added environment variable to disable deep binding
   * Fixed installation of socket_wrapper
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 7841c85..5b82e0c 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1288,6 +1288,7 @@ static char *socket_wrapper_dir(void)
 	char *s = getenv("SOCKET_WRAPPER_DIR");
 
 	if (s == NULL) {
+		SWRAP_LOG(SWRAP_LOG_WARN, "SOCKET_WRAPPER_DIR not set\n");
 		return NULL;
 	}
 
@@ -1818,6 +1819,10 @@ static int convert_in_un_remote(struct socket_info *si, const struct sockaddr *i
 	}
 
 	swrap_dir = socket_wrapper_dir();
+	if (swrap_dir == NULL) {
+		errno = EINVAL;
+		return -1;
+	}
 
 	if (is_bcast) {
 		snprintf(un->sun_path, sizeof(un->sun_path),
@@ -1988,6 +1993,10 @@ static int convert_in_un_alloc(struct socket_info *si, const struct sockaddr *in
 	}
 
 	swrap_dir = socket_wrapper_dir();
+	if (swrap_dir == NULL) {
+		errno = EINVAL;
+		return -1;
+	}
 
 	if (prt == 0) {
 		/* handle auto-allocation of ephemeral ports */
@@ -3582,6 +3591,11 @@ static int swrap_auto_bind(int fd, struct socket_info *si, int family)
 	}
 
 	swrap_dir = socket_wrapper_dir();
+	if (swrap_dir == NULL) {
+		errno = EINVAL;
+		ret = -1;
+		goto done;
+	}
 
 	for (i = 0; i < SOCKET_MAX_SOCKETS; i++) {
 		port = autobind_start + i;
@@ -5387,6 +5401,9 @@ static ssize_t swrap_sendto(int s, const void *buf, size_t len, int flags,
 		type = SOCKET_TYPE_CHAR_UDP;
 
 		swrap_dir = socket_wrapper_dir();
+		if (swrap_dir == NULL) {
+			return -1;
+		}
 
 		for(iface=0; iface <= MAX_WRAPPED_INTERFACES; iface++) {
 			snprintf(un_addr.sa.un.sun_path,
@@ -5892,6 +5909,9 @@ static ssize_t swrap_sendmsg(int s, const struct msghdr *omsg, int flags)
 		type = SOCKET_TYPE_CHAR_UDP;
 
 		swrap_dir = socket_wrapper_dir();
+		if (swrap_dir == NULL) {
+			return -1;
+		}
 
 		for(iface=0; iface <= MAX_WRAPPED_INTERFACES; iface++) {
 			snprintf(un_addr.sun_path, sizeof(un_addr.sun_path), "%s/"SOCKET_FORMAT,


-- 
Socket Wrapper Repository



More information about the samba-cvs mailing list