aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2018-11-13 18:44:39 +0100
committerAndreas Schneider <asn@samba.org>2018-11-13 19:15:51 +0100
commit97314589dec9feca4c10c2350dfbd7702ff44cb1 (patch)
treeea1e397de692992f29e944ceba40606cd615afc6 /src
parent9b01066059a002d15996d797d911fdd693e29cb7 (diff)
downloadsocket_wrapper-97314589dec9feca4c10c2350dfbd7702ff44cb1.tar.gz
socket_wrapper-97314589dec9feca4c10c2350dfbd7702ff44cb1.tar.xz
socket_wrapper-97314589dec9feca4c10c2350dfbd7702ff44cb1.zip
swrap: Do not log if we are over the limit in find_socket_info_index()
There are applications which do: for (fd = 0; fd <= getdtablesize(); fd++) { close(fd) }; This produced millions of error messsages. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'src')
-rw-r--r--src/socket_wrapper.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index e02f083..df70df5 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1540,11 +1540,23 @@ static int find_socket_info_index(int fd)
}
if ((size_t)fd >= socket_fds_max) {
+ /*
+ * Do not add a log here as some applications do stupid things
+ * like:
+ *
+ * for (fd = 0; fd <= getdtablesize(); fd++) {
+ * close(fd)
+ * };
+ *
+ * This would produce millions of lines of debug messages.
+ */
+#if 0
SWRAP_LOG(SWRAP_LOG_ERROR,
- "The max socket index limit of %zu has been reached, "
- "trying to add %d",
- socket_fds_max,
- fd);
+ "Looking for a socket info for the fd %d is over the "
+ "max socket index limit of %zu.",
+ fd,
+ socket_fds_max);
+#endif
return -1;
}