From d4f11b59c2faed6e78845881fd1aad81806fd26f Mon Sep 17 00:00:00 2001 From: damien Date: Mon, 8 Nov 1999 23:28:04 +0000 Subject: [PATCH] - Autodetection of SSL/Crypto library location via autoconf - Fixed location of ssh-askpass to follow autoconf - Integrated Makefile patch from Niels Kristian Bech Jensen - Autodetection of RSAref library for US users - Minor doc updates --- ChangeLog | 7 +++++++ Makefile.in | 15 ++++++++++----- README | 2 ++ TODO | 12 ++++++++---- acconfig.h | 3 +++ configure.in | 48 +++++++++++++++++++++++++++++++++--------------- openssh.spec | 5 ++--- ssh-add.c | 4 ++-- ssh.h | 4 ++++ 9 files changed, 71 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c70b22d..368f1f67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +19991109 + - Autodetection of SSL/Crypto library location via autoconf + - Fixed location of ssh-askpass to follow autoconf + - Integrated Makefile patch from Niels Kristian Bech Jensen + - Autodetection of RSAref library for US users + - Minor doc updates + 19991108 - Removed debian/ directory. This is now being maintained separately. - Added symlinks for slogin in RPM spec file diff --git a/Makefile.in b/Makefile.in index 151131c6..f182af3b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -5,9 +5,12 @@ sbindir=@sbindir@ libdir=@libdir@ mandir=@mandir@ +SSH_PROGRAM=@bindir@/ssh +ASKPASS_PROGRAM=@libdir@/ssh/ssh-askpass + CC=@CC@ -OPT_FLAGS=-g -CFLAGS=$(OPT_FLAGS) -Wall -DETCDIR=\"@sysconfdir@\" -DSSH_PROGRAM=\"@bindir@/ssh\" @DEFS@ +PATHS=-DETCDIR=\"@sysconfdir@\" -DSSH_PROGRAM=\"$(SSH_PROGRAM)\" -DASKPASS_PROGRAM=\"$(ASKPASS_PROGRAM)\" +CFLAGS=@CFLAGS@ $(PATHS) @DEFS@ TARGETS=libssh.a ssh sshd ssh-add ssh-keygen ssh-agent scp LFLAGS=-L. LIBS=-lssh @LIBS@ @@ -55,8 +58,9 @@ install: install -d $(mandir) install -d $(mandir)/man1 install -d $(mandir)/man8 + install -d $(libdir)/ssh install -s -c ssh $(bindir)/ssh - ln -s ssh $(bindir)/slogin + ln -sf ssh $(bindir)/slogin install -s -c scp $(bindir)/scp install -s -c ssh-add $(bindir)/ssh-add install -m755 -c ssh-askpass $(libdir)/ssh/ssh-askpass @@ -64,7 +68,7 @@ install: install -s -c ssh-keygen $(bindir)/ssh-keygen install -s -c sshd $(sbindir)/sshd install -m644 -c ssh.1 $(mandir)/man1/ssh.1 - ln -s ssh.1 $(mandir)/man1/slogin.1 + ln -sf ssh.1 $(mandir)/man1/slogin.1 install -m644 -c scp.1 $(mandir)/man1/scp.1 install -m644 -c ssh-add.1 $(mandir)/man1/ssh-add.1 install -m644 -c ssh-agent.1 $(mandir)/man1/ssh-agent.1 @@ -77,4 +81,5 @@ distclean: clean mrproper: distclean veryclean: distclean - rm -f configure + rm -f configure config.h.in + diff --git a/README b/README index 0c61143d..5ddc2ef8 100644 --- a/README +++ b/README @@ -36,6 +36,8 @@ The OpenBSD team Dan Brosemer - Autoconf and build fixes & Debian scripts Niels Kristian Bech Jensen - Makefile patch Nalin Dahyabhai - PAM environment patch +Phil Hands - Debian scripts, assorted patches +Niels Kristian Bech Jensen - Makefile patches Miscellania - diff --git a/TODO b/TODO index 128f6df1..118ef2d0 100644 --- a/TODO +++ b/TODO @@ -1,7 +1,11 @@ --- Replacement for setproctitle() +- Replacement for setproctitle() --- Improve PAM support (a pam_lastlog module will cause sshd to exit) +- Improve PAM support (a pam_lastlog module will cause sshd to exit) --- Better documentation +- Better documentation --- Port to other platforms +- Port to other platforms + +- Fix paths in manpages using autoconf + +- Enable libwrap support using autoconf switch diff --git a/acconfig.h b/acconfig.h index 7119b94a..c859c253 100644 --- a/acconfig.h +++ b/acconfig.h @@ -1,5 +1,8 @@ /* config.h.in. Generated by hand, don't use autoheader. */ +/* SSL directory. */ +#undef ssldir + /* Define if your ssl headers are included with #include */ #undef HAVE_SSL diff --git a/configure.in b/configure.in index 8df3ffc7..a03c2af2 100644 --- a/configure.in +++ b/configure.in @@ -6,6 +6,8 @@ AC_CONFIG_HEADER(config.h) dnl Checks for programs. AC_PROG_CC AC_PROG_RANLIB +AC_CHECK_PROG(AR, ar, ar) +if test "$GCC" = "yes"; then CFLAGS="$CFLAGS -Wall"; fi dnl Checks for libraries. dnl Replace `main' with a function in -lcrypto: @@ -21,26 +23,42 @@ AC_CHECK_LIB(dl, dlopen, , ) dnl check for pam AC_CHECK_LIB(pam, pam_authenticate, , ) -dnl Check for stuff in path. -AC_CHECK_PROG(AR, ar, ar) -AC_CHECK_PROG(RANLIB, ranlib, ranlib) +dnl Check for OpenSSL/SSLeay directories. +AC_MSG_CHECKING([for OpenSSL/SSLeay directory]) +for dir in /usr /usr/local/openssl /usr/lib/openssl /usr/local/ssl /usr/lib/ssl /usr/local /usr/pkg ; do + ssldir="$dir" + if test -f "$dir/include/openssl/crypto.h"; then + AC_DEFINE(HAVE_OPENSSL) + break + fi + if test -f "$dir/include/ssl/crypto.h"; then + AC_DEFINE(HAVE_SSL) + break + fi + if test -f "$dir/include/crypto.h"; then + break + fi +done +AC_MSG_RESULT($ssldir) +AC_SUBST(ssldir) +AC_DEFINE_UNQUOTED(ssldir, "$ssldir") +if test "$ssldir" != "/usr"; then + CFLAGS="$CFLAGS -I$ssldir/include" + LIBS="$LIBS -L$ssldir/lib" +fi +LIBS="$LIBS -lssl -lcrypto" -dnl Check for ssl headers -AC_CHECK_HEADER(openssl/bn.h, [AC_DEFINE(HAVE_OPENSSL)], [AC_CHECK_HEADER(ssl/bn.h, [AC_DEFINE(HAVE_SSL)], [AC_MSG_ERROR([*** ssl library missing - please install first ***])])]) +dnl Check for RSAref library. +AC_MSG_CHECKING([for RSAref library]) +saved_LIBS="$LIBS" +LIBS="$saved_LIBS -lRSAglue -lrsaref" +AC_TRY_LINK([], [], +[AC_MSG_RESULT(yes); ], +[AC_MSG_RESULT(no)]; LIBS="$saved_LIBS") dnl Checks for header files. AC_CHECK_HEADERS(pty.h) -dnl Checks for typedefs, structures, and compiler characteristics. -AC_C_CONST -AC_TYPE_UID_T -AC_C_INLINE -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_SIZE_T -AC_STRUCT_ST_BLKSIZE -AC_HEADER_TIME - dnl Checks for library functions. AC_PROG_GCC_TRADITIONAL AC_CHECK_FUNCS(openpty strlcpy mkdtemp arc4random setproctitle) diff --git a/openssh.spec b/openssh.spec index 1f87a6be..c0d45bc2 100644 --- a/openssh.spec +++ b/openssh.spec @@ -1,6 +1,6 @@ Summary: OpenSSH free Secure Shell (SSH) implementation Name: openssh -Version: 1.2pre8 +Version: 1.2pre9 Release: 1 Packager: Damien Miller Source0: openssh-%{version}-linux.tar.gz @@ -39,8 +39,7 @@ patented algorithms to seperate libraries (OpenSSL). %build -./configure --prefix=/usr --sysconfdir=/etc/ssh -make OPT_FLAGS="$RPM_OPT_FLAGS" +CFLAGS="$RPM_OPT_FLAGS" ./configure --prefix=/usr --sysconfdir=/etc/ssh %install rm -rf $RPM_BUILD_ROOT diff --git a/ssh-add.c b/ssh-add.c index ec472a39..a8c70526 100644 --- a/ssh-add.c +++ b/ssh-add.c @@ -112,9 +112,9 @@ add_file(AuthenticationConnection *ac, const char *filename) filename, saved_comment); /* skip the prompt if it won't fit */ if (tmp < 0 || tmp >= BUFSIZE) - tmp=execlp("/usr/lib/ssh/ssh-askpass", "ssh-askpass", 0); + tmp=execlp(ASKPASS_PROGRAM, "ssh-askpass", 0); else - tmp=execlp("/usr/lib/ssh/ssh-askpass", "ssh-askpass", buf, 0); + tmp=execlp(ASKPASS_PROGRAM, "ssh-askpass", buf, 0); if (tmp==-1) { fprintf(stderr, "Executing ssh-askpass failed: %s\n", diff --git a/ssh.h b/ssh.h index 57b0875b..5a5bab82 100644 --- a/ssh.h +++ b/ssh.h @@ -93,6 +93,10 @@ only by root, whereas ssh_config should be world-readable. */ #define LOGIN_PROGRAM "/usr/bin/login" #endif /* LOGIN_PROGRAM */ +#ifndef ASKPASS_PROGRAM +#define ASKPASS_PROGRAM "/usr/lib/ssh/ssh-askpass" +#endif /* ASKPASS_PROGRAM */ + /* The process id of the daemon listening for connections is saved here to make it easier to kill the correct daemon when necessary. */ #define SSH_DAEMON_PID_FILE PIDDIR "/sshd.pid" -- 2.45.1