Skip to content

Commit bf74d01

Browse files
committed
Removing #ifdefs around fcntl(FD_CLOSEXEC)
1 parent 8601d0c commit bf74d01

File tree

5 files changed

+0
-20
lines changed

5 files changed

+0
-20
lines changed

authfd.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ ssh_get_authentication_socket(int *fdp)
105105
if ((sock = socket(AF_UNIX, SOCK_STREAM, 0)) < 0)
106106
return SSH_ERR_SYSTEM_ERROR;
107107

108-
#ifndef WIN32_FIXME
109108
/* close on exec */
110109
if (fcntl(sock, F_SETFD, FD_CLOEXEC) == -1 ||
111110
connect(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) {
@@ -114,15 +113,6 @@ ssh_get_authentication_socket(int *fdp)
114113
errno = oerrno;
115114
return SSH_ERR_SYSTEM_ERROR;
116115
}
117-
#else
118-
if (
119-
connect(sock, (struct sockaddr *)&sunaddr, sizeof(sunaddr)) < 0) {
120-
oerrno = errno;
121-
close(sock);
122-
errno = oerrno;
123-
return SSH_ERR_SYSTEM_ERROR;
124-
}
125-
#endif /* #ifndef WIN32_FIXME */
126116

127117
if (fdp != NULL)
128118
*fdp = sock;

channels.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,12 @@ channel_register_fds(Channel *c, int rfd, int wfd, int efd,
253253
channel_max_fd = MAX(channel_max_fd, wfd);
254254
channel_max_fd = MAX(channel_max_fd, efd);
255255

256-
#ifndef WIN32_FIXME
257256
if (rfd != -1)
258257
fcntl(rfd, F_SETFD, FD_CLOEXEC);
259258
if (wfd != -1 && wfd != rfd)
260259
fcntl(wfd, F_SETFD, FD_CLOEXEC);
261260
if (efd != -1 && efd != rfd && efd != wfd)
262261
fcntl(efd, F_SETFD, FD_CLOEXEC);
263-
#endif
264262

265263
c->rfd = rfd;
266264
c->wfd = wfd;

serverloop.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ static int notify_pipe[2];
142142
static void
143143
notify_setup(void)
144144
{
145-
#ifndef WIN32_FIXME /* This was causing heap corruption */
146145
if (pipe(notify_pipe) < 0) {
147146
error("pipe(notify_pipe) failed %s", strerror(errno));
148147
} else if ((fcntl(notify_pipe[0], F_SETFD, FD_CLOEXEC) == -1) ||
@@ -155,9 +154,6 @@ notify_setup(void)
155154
set_nonblock(notify_pipe[1]);
156155
return;
157156
}
158-
#endif
159-
notify_pipe[0] = -1; /* read end */
160-
notify_pipe[1] = -1; /* write end */
161157
}
162158
static void
163159
notify_parent(void)

sshconnect.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,7 @@ ssh_create_socket(int privileged, struct addrinfo *ai)
414414
error("socket: %s", strerror(errno));
415415
return -1;
416416
}
417-
#ifndef WIN32_FIXME
418417
fcntl(sock, F_SETFD, FD_CLOEXEC);
419-
#endif
420418

421419
/* Bind the socket to an alternative local IP address */
422420
if (options.bind_address == NULL && !privileged)

sshd.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2900,11 +2900,9 @@ main(int ac, char **av)
29002900
#endif /* !WIN32_FIXME */
29012901
}
29022902

2903-
#ifndef WIN32_FIXME
29042903
/* Executed child processes don't need these. */
29052904
fcntl(sock_out, F_SETFD, FD_CLOEXEC);
29062905
fcntl(sock_in, F_SETFD, FD_CLOEXEC);
2907-
#endif
29082906

29092907
/*
29102908
* Disable the key regeneration alarm. We will not regenerate the

0 commit comments

Comments
 (0)