diff --git a/CREDITS b/CREDITS index 9f001cacf..00def351c 100644 --- a/CREDITS +++ b/CREDITS @@ -55,6 +55,7 @@ Larry Jones - Bugfixes Lutz Jaenicke - Bugfixes Marc G. Fournier - Solaris patches Martin Johansson - Linux fixes +Mark D. Roth - Features, bug fixes Mark Miller - Bugfixes Matt Richards - AIX patches Michael Stone - Irix enhancements @@ -87,5 +88,5 @@ Apologies to anyone I have missed. Damien Miller -$Id: CREDITS,v 1.61 2001/02/09 01:55:35 djm Exp $ +$Id: CREDITS,v 1.62 2001/04/16 00:41:46 djm Exp $ diff --git a/ChangeLog b/ChangeLog index 654f62bac..965096908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ - markus@cvs.openbsd.org 2001/04/15 08:43:47 [dh.c sftp-glob.c sftp-glob.h sftp-int.c sshconnect2.c sshd.c] some unused variable and typos; from tomh@po.crl.go.jp + - (djm) Convert mandoc manpages to man automatically. Patch from Mark D. + Roth 20010415 - OpenBSD CVS Sync @@ -5091,4 +5093,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1118 2001/04/15 14:27:16 mouring Exp $ +$Id: ChangeLog,v 1.1119 2001/04/16 00:41:46 djm Exp $ diff --git a/Makefile.in b/Makefile.in index 2df721671..f0b2f6937 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,4 +1,4 @@ -# $Id: Makefile.in,v 1.167 2001/04/14 23:21:51 mouring Exp $ +# $Id: Makefile.in,v 1.168 2001/04/16 00:41:46 djm Exp $ prefix=@prefix@ exec_prefix=@exec_prefix@ @@ -6,7 +6,6 @@ bindir=@bindir@ sbindir=@sbindir@ libexecdir=@libexecdir@ mandir=@mandir@ -mansubdir=@mansubdir@ sysconfdir=@sysconfdir@ piddir=@piddir@ srcdir=@srcdir@ @@ -50,9 +49,8 @@ SSHOBJS= ssh.o sshconnect.o sshconnect1.o sshconnect2.o sshtty.o readconf.o clie SSHDOBJS= sshd.o auth.o auth1.o auth2.o auth-chall.o auth2-chall.o auth-rhosts.o auth-options.o auth-krb4.o auth-pam.o auth2-pam.o auth-passwd.o auth-rsa.o auth-rh-rsa.o auth-sia.o sshpty.o sshlogin.o loginrec.o servconf.o serverloop.o md5crypt.o session.o groupaccess.o -TROFFMAN = scp.1 ssh-add.1 ssh-agent.1 ssh-keygen.1 ssh-keyscan.1 ssh.1 sshd.8 sftp-server.8 sftp.1 -CATMAN = scp.0 ssh-add.0 ssh-agent.0 ssh-keygen.0 ssh-keyscan.0 ssh.0 sshd.0 sftp-server.0 sftp.0 -MANPAGES = @MANTYPE@ +MANPAGES = scp.1.out ssh-add.1.out ssh-agent.1.out ssh-keygen.1.out ssh-keyscan.1.out ssh.1.out sshd.8.out sftp-server.8.out sftp.1.out +MANTYPE = @MANTYPE@ CONFIGFILES=sshd_config ssh_config primes @@ -73,9 +71,7 @@ PATHSUBS = \ FIXPATHSCMD = $(PERL) $(srcdir)/fixpaths $(PATHSUBS) -all: $(CONFIGFILES) $(TARGETS) - -manpages: $(MANPAGES) +all: $(CONFIGFILES) $(MANPAGES) $(TARGETS) $(LIBSSH_OBJS): config.h $(SSHOBJS): config.h @@ -123,8 +119,20 @@ sftp$(EXEEXT): $(LIBCOMPAT) libssh.a sftp.o sftp-client.o sftp-int.o sftp-common logintest: logintest.o $(LIBCOMPAT) libssh.a loginrec.o $(LD) -o $@ logintest.o $(LDFLAGS) loginrec.o -lopenbsd-compat -lssh $(LIBS) -$(MANPAGES) $(CONFIGFILES):: - $(FIXPATHSCMD) $(srcdir)/$@ +$(MANPAGES): %.out: % + if test "$(MANTYPE)" = "cat"; then \ + manpage=`echo $< | sed 's/\.[1-9]$$/\.0/'`; \ + else \ + manpage=$<; \ + fi; \ + if test "$(MANTYPE)" = "man"; then \ + $(FIXPATHSCMD) $(srcdir)/$${manpage} | $(PERL) $(srcdir)/mdoc2man.pl > $@; \ + else \ + $(FIXPATHSCMD) $(srcdir)/$${manpage} > $@; \ + fi + +$(CONFIGFILES):: + $(FIXPATHSCMD) $(srcdir)/$@ > $@.out clean: (cd openbsd-compat; $(MAKE) clean) @@ -151,14 +159,12 @@ catman-do: distprep: catman-do autoreconf -install: manpages $(TARGETS) install-files host-key +install: $(TARGETS) install-files host-key install-files: $(srcdir)/mkinstalldirs $(DESTDIR)$(bindir) $(srcdir)/mkinstalldirs $(DESTDIR)$(sbindir) $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir) - $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)1 - $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$(mansubdir)8 $(srcdir)/mkinstalldirs $(DESTDIR)$(libexecdir) $(INSTALL) -m $(SSH_MODE) -s ssh $(DESTDIR)$(bindir)/ssh $(INSTALL) -m 0755 -s scp $(DESTDIR)$(bindir)/scp @@ -169,15 +175,22 @@ install-files: $(INSTALL) -m 0755 -s sshd $(DESTDIR)$(sbindir)/sshd @NO_SFTP@$(INSTALL) -m 0755 -s sftp $(DESTDIR)$(bindir)/sftp @NO_SFTP@$(INSTALL) -m 0755 -s sftp-server $(DESTDIR)$(SFTP_SERVER) - $(INSTALL) -m 644 ssh.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh.1 - $(INSTALL) -m 644 scp.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/scp.1 - $(INSTALL) -m 644 ssh-add.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-add.1 - $(INSTALL) -m 644 ssh-agent.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-agent.1 - $(INSTALL) -m 644 ssh-keygen.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keygen.1 - $(INSTALL) -m 644 ssh-keyscan.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/ssh-keyscan.1 - $(INSTALL) -m 644 sshd.[08].out $(DESTDIR)$(mandir)/$(mansubdir)8/sshd.8 - @NO_SFTP@$(INSTALL) -m 644 sftp.[01].out $(DESTDIR)$(mandir)/$(mansubdir)1/sftp.1 - @NO_SFTP@$(INSTALL) -m 644 sftp-server.[08].out $(DESTDIR)$(mandir)/$(mansubdir)8/sftp-server.8 + if test "$(MANTYPE)" = "doc"; then \ + mansubdir="man"; \ + else \ + mansubdir="$(MANTYPE)"; \ + fi; \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$${mansubdir}1; \ + $(srcdir)/mkinstalldirs $(DESTDIR)$(mandir)/$${mansubdir}8; \ + $(INSTALL) -m 644 ssh.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/ssh.1; \ + $(INSTALL) -m 644 scp.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/scp.1; \ + $(INSTALL) -m 644 ssh-add.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/ssh-add.1; \ + $(INSTALL) -m 644 ssh-agent.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/ssh-agent.1; \ + $(INSTALL) -m 644 ssh-keygen.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/ssh-keygen.1; \ + $(INSTALL) -m 644 ssh-keyscan.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/ssh-keyscan.1; \ + $(INSTALL) -m 644 sshd.8.out $(DESTDIR)$(mandir)/$${mansubdir}8/sshd.8; \ + @NO_SFTP@$(INSTALL) -m 644 sftp.1.out $(DESTDIR)$(mandir)/$${mansubdir}1/sftp.1; \ + @NO_SFTP@$(INSTALL) -m 644 sftp-server.8.out $(DESTDIR)$(mandir)/$${mansubdir}8/sftp-server.8; -rm -f $(DESTDIR)$(bindir)/slogin ln -s ssh$(EXEEXT) $(DESTDIR)$(bindir)/slogin -rm -f $(DESTDIR)$(mandir)/$(mansubdir)1/slogin.1 diff --git a/configure.in b/configure.in index 124e6d7e6..7b9fdbc1a 100644 --- a/configure.in +++ b/configure.in @@ -1,4 +1,4 @@ -# $Id: configure.in,v 1.275 2001/04/12 21:35:53 mouring Exp $ +# $Id: configure.in,v 1.276 2001/04/16 00:41:46 djm Exp $ AC_INIT(ssh.c) @@ -58,12 +58,8 @@ case "$host" in fi AC_CHECK_FUNC(authenticate, [AC_DEFINE(WITH_AIXAUTHENTICATE)]) AC_DEFINE(BROKEN_GETADDRINFO) - MANTYPE='$(CATMAN)' - mansubdir=cat dnl AIX handles lastlog as part of its login message AC_DEFINE(DISABLE_LASTLOG) - MANTYPE='$(CATMAN)' - mansubdir=cat ;; *-*-cygwin*) LIBS="$LIBS -lregex /usr/lib/textmode.o" @@ -74,9 +70,11 @@ case "$host" in AC_DEFINE(NO_X11_UNIX_SOCKETS) no_libsocket=1 no_libnsl=1 + MANTYPE=doc ;; *-*-dgux*) AC_DEFINE(IP_TOS_IS_BROKEN) + MANTYPE=doc ;; *-*-hpux10*) if test -z "$GCC"; then @@ -89,8 +87,6 @@ case "$host" in AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) LIBS="$LIBS -lsec" - MANTYPE='$(CATMAN)' - mansubdir=cat ;; *-*-hpux11*) CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" @@ -101,14 +97,11 @@ case "$host" in AC_DEFINE(DISABLE_UTMP) AC_DEFINE(SPT_TYPE,SPT_PSTAT) LIBS="$LIBS -lsec" - MANTYPE='$(CATMAN)' - mansubdir=cat ;; *-*-irix5*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS" PATH="$PATH:/usr/etc" - MANTYPE='$(CATMAN)' no_libsocket=1 no_libnsl=1 AC_DEFINE(BROKEN_INET_NTOA) @@ -117,7 +110,6 @@ case "$host" in CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS" PATH="$PATH:/usr/etc" - MANTYPE='$(CATMAN)' AC_DEFINE(WITH_IRIX_ARRAY) AC_DEFINE(WITH_IRIX_PROJECT) AC_DEFINE(WITH_IRIX_AUDIT) @@ -125,7 +117,6 @@ case "$host" in no_libsocket=1 no_libnsl=1 AC_DEFINE(BROKEN_INET_NTOA) - mansubdir=man ;; *-*-linux*) no_dev_ptmx=1 @@ -133,6 +124,7 @@ case "$host" in AC_DEFINE(DONT_TRY_OTHER_AF) AC_DEFINE(PAM_TTY_KLUDGE) inet6_default_4in6=yes + MANTYPE=doc ;; mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(HAVE_NEWS4) @@ -140,12 +132,15 @@ mips-sony-bsd|mips-sony-newsos4) AC_CHECK_LIB(iberty, xatexit, AC_DEFINE(HAVE_XATEXIT), AC_MSG_ERROR([*** libiberty missing - please install first or check config.log ***]) ) + MANTYPE=doc ;; *-*-netbsd*) need_dash_r=1 + MANTYPE=doc ;; *-*-freebsd*) check_for_libcrypt_later=1 + MANTYPE=doc ;; *-next-*) conf_lastlog_location="/usr/adm/lastlog" @@ -158,6 +153,7 @@ mips-sony-bsd|mips-sony-newsos4) AC_DEFINE(BROKEN_SAVED_UIDS) CPPFLAGS="$CPPFLAGS -I/usr/local/include" CFLAGS="$CFLAGS" + MANTYPE=doc ;; *-*-solaris*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" @@ -185,56 +181,42 @@ mips-sony-bsd|mips-sony-newsos4) conf_wtmp_location=/var/adm/wtmp conf_lastlog_location=/var/adm/lastlog AC_DEFINE(USE_PIPES) - MANTYPE='$(CATMAN)' - mansubdir=cat ;; *-ncr-sysv*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" - MANTYPE='$(CATMAN)' - mansubdir=cat LIBS="$LIBS -lc89 -lnsl -lgen -lsocket" ;; *-sni-sysv*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib -L/usr/ucblib" - MANTYPE='$(CATMAN)' IPADDR_IN_DISPLAY=yes AC_DEFINE(USE_PIPES) AC_DEFINE(IP_TOS_IS_BROKEN) AC_DEFINE(HAVE_BOGUS_SYS_QUEUE_H) - mansubdir=cat LIBS="$LIBS -lgen -lnsl -lucb" ;; *-*-sysv4.2*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" - MANTYPE='$(CATMAN)' - mansubdir=cat enable_suid_ssh=no AC_DEFINE(USE_PIPES) ;; *-*-sysv5*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" - MANTYPE='$(CATMAN)' - mansubdir=cat enable_suid_ssh=no AC_DEFINE(USE_PIPES) ;; *-*-sysv*) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" - MANTYPE='$(CATMAN)' - mansubdir=cat LIBS="$LIBS -lgen -lsocket" ;; *-*-sco3.2v4*) CPPFLAGS="$CPPFLAGS -Dftruncate=chsize -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" - MANTYPE='$(CATMAN)' LIBS="$LIBS -lgen -lsocket -los -lprot -lx -ltinfo -lm" - mansubdir=cat rsh_path="/usr/bin/rcmd" RANLIB=true no_dev_ptmx=1 @@ -250,8 +232,6 @@ mips-sony-bsd|mips-sony-newsos4) CPPFLAGS="$CPPFLAGS -I/usr/local/include" LDFLAGS="$LDFLAGS -L/usr/local/lib" LIBS="$LIBS -lprot -lx -ltinfo -lm" - MANTYPE='$(CATMAN)' - mansubdir=cat no_dev_ptmx=1 rsh_path="/usr/bin/rcmd" AC_DEFINE(USE_PIPES) @@ -1426,23 +1406,23 @@ AC_SUBST(INSTALL_SSH_PRNG_CMDS) AC_ARG_WITH(catman, - [ --with-catman=man|cat Install preformatted manpages[no]], + [ --with-mantype=man|cat|doc Set man page type], [ - MANTYPE='$(CATMAN)' - if test x"$withval" != x"yes" ; then - mansubdir=$withval - else - mansubdir=cat - fi + case "$withval" in + man|cat|doc) + MANTYPE=$withval + ;; + *) + AC_MSG_ERROR(invalid man type: $withval) + ;; + esac ], [ if test -z "$MANTYPE" ; then - MANTYPE='$(TROFFMAN)' - mansubdir=man + MANTYPE=man fi ] ) AC_SUBST(MANTYPE) -AC_SUBST(mansubdir) # Check whether to enable MD5 passwords MD5_MSG="no" @@ -1897,11 +1877,6 @@ AC_OUTPUT(Makefile openbsd-compat/Makefile ssh_prng_cmds) # Print summary of options -if test x$MANTYPE = x'$(CATMAN)' ; then - MAN_MSG=cat -else - MAN_MSG=man -fi if test ! -z "$RANDOM_POOL" ; then RAND_MSG="Device ($RANDOM_POOL)" else @@ -1921,7 +1896,7 @@ B=`eval echo ${bindir}` ; B=`eval echo ${B}` C=`eval echo ${sbindir}` ; C=`eval echo ${C}` D=`eval echo ${sysconfdir}` ; D=`eval echo ${D}` E=`eval echo ${libexecdir}/ssh-askpass` ; E=`eval echo ${E}` -F=`eval echo ${mandir}/${mansubdir}X` ; F=`eval echo ${F}` +F=`eval echo ${mandir}` ; F=`eval echo ${F}` G=`eval echo ${piddir}` ; G=`eval echo ${G}` H=`eval echo ${user_path}` ; H=`eval echo ${H}` @@ -1935,7 +1910,7 @@ echo " Manual pages: $F" echo " PID file: $G" echo " sshd default user PATH: $H" echo " Random number collection: $RAND_MSG" -echo " Manpage format: $MAN_MSG" +echo " Manpage format: $MANTYPE" echo " PAM support: ${PAM_MSG}" echo " KerberosIV support: $KRB4_MSG" echo " AFS support: $AFS_MSG" diff --git a/fixpaths b/fixpaths index edd9e486f..7e4178e4a 100755 --- a/fixpaths +++ b/fixpaths @@ -3,21 +3,17 @@ # fixpaths - substitute makefile variables into text files -$usage = "Usage: $0 [-x] [-Dstring=replacement] [[infile] ...]\n"; - -$ext="out"; +$usage = "Usage: $0 [-Dstring=replacement] [[infile] ...]\n"; if (!defined(@ARGV)) { die ("$usage"); } # read in the command line and get some definitions while ($_=$ARGV[0], /^-/) { - if (/^-[Dx]/) { + if (/^-D/) { # definition shift(@ARGV); if ( /-D(.*)=(.*)/ ) { $def{"$1"}=$2; - } elsif ( /-x\s*(\w+)/ ) { - $ext=$1; } else { die ("$usage$0: error in command line arguments.\n"); } @@ -34,15 +30,13 @@ if (!defined(%def)) { for $f (@ARGV) { $f =~ /(.*\/)*(.*)$/; - $of = $2.".$ext"; open(IN, "<$f") || die ("$0: input file $f missing!\n"); - open(OUT, ">$of") || die ("$0: cannot create output file $of: $!\n"); while () { for $s (keys(%def)) { s#$s#$def{$s}#; } # for $s - print OUT; + print; } # while } # for $f diff --git a/contrib/mdoc2man.pl b/mdoc2man.pl similarity index 99% rename from contrib/mdoc2man.pl rename to mdoc2man.pl index 719e1e0c9..f2d794539 100644 --- a/contrib/mdoc2man.pl +++ b/mdoc2man.pl @@ -1,6 +1,6 @@ #!/usr/bin/perl ### -### Quick usage: mdoc2man.pl < mdoc_manpage.8 > doc_manpage.8 +### Quick usage: mdoc2man.pl < mdoc_manpage.8 > man_manpage.8 ### ### ### Copyright (c) 2001 University of Illinois Board of Trustees