Maciej W. Rozycki
2002-Jan-18 16:55 UTC
[patch] openssh 3.0.2p1: Libwrap gets linked in unnecessarily
Hello, There is a small but annoying problem with linking libwrap in openssh. The library is added to LIBS which makes it be linked in to all binaries. This is unnecessary and leads to bogus dependencies if libwrap is a shared library. Following is a trivial fix that reserves a separate autoconf substitution variable LIBWRAP, which is only used for sshd. Please apply. Maciej -- + Maciej W. Rozycki, Technical University of Gdansk, Poland + +--------------------------------------------------------------+ + e-mail: macro at ds2.pg.gda.pl, PGP key available + openssh-3.0.1p1-libwrap.patch diff -up --recursive --new-file openssh-3.0.1p1.macro/Makefile.in openssh-3.0.1p1/Makefile.in --- openssh-3.0.1p1.macro/Makefile.in Sun Nov 11 23:34:23 2001 +++ openssh-3.0.1p1/Makefile.in Wed Dec 19 21:34:07 2001 @@ -30,6 +30,7 @@ LD=@LD@ CFLAGS=@CFLAGS@ CPPFLAGS=-I. -I$(srcdir) @CPPFLAGS@ $(PATHS) @DEFS@ LIBS=@LIBS@ +LIBWRAP=@LIBWRAP@ AR=@AR@ RANLIB=@RANLIB@ INSTALL=@INSTALL@ @@ -98,7 +99,7 @@ ssh$(EXEEXT): $(LIBCOMPAT) libssh.a $(SS $(LD) -o $@ $(SSHOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) sshd$(EXEEXT): libssh.a $(LIBCOMPAT) $(SSHDOBJS) - $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) + $(LD) -o $@ $(SSHDOBJS) $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) $(LIBWRAP) scp$(EXEEXT): $(LIBCOMPAT) libssh.a scp.o $(LD) -o $@ scp.o $(LDFLAGS) -lssh -lopenbsd-compat $(LIBS) diff -up --recursive --new-file openssh-3.0.1p1.macro/configure.ac openssh-3.0.1p1/configure.ac --- openssh-3.0.1p1.macro/configure.ac Sat Nov 3 19:09:33 2001 +++ openssh-3.0.1p1/configure.ac Wed Dec 19 21:37:19 2001 @@ -546,7 +546,8 @@ AC_ARG_WITH(tcp-wrappers, CPPFLAGS="-I${withval} ${CPPFLAGS}" fi fi - LIBS="-lwrap $LIBS" + LIBWRAP="-lwrap" + LIBS="$LIBS $LIBWRAP" AC_MSG_CHECKING(for libwrap) AC_TRY_LINK( [ @@ -557,12 +558,14 @@ AC_ARG_WITH(tcp-wrappers, [ AC_MSG_RESULT(yes) AC_DEFINE(LIBWRAP) + AC_SUBST(LIBWRAP) TCPW_MSG="yes" ], [ AC_MSG_ERROR([*** libwrap missing]) ] ) + LIBS="$saved_LIBS" fi ] )
Tim Rice
2002-Feb-26 05:52 UTC
[patch] openssh 3.0.2p1: Libwrap gets linked in unnecessarily
I've addressed this bug (and several others) in modifications i'm in the process of testing now. If all my machines build OK I'll commit in the morning. On Fri, 18 Jan 2002, Maciej W. Rozycki wrote:> Hello, > > There is a small but annoying problem with linking libwrap in openssh. > The library is added to LIBS which makes it be linked in to all binaries. > This is unnecessary and leads to bogus dependencies if libwrap is a shared > library. > > Following is a trivial fix that reserves a separate autoconf substitution > variable LIBWRAP, which is only used for sshd. Please apply. > > Maciej > >-- Tim Rice Multitalents (707) 887-1469 tim at multitalents.net