use SOCK_CLOEXEC
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@23517 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -577,7 +577,7 @@ change_password_loop (krb5_context context,
|
|||||||
for (a = ai; !done && a != NULL; a = a->ai_next) {
|
for (a = ai; !done && a != NULL; a = a->ai_next) {
|
||||||
int replied = 0;
|
int replied = 0;
|
||||||
|
|
||||||
sock = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
|
sock = socket (a->ai_family, a->ai_socktype | SOCK_CLOEXEC, a->ai_protocol);
|
||||||
if (sock < 0)
|
if (sock < 0)
|
||||||
continue;
|
continue;
|
||||||
rk_cloexec(sock);
|
rk_cloexec(sock);
|
||||||
|
@@ -105,7 +105,7 @@ try_unix_socket(krb5_context context,
|
|||||||
krb5_error_code ret;
|
krb5_error_code ret;
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
fd = socket(AF_UNIX, SOCK_STREAM, 0);
|
fd = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
return KRB5_CC_IO;
|
return KRB5_CC_IO;
|
||||||
rk_cloexec(fd);
|
rk_cloexec(fd);
|
||||||
|
@@ -180,6 +180,11 @@ struct _krb5_krb_auth_data;
|
|||||||
#define O_CLOEXEC 0
|
#define O_CLOEXEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef SOCK_CLOEXEC
|
||||||
|
#define SOCK_CLOEXEC 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#define KRB5_BUFSIZ 1024
|
#define KRB5_BUFSIZ 1024
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@@ -288,7 +288,7 @@ send_via_proxy (krb5_context context,
|
|||||||
return krb5_eai_to_heim_errno(ret, errno);
|
return krb5_eai_to_heim_errno(ret, errno);
|
||||||
|
|
||||||
for (a = ai; a != NULL; a = a->ai_next) {
|
for (a = ai; a != NULL; a = a->ai_next) {
|
||||||
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
|
s = socket (a->ai_family, a->ai_socktype, a->ai_protocol | SOCK_CLOEXEC);
|
||||||
if (s < 0)
|
if (s < 0)
|
||||||
continue;
|
continue;
|
||||||
rk_cloexec(s);
|
rk_cloexec(s);
|
||||||
@@ -411,7 +411,7 @@ krb5_sendto (krb5_context context,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
for (a = ai; a != NULL; a = a->ai_next) {
|
for (a = ai; a != NULL; a = a->ai_next) {
|
||||||
fd = socket (a->ai_family, a->ai_socktype, a->ai_protocol);
|
fd = socket (a->ai_family, a->ai_socktype | SOCK_CLOEXEC, a->ai_protocol);
|
||||||
if (fd < 0)
|
if (fd < 0)
|
||||||
continue;
|
continue;
|
||||||
rk_cloexec(fd);
|
rk_cloexec(fd);
|
||||||
|
Reference in New Issue
Block a user