Blame openssh-4.7p1-cloexec.patch
|
Tomáš Mráz |
2cb0e7 |
diff -up openssh-4.7p1/sshconnect.c.cloexec openssh-4.7p1/sshconnect.c
|
|
Tomáš Mráz |
2cb0e7 |
--- openssh-4.7p1/sshconnect.c.cloexec 2006-10-23 19:02:24.000000000 +0200
|
|
Tomáš Mráz |
2cb0e7 |
+++ openssh-4.7p1/sshconnect.c 2008-02-05 23:14:28.000000000 +0100
|
|
Tomáš Mráz |
2cb0e7 |
@@ -38,6 +38,7 @@
|
|
Tomáš Mráz |
2cb0e7 |
#include <stdlib.h>
|
|
Tomáš Mráz |
2cb0e7 |
#include <string.h>
|
|
Tomáš Mráz |
2cb0e7 |
#include <unistd.h>
|
|
Tomáš Mráz |
2cb0e7 |
+#include <fcntl.h>
|
|
Tomáš Mráz |
2cb0e7 |
|
|
Tomáš Mráz |
2cb0e7 |
#include "xmalloc.h"
|
|
Tomáš Mráz |
2cb0e7 |
#include "key.h"
|
|
Tomáš Mráz |
2cb0e7 |
@@ -189,8 +190,11 @@ ssh_create_socket(int privileged, struct
|
|
Tomáš Mráz |
2cb0e7 |
return sock;
|
|
Tomáš Mráz |
2cb0e7 |
}
|
|
Tomáš Mráz |
2cb0e7 |
sock = socket(ai->ai_family, ai->ai_socktype, ai->ai_protocol);
|
|
Tomáš Mráz |
2cb0e7 |
- if (sock < 0)
|
|
Tomáš Mráz |
2cb0e7 |
+ if (sock < 0) {
|
|
Tomáš Mráz |
2cb0e7 |
error("socket: %.100s", strerror(errno));
|
|
Tomáš Mráz |
2cb0e7 |
+ return -1;
|
|
Tomáš Mráz |
2cb0e7 |
+ }
|
|
Tomáš Mráz |
2cb0e7 |
+ fcntl(sock, F_SETFD, FD_CLOEXEC);
|
|
Tomáš Mráz |
2cb0e7 |
|
|
Tomáš Mráz |
2cb0e7 |
/* Bind the socket to an alternative local IP address */
|
|
Tomáš Mráz |
2cb0e7 |
if (options.bind_address == NULL)
|