1 Index: openssh-4.0p1/configure.ac
2 ===================================================================
3 --- openssh-4.0p1.orig/configure.ac 2005-03-07 04:21:37.000000000 -0500
4 +++ openssh-4.0p1/configure.ac 2005-03-12 23:43:25.057482040 -0500
9 -AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
12 -#include <sys/types.h>
14 -int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
16 - [AC_MSG_RESULT(yes)],
19 - AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
22 - AC_MSG_WARN([cross compiling: assuming BROKEN_ONE_BYTE_DIRENT_D_NAME])
23 - AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
26 +AC_CACHE_CHECK([whether struct dirent allocates space for d_name], ac_cv_have_space_d_name_in_struct_dirent, [
29 + #include <sys/types.h>
31 + int main(void){struct dirent d;exit(sizeof(d.d_name)<=sizeof(char));}
33 + [ ac_cv_have_space_d_name_in_struct_dirent="yes" ],
34 + [ ac_cv_have_space_d_name_in_struct_dirent="no" ],
38 +if test "x$ac_cv_dirent_have_space_d_name" = "xyes" ; then
39 + AC_DEFINE(BROKEN_ONE_BYTE_DIRENT_D_NAME)
42 AC_MSG_CHECKING([for /proc/pid/fd directory])
43 if test -d "/proc/$$/fd" ; then
46 # Check for broken snprintf
47 if test "x$ac_cv_func_snprintf" = "xyes" ; then
48 - AC_MSG_CHECKING([whether snprintf correctly terminates long strings])
52 -int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
54 - [AC_MSG_RESULT(yes)],
57 - AC_DEFINE(BROKEN_SNPRINTF)
58 - AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
60 - [ AC_MSG_WARN([cross compiling: Assuming working snprintf()]) ]
62 + AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
63 + ac_cv_have_broken_snprintf, [
67 + int main(void){char b[5];snprintf(b,5,"123456789");exit(b[4]!='\0');}
69 + [ac_cv_have_broken_snprintf="no"],
70 + [ac_cv_have_broken_snprintf="yes"],
72 + AC_MSG_WARN([cross compiling: Assuming working snprintf()])
73 + ac_cv_have_broken_snprintf="yes"
77 + if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
78 + AC_DEFINE(BROKEN_SNPRINTF)
79 + AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
83 # Check for missing getpeereid (or equiv) support
84 @@ -1045,49 +1048,49 @@
86 dnl make sure that openpty does not reacquire controlling terminal
87 if test ! -z "$check_for_openpty_ctty_bug"; then
88 - AC_MSG_CHECKING(if openpty correctly handles controlling tty)
92 -#include <sys/fcntl.h>
93 -#include <sys/types.h>
94 -#include <sys/wait.h>
100 - int fd, ptyfd, ttyfd, status;
103 - if (pid < 0) { /* failed */
105 - } else if (pid > 0) { /* parent */
106 - waitpid(pid, &status, 0);
107 - if (WIFEXITED(status))
108 - exit(WEXITSTATUS(status));
111 - } else { /* child */
112 - close(0); close(1); close(2);
114 - openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
115 - fd = open("/dev/tty", O_RDWR | O_NOCTTY);
117 - exit(3); /* Acquired ctty: broken */
119 - exit(0); /* Did not acquire ctty: OK */
120 + AC_CACHE_CHECK([if openpty acquires controlling terminal],
121 + ac_cv_have_openpty_ctty_bug, [
125 + #include <sys/fcntl.h>
126 + #include <sys/types.h>
127 + #include <sys/wait.h>
133 + int fd, ptyfd, ttyfd, status;
136 + if (pid < 0) { /* failed */
138 + } else if (pid > 0) { /* parent */
139 + waitpid(pid, &status, 0);
140 + if (WIFEXITED(status))
141 + exit(WEXITSTATUS(status));
144 + } else { /* child */
145 + close(0); close(1); close(2);
147 + openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
148 + fd = open("/dev/tty", O_RDWR | O_NOCTTY);
150 + exit(3); /* Acquired ctty: broken */
152 + exit(0); /* Did not acquire ctty: OK */
162 - AC_DEFINE(SSHD_ACQUIRES_CTTY)
166 + [ ac_cv_have_openpty_ctty_bug="no" ],
167 + [ ac_cv_have_openpty_ctty_bug="yes"]
170 + if test "x$ac_cv_have_openpty_ctty_bug" = "xyes" ; then
171 + AC_DEFINE(SSHD_ACQUIRES_CTTY)
175 if test "x$ac_cv_func_getaddrinfo" = "xyes" -a "x$check_for_hpux_broken_getaddrinfo" = "x1"; then
176 @@ -2039,8 +2042,12 @@
179 dnl test snprintf (broken on SCO w/gcc)
182 + # No need to check for a broken snprintf if we already know it's broken.
183 + if test "x$ac_cv_func_snprintf" = "xyes" && test "x$ac_cv_have_broken_snprintf" != "xyes"; then
184 + AC_CACHE_CHECK([whether snprintf correctly terminates long strings],
185 + ac_cv_have_broken_snprintf, [
191 @@ -2063,9 +2070,20 @@
195 - ]])], [ true ], [ AC_DEFINE(BROKEN_SNPRINTF) ],
196 - AC_MSG_WARN([cross compiling: Assuming working snprintf()])
199 + [ac_cv_have_broken_snprintf="no"],
200 + [ac_cv_have_broken_snprintf="yes"],
202 + AC_MSG_WARN([cross compiling: Assuming working snprintf()])
203 + ac_cv_have_broken_snprintf="yes"
207 + if test "x$ac_cv_have_broken_snprintf" = "xyes" ; then
208 + AC_DEFINE(BROKEN_SNPRINTF)
209 + AC_MSG_WARN([****** Your snprintf() function is broken, complain to your vendor])
214 dnl Checks for structure members
215 @@ -2666,12 +2684,15 @@
218 if test "x$etc_default_login" != "xno"; then
219 - AC_CHECK_FILE("/etc/default/login",
220 - [ external_path_file=/etc/default/login ])
221 if test ! -z "$cross_compiling" && test "x$cross_compiling" = "xyes";
223 AC_MSG_WARN([cross compiling: Disabling /etc/default/login test])
224 - elif test "x$external_path_file" = "x/etc/default/login"; then
225 + external_path_file=/etc/default/login
227 + AC_CHECK_FILE("/etc/default/login",
228 + [ external_path_file=/etc/default/login ])
230 + if test "x$external_path_file" = "x/etc/default/login"; then
231 AC_DEFINE(HAVE_ETC_DEFAULT_LOGIN)