diff options
author | Florian Weimer <fweimer@redhat.com> | 2017-04-19 07:45:04 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2017-04-19 07:45:04 +0200 |
commit | 2f83a7294d0d0904d72839843a80531769525d59 (patch) | |
tree | 709774c38a94b5b99735121ce1e5979605fa0ce0 /sysdeps | |
parent | e92030239abb4038d4f915d47021d6c037239309 (diff) | |
download | glibc-2f83a7294d0d0904d72839843a80531769525d59.tar glibc-2f83a7294d0d0904d72839843a80531769525d59.tar.gz glibc-2f83a7294d0d0904d72839843a80531769525d59.tar.bz2 glibc-2f83a7294d0d0904d72839843a80531769525d59.zip |
Create more sockets with SOCK_CLOEXEC [BZ #15722]
Diffstat (limited to 'sysdeps')
-rw-r--r-- | sysdeps/posix/getaddrinfo.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/check_native.c | 2 | ||||
-rw-r--r-- | sysdeps/unix/sysv/linux/ifaddrs.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/sysdeps/posix/getaddrinfo.c b/sysdeps/posix/getaddrinfo.c index eed7264850..a55cc39be7 100644 --- a/sysdeps/posix/getaddrinfo.c +++ b/sysdeps/posix/getaddrinfo.c @@ -2472,7 +2472,7 @@ getaddrinfo (const char *name, const char *service, close_retry: close_not_cancel_no_status (fd); af = q->ai_family; - fd = __socket (af, SOCK_DGRAM, IPPROTO_IP); + fd = __socket (af, SOCK_DGRAM | SOCK_CLOEXEC, IPPROTO_IP); } else { diff --git a/sysdeps/unix/sysv/linux/check_native.c b/sysdeps/unix/sysv/linux/check_native.c index 4a1646089f..7e5a7c9be3 100644 --- a/sysdeps/unix/sysv/linux/check_native.c +++ b/sysdeps/unix/sysv/linux/check_native.c @@ -41,7 +41,7 @@ void __check_native (uint32_t a1_index, int *a1_native, uint32_t a2_index, int *a2_native) { - int fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + int fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); struct sockaddr_nl nladdr; memset (&nladdr, '\0', sizeof (nladdr)); diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c index cff12c2ac4..3bc9902863 100644 --- a/sysdeps/unix/sysv/linux/ifaddrs.c +++ b/sysdeps/unix/sysv/linux/ifaddrs.c @@ -255,7 +255,7 @@ __netlink_open (struct netlink_handle *h) { struct sockaddr_nl nladdr; - h->fd = __socket (PF_NETLINK, SOCK_RAW, NETLINK_ROUTE); + h->fd = __socket (PF_NETLINK, SOCK_RAW | SOCK_CLOEXEC, NETLINK_ROUTE); if (h->fd < 0) goto out; |