summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac96
1 files changed, 49 insertions, 47 deletions
diff --git a/configure.ac b/configure.ac
index 9644dcaf2..115b80a4c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
1# $Id: configure.ac,v 1.139 2003/08/13 10:48:07 dtucker Exp $ 1# $Id: configure.ac,v 1.140 2003/08/21 07:58:29 dtucker Exp $
2 2
3AC_INIT 3AC_INIT
4AC_CONFIG_SRCDIR([ssh.c]) 4AC_CONFIG_SRCDIR([ssh.c])
@@ -195,56 +195,11 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
195*-*-linux*) 195*-*-linux*)
196 no_dev_ptmx=1 196 no_dev_ptmx=1
197 check_for_libcrypt_later=1 197 check_for_libcrypt_later=1
198 check_for_openpty_ctty_bug=1
198 AC_DEFINE(DONT_TRY_OTHER_AF) 199 AC_DEFINE(DONT_TRY_OTHER_AF)
199 AC_DEFINE(PAM_TTY_KLUDGE) 200 AC_DEFINE(PAM_TTY_KLUDGE)
200 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV) 201 AC_DEFINE(SPT_TYPE,SPT_REUSEARGV)
201 inet6_default_4in6=yes 202 inet6_default_4in6=yes
202 # openpty can be in libutil, needed for controlling tty test
203 AC_SEARCH_LIBS(openpty, util)
204 # make sure that openpty does not reacquire controlling terminal
205 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
206 AC_TRY_RUN(
207 [
208#include <stdio.h>
209#include <sys/fcntl.h>
210#include <sys/types.h>
211#include <sys/wait.h>
212
213int
214main()
215{
216 pid_t pid;
217 int fd, ptyfd, ttyfd, status;
218
219 pid = fork();
220 if (pid < 0) { /* failed */
221 exit(1);
222 } else if (pid > 0) { /* parent */
223 waitpid(pid, &status, 0);
224 if (WIFEXITED(status))
225 exit(WEXITSTATUS(status));
226 else
227 exit(2);
228 } else { /* child */
229 close(0); close(1); close(2);
230 setsid();
231 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
232 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
233 if (fd >= 0)
234 exit(3); /* Acquired ctty: broken */
235 else
236 exit(0); /* Did not acquire ctty: OK */
237 }
238}
239 ],
240 [
241 AC_MSG_RESULT(yes)
242 ],
243 [
244 AC_MSG_RESULT(no)
245 AC_DEFINE(SSHD_ACQUIRES_CTTY)
246 ]
247 )
248 case `uname -r` in 203 case `uname -r` in
249 1.*|2.0.*) 204 1.*|2.0.*)
250 AC_DEFINE(BROKEN_CMSG_TYPE) 205 AC_DEFINE(BROKEN_CMSG_TYPE)
@@ -805,6 +760,53 @@ unlink(template); exit(0);
805) 760)
806fi 761fi
807 762
763dnl make sure that openpty does not reacquire controlling terminal
764if test ! -z "$check_for_openpty_ctty_bug"; then
765 AC_MSG_CHECKING(if openpty correctly handles controlling tty)
766 AC_TRY_RUN(
767 [
768#include <stdio.h>
769#include <sys/fcntl.h>
770#include <sys/types.h>
771#include <sys/wait.h>
772
773int
774main()
775{
776 pid_t pid;
777 int fd, ptyfd, ttyfd, status;
778
779 pid = fork();
780 if (pid < 0) { /* failed */
781 exit(1);
782 } else if (pid > 0) { /* parent */
783 waitpid(pid, &status, 0);
784 if (WIFEXITED(status))
785 exit(WEXITSTATUS(status));
786 else
787 exit(2);
788 } else { /* child */
789 close(0); close(1); close(2);
790 setsid();
791 openpty(&ptyfd, &ttyfd, NULL, NULL, NULL);
792 fd = open("/dev/tty", O_RDWR | O_NOCTTY);
793 if (fd >= 0)
794 exit(3); /* Acquired ctty: broken */
795 else
796 exit(0); /* Did not acquire ctty: OK */
797 }
798}
799 ],
800 [
801 AC_MSG_RESULT(yes)
802 ],
803 [
804 AC_MSG_RESULT(no)
805 AC_DEFINE(SSHD_ACQUIRES_CTTY)
806 ]
807 )
808fi
809
808AC_FUNC_GETPGRP 810AC_FUNC_GETPGRP
809 811
810# Check for PAM libs 812# Check for PAM libs