summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2016-08-11 11:15:58 +1000
committerMartin Schwenke <martins@samba.org>2016-08-17 23:00:25 +0200
commit6d1099a522de129cee8cdf9183ab3aaabe0592db (patch)
tree83bb868ac2c40511044fb61312263fb0751c447d
parent198ca8839175e93988ee52e033195238064aaba5 (diff)
downloadsamba-6d1099a522de129cee8cdf9183ab3aaabe0592db.tar.gz
ctdb-common: Fix CID 1362729 Unchecked return value from library
Drop setting socket non-blocking and close-on-exec. The socket is closed soon after. Only a single packet is sent, making it almost impossible for it to block. Also, note that sockets aren't setup this way for IPv6. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12157 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rw-r--r--ctdb/common/system_aix.c3
-rw-r--r--ctdb/common/system_freebsd.c3
-rw-r--r--ctdb/common/system_gnu.c3
-rw-r--r--ctdb/common/system_kfreebsd.c3
-rw-r--r--ctdb/common/system_linux.c3
5 files changed, 0 insertions, 15 deletions
diff --git a/ctdb/common/system_aix.c b/ctdb/common/system_aix.c
index 48cd7817c91..10798a7d42f 100644
--- a/ctdb/common/system_aix.c
+++ b/ctdb/common/system_aix.c
@@ -143,9 +143,6 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
return -1;
}
- set_blocking(s, false);
- set_close_on_exec(s);
-
memset(&ip4pkt, 0, sizeof(ip4pkt));
ip4pkt.ip.ip_v = 4;
ip4pkt.ip.ip_hl = sizeof(ip4pkt.ip)/4;
diff --git a/ctdb/common/system_freebsd.c b/ctdb/common/system_freebsd.c
index a03b97ad2f3..ca1300a74ce 100644
--- a/ctdb/common/system_freebsd.c
+++ b/ctdb/common/system_freebsd.c
@@ -180,9 +180,6 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
return -1;
}
- set_blocking(s, false);
- set_close_on_exec(s);
-
ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0,
(const struct sockaddr *)&dest->ip,
sizeof(dest->ip));
diff --git a/ctdb/common/system_gnu.c b/ctdb/common/system_gnu.c
index 09c4ffef8e9..0eed47e4e05 100644
--- a/ctdb/common/system_gnu.c
+++ b/ctdb/common/system_gnu.c
@@ -178,9 +178,6 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
return -1;
}
- set_blocking(s, false);
- set_close_on_exec(s);
-
ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0, &dest->ip, sizeof(dest->ip));
close(s);
if (ret != sizeof(ip4pkt)) {
diff --git a/ctdb/common/system_kfreebsd.c b/ctdb/common/system_kfreebsd.c
index 56f7c1c75f0..87624d69bba 100644
--- a/ctdb/common/system_kfreebsd.c
+++ b/ctdb/common/system_kfreebsd.c
@@ -178,9 +178,6 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
return -1;
}
- set_blocking(s, false);
- set_close_on_exec(s);
-
ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0, &dest->ip, sizeof(dest->ip));
close(s);
if (ret != sizeof(ip4pkt)) {
diff --git a/ctdb/common/system_linux.c b/ctdb/common/system_linux.c
index b66ce670288..bf022e3ada0 100644
--- a/ctdb/common/system_linux.c
+++ b/ctdb/common/system_linux.c
@@ -386,9 +386,6 @@ int ctdb_sys_send_tcp(const ctdb_sock_addr *dest,
return -1;
}
- set_blocking(s, false);
- set_close_on_exec(s);
-
ret = sendto(s, &ip4pkt, sizeof(ip4pkt), 0,
(const struct sockaddr *)&dest->ip,
sizeof(dest->ip));