summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog4
-rw-r--r--monitor_fdpass.c28
2 files changed, 7 insertions, 25 deletions
diff --git a/debian/changelog b/debian/changelog
index 718ce3924..4443394ea 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -6,6 +6,10 @@ openssh (1:5.2p1-2) UNRELEASED; urgency=low
6 in sshd dying (LP: #497781). 6 in sshd dying (LP: #497781).
7 * Use host compiler for ssh-askpass-gnome when cross-compiling. 7 * Use host compiler for ssh-askpass-gnome when cross-compiling.
8 * Don't run tests when cross-compiling. 8 * Don't run tests when cross-compiling.
9 * Drop change from 1:3.6.1p2-5 to disable cmsg_type check for file
10 descriptor passing when running on Linux 2.0. The previous stable
11 release of Debian dropped support for Linux 2.4, let alone 2.0, so this
12 very likely has no remaining users depending on it.
9 13
10 -- Colin Watson <cjwatson@debian.org> Sun, 10 Jan 2010 22:06:28 +0000 14 -- Colin Watson <cjwatson@debian.org> Sun, 10 Jan 2010 22:06:28 +0000
11 15
diff --git a/monitor_fdpass.c b/monitor_fdpass.c
index 3d3a78391..4b9a066bc 100644
--- a/monitor_fdpass.c
+++ b/monitor_fdpass.c
@@ -32,7 +32,6 @@
32#ifdef HAVE_SYS_UN_H 32#ifdef HAVE_SYS_UN_H
33#include <sys/un.h> 33#include <sys/un.h>
34#endif 34#endif
35#include <sys/utsname.h>
36 35
37#include <errno.h> 36#include <errno.h>
38#include <string.h> 37#include <string.h>
@@ -41,29 +40,6 @@
41#include "log.h" 40#include "log.h"
42#include "monitor_fdpass.h" 41#include "monitor_fdpass.h"
43 42
44static int
45cmsg_type_is_broken(void)
46{
47 static int broken_cmsg_type = -1;
48
49 if (broken_cmsg_type != -1)
50 return broken_cmsg_type;
51 else {
52 struct utsname uts;
53 /* If uname() fails, play safe and assume that cmsg_type
54 * isn't broken.
55 */
56 if (!uname(&uts) &&
57 strcmp(uts.sysname, "Linux") == 0 &&
58 strncmp(uts.release, "2.0.", 4) == 0)
59 broken_cmsg_type = 1;
60 else
61 broken_cmsg_type = 0;
62 }
63
64 return broken_cmsg_type;
65}
66
67int 43int
68mm_send_fd(int sock, int fd) 44mm_send_fd(int sock, int fd)
69{ 45{
@@ -176,11 +152,13 @@ mm_receive_fd(int sock)
176 return -1; 152 return -1;
177 } 153 }
178 154
179 if (!cmsg_type_is_broken() && cmsg->cmsg_type != SCM_RIGHTS) { 155#ifndef BROKEN_CMSG_TYPE
156 if (cmsg->cmsg_type != SCM_RIGHTS) {
180 error("%s: expected type %d got %d", __func__, 157 error("%s: expected type %d got %d", __func__,
181 SCM_RIGHTS, cmsg->cmsg_type); 158 SCM_RIGHTS, cmsg->cmsg_type);
182 return -1; 159 return -1;
183 } 160 }
161#endif
184 fd = (*(int *)CMSG_DATA(cmsg)); 162 fd = (*(int *)CMSG_DATA(cmsg));
185#endif 163#endif
186 return fd; 164 return fd;