close-on-exec

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23448 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-07-27 12:09:22 +00:00
parent dbc55c9bec
commit d6c66ef961

View File

@@ -291,6 +291,7 @@ send_via_proxy (krb5_context context,
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol); s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
if (s < 0) if (s < 0)
continue; continue;
rk_cloexec(s);
if (connect (s, a->ai_addr, a->ai_addrlen) < 0) { if (connect (s, a->ai_addr, a->ai_addrlen) < 0) {
close (s); close (s);
continue; continue;
@@ -413,6 +414,7 @@ krb5_sendto (krb5_context context,
fd = socket (a->ai_family, a->ai_socktype, a->ai_protocol); fd = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
if (fd < 0) if (fd < 0)
continue; continue;
rk_cloexec(fd);
if (connect (fd, a->ai_addr, a->ai_addrlen) < 0) { if (connect (fd, a->ai_addr, a->ai_addrlen) < 0) {
close (fd); close (fd);
continue; continue;