[SCM] Socket Wrapper Repository - branch master updated

Andreas Schneider asn at samba.org
Fri Nov 4 09:54:53 UTC 2016


The branch, master has been updated
       via  888a62e swrap: Add sanity check in socket_wrapper_max_sockets()
      from  057a956 tests: Clean-up max_sockets test case

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


- Log -----------------------------------------------------------------
commit 888a62e2c81370ab32e9bc790f12419148bd8972
Author: Andreas Schneider <asn at samba.org>
Date:   Fri Nov 4 09:44:04 2016 +0100

    swrap: Add sanity check in socket_wrapper_max_sockets()
    
    CID 153962
    
    Signed-off-by: Andreas Schneider <asn at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

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

Summary of changes:
 src/socket_wrapper.c | 7 +++++++
 1 file changed, 7 insertions(+)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ece5a10..186b696 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -259,6 +259,8 @@ do { \
  */
 #define SOCKET_WRAPPER_MAX_SOCKETS_DEFAULT 65535
 
+#define SOCKET_WRAPPER_MAX_SOCKETS_LIMIT 256000
+
 /* This limit is to avoid broadcast sendto() needing to stat too many
  * files.  It may be raised (with a performance cost) to up to 254
  * without changing the format above */
@@ -1141,6 +1143,11 @@ static size_t socket_wrapper_max_sockets(void)
 	if (s == endp) {
 		goto done;
 	}
+	if (tmp == 0 || tmp > SOCKET_WRAPPER_MAX_SOCKETS_LIMIT) {
+		SWRAP_LOG(SWRAP_LOG_ERROR,
+			  "Invalid number of sockets specified, using default.");
+		goto done;
+	}
 
 	max_sockets = tmp;
 


-- 
Socket Wrapper Repository



More information about the samba-cvs mailing list