Report information
The Basics
Id:
43328
Status:
resolved
Priority:
Medium/Medium
Queue:

People
Owner:
Nobody in particular
Cc:
AdminCc:

BugTracker
Version Fixed:
9.9.10, 9.9.10-S1, 9.10.5, 9.11.1, 9.12.0
Version Found:
(no value)
Versions Affected:
(no value)
Versions Planned:
(no value)
Priority:
P2 Normal
Severity:
S2 Normal
CVSS Score:
(no value)
CVE ID:
(no value)
Component:
BIND Infrastructure
Area:
bug

Dates
Created:Wed, 05 Oct 2016 10:50:01 -0400
Updated:Wed, 26 Jul 2017 02:19:13 -0400
Closed:Tue, 11 Oct 2016 20:58:19 -0400



This bug tracker is no longer active.

Please go to our Gitlab to submit issues (both feature requests and bug reports) for active projects maintained by Internet Systems Consortium (ISC).

Due to security and confidentiality requirements, full access is limited to the primary maintainers.

CC: dot@dotat.at
Subject: [PATCH] configure: fail if readline was asked for but not found
Date: Wed, 5 Oct 2016 15:49:50 +0100
To: bind9-bugs@isc.org
From: "Tony Finch" <dot@dotat.at>
With most optional features (--with-libxml2 --with-libjson etc usw) the build will fail if you ./configure --with-FEATURE and FEATURE is not available. This does not work for readline - the failure is ignored. The following patch fixes the bug and incidentally removes a little bit of duplicated code. --- configure.in | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/configure.in b/configure.in index 18a08a5..0731005 100644 --- a/configure.in +++ b/configure.in @@ -3436,12 +3436,16 @@ AC_SUBST(ISC_PLATFORM_NEEDSTRCASESTR) AC_SUBST(READLINE_LIB) AC_ARG_WITH(readline, [ --with-readline[=LIBSPEC] specify readline library [default auto]], - readline="$withval", readline="auto") -case "$readline" in + use_readline="$withval", use_readline="auto") +case "$use_readline" in no) ;; -yes|auto) +*) saved_LIBS="$LIBS" - for readline in -ledit -lreadline + case "$use_readline" in + yes|auto) readline_libs="-ledit -lreadline" ;; + *) readline_libs="$use_readline" ;; + esac + for readline in $readline_libs do LIBS="$readline" AC_MSG_NOTICE(checking for readline with $readline) @@ -3468,29 +3472,10 @@ yes|auto) break fi done - LIBS="$saved_LIBS" - ;; -*) - saved_LIBS="$LIBS" - LIBS="$readline" - AC_MSG_NOTICE(checking for readline with $readline) - AC_CHECK_FUNCS(readline) - if test "$ac_cv_func_readline" = "yes" + if test "$use_readline" != "auto" && + test "X$READLINE_LIB" = "X" then - READLINE_LIB="$readline" - else - for lib in -lterminfo -ltermcap -lncurses -lcurses - do - AC_MSG_NOTICE(checking for readline with $readline $lib) - unset ac_cv_func_readline - LIBS="$readline $lib" - AC_CHECK_FUNCS(readline) - if test "$ac_cv_func_readline" = "yes" - then - READLINE_LIB="$readline $lib" - break - fi - done + AC_MSG_ERROR([The readline library was not found.]) fi LIBS="$saved_LIBS" ;; -- 2.1.4
4484. [bug] Failure to find readline when requested should be fatal to configure. [RT #43328] This is different to the patch you sent.
Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 07:14:52 +0100
To: bind9-review@isc.org
From: "Tony Finch" <dot@dotat.at>

On 11 Oct 2016, at 05:18, Mark Andrews via RT <bind9-review@isc.org> wrote:

4484.   [bug]           Failure to find readline when requested should be
                       fatal to configure. [RT #43328]

This is different to the patch you sent.

Thanks!

But I think that doesn't work in the "yes" case because $readline gets clobbered by the loop that looks for -ledit -lreadline, which is why my original patch was more complicated.

Tony.
-- 
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at


Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 07:17:37 +0100
To: bind9-notes@isc.org
From: "Tony Finch" <dot@dotat.at>
Also I think this mail client might have clobbered the display name on your role address :-( Sorry for any muddled attribution! Tony. -- f.anthony.n.finch <dot@dotat.at> http://dotat.at
Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 17:34:54 +1100
To: bind9-notes@isc.org
From: "Mark Andrews" <marka@isc.org>
In message <rt-4.2.8-44990-1476166499-184.43328-4-0@isc.org>, "Tony Finch via RT" writes: > > > On 11 Oct 2016, at 05:18, Mark Andrews via RT <bind9-review@isc.org> wrote: > > > > 4484. [bug] Failure to find readline when requested should be > > fatal to configure. [RT #43328] > > > > This is different to the patch you sent. > > > Thanks! > > But I think that doesn't work in the "yes" case because $readline gets > clobbered by the loop that looks for -ledit -lreadline, which is why my original > patch was more complicated. Addressed. B.T.W. your patch didn't preserve "-lx -ly" style configure args. > Tony. > -- > f.anthony.n.finch <dot@dotat.at> http://dotat.at > > > > -- > Ticket History: https://bugs.isc.org/Ticket/Display.html?id=43328 -- Mark Andrews, ISC 1 Seymour St., Dundas Valley, NSW 2117, Australia PHONE: +61 2 9871 4742 INTERNET: marka@isc.org
Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 07:49:45 +0100
To: "Mark Andrews via RT" <bind9-notes@isc.org>
From: "Tony Finch" <dot@dotat.at>
Mark Andrews via RT <bind9-notes@isc.org> wrote:
>
> Addressed.
> B.T.W. your patch didn't preserve "-lx -ly" style configure args.

Oh, I thought I had tested that - it's the reason for the use_readline and readline_libs juggling...

Tony.
--
f.anthony.n.finch  <dot@dotat.at>  http://dotat.at/  -  I xn--
  zr8h punycode


Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 15:34:19 +0100
To: bind9-bugs@isc.org
From: "Tony Finch" <dot@dotat.at>
I have re-tested the current master (rev ccf0bea98) and it still has the original bug, i.e. in the following, either ./configure should fail, or HAVE_READLINE should be 1. $ ./configure --with-readline >/dev/null $ echo $? 0 $ grep HAVE_READLINE config.h /* #undef HAVE_READLINE */ The test script I have attached to this message shows what behaviour I expect, in particular how readline should work in a simila way to libjson, and illustrates the problem in a reproducible way (on Debian). I have attached an updated version of my fix. With the fix, the test script it runs to completion successfully. Tony. -- f.anthony.n.finch <dot@dotat.at> http://dotat.at/ - I xn--zr8h punycode Forth, Tyne, Dogger: East or northeast 5 or 6. Moderate. Showers. Good.

Message body not shown because it is not plain text.

Message body is not shown because sender requested not to inline it.

Message body is not shown because sender requested not to inline it.

Subject: Re: [ISC-Bugs #43328] [PATCH] configure: fail if readline was asked for but not found
Date: Tue, 11 Oct 2016 15:58:01 +0100
To: "Tony Finch via RT" <bind9-notes@isc.org>
From: "Tony Finch" <dot@dotat.at>
Er, sorry, I failed to fix the tow-libraries bug that Mark pointed out. I have revised the patch and it now passes the two test cases below (and you have to change the testrun configure invocation to use "$1" instead of bare $1) testrun --with-readline="-lreadline -lcurses" 1 "undef HAVE_READLINE" present twofail testrun --with-readline="-lreadline -ltermcap" 0 "define HAVE_READLINE" present twogood Tony. -- f.anthony.n.finch <dot@dotat.at> http://dotat.at/ - I xn--zr8h punycode Fair Isle: Easterly or southeasterly 3 or 4, occasionally 5 in southwest. Slight or moderate. Fair. Good.

Message body is not shown because sender requested not to inline it.

On Tue Oct 11 04:58:07 2016, dot@dotat.at wrote: > Er, sorry, I failed to fix the tow-libraries bug that Mark pointed > out. > > I have revised the patch and it now passes the two test cases below > (and > you have to change the testrun configure invocation to use "$1" > instead of > bare $1) > > testrun --with-readline="-lreadline -lcurses" 1 "undef HAVE_READLINE" > present twofail > testrun --with-readline="-lreadline -ltermcap" 0 "define > HAVE_READLINE" present twogood > > Tony. committed