configure bug (was Re: OpenSSH_4.3p1, OpenSSL 0.9.8a 11 Oct 2005 on solaris 8/9)

Corinna Vinschen vinschen at redhat.com
Fri Feb 3 09:07:57 EST 2006


On Feb  2 22:31, Corinna Vinschen wrote:
> I can confirm the same problem on Cygwin.  I reran configure from scratch
> and found the following strange log entries:
> 
>   checking for ut_host field in utmp.h... no
>   checking for ut_host field in utmpx.h... no
>   checking for syslen field in utmpx.h... no
>   checking for ut_pid field in utmp.h... no
>   checking for ut_type field in utmp.h... no
>   checking for ut_type field in utmpx.h... no
>   checking for ut_tv field in utmp.h... no
>   checking for ut_id field in utmp.h... no
>   checking for ut_id field in utmpx.h... no
>   checking for ut_addr field in utmp.h... no
>   checking for ut_addr field in utmpx.h... no
>   checking for ut_addr_v6 field in utmp.h... no
>   checking for ut_addr_v6 field in utmpx.h... no
>   checking for ut_exit field in utmp.h... no
>   checking for ut_time field in utmp.h... no
>   checking for ut_time field in utmpx.h... no
>   checking for ut_tv field in utmpx.h... no
> 
> Nearly all of these fields are actually present in the affected
> structures utmp and utmpx.  This looks like a bug in the
> OSSH_CHECK_HEADER_FOR_FIELD routine to me.  The problem was not
> present in the 4.2p1 configury.
> 
> However, this is just a heads up.  I have no patch so far.

I have found the cause.  It's sort of an autoconf problem.  The
OSSH_CHECK_HEADER_FOR_FIELD macro uses $EGREP.  The configure.ac
file does not explicitely test for egrep, but relies on a formerly
made egrep test.

However, $EGREP is evaluated by autoconf only once, at the point
where the first AC_CHECK_HEADER or AC_CHECK_HEADRERS is called in
the configure.ac file.

The problem now is, that the first occurance of AC_CHECK_HEADER/
AC_CHECK_HEADRERS is in the big "case "$host" in" statement, called
for the *-*-linux host triple.  You can easily check this by examining
the generated configure.  The EGREP test is only made in the linux
branch of the case statement.

No wonder this didn't happen in 4.2p1, since the new AC_CHECK_HEADER
tests in the case statement have been added for the tunnel device
header checks on Linux, NetBSD and FreeBSD.

One possible fix would be to move the zlib.h header file check before
the case statement.  When doing this, autoconf would generate the
EGREP test early enough, so that all OSes will get a valid $EGREP
value, which in turn lets the OSSH_CHECK_HEADER_FOR_FIELD test return
useful results.

Another possible fix is to add an explicit test for egrep, which would
be the best solution probably.


Corinna

-- 
Corinna Vinschen
Cygwin Project Co-Leader
Red Hat




More information about the openssh-unix-dev mailing list