bugGNU Wget - Bugs: bug #63431, --disable-ntlm ignored if nettle...

 
 

bug #63431: --disable-ntlm ignored if nettle is present

Submitter:  Hannu Nyman <hnyman>
Submitted:  Sun 27 Nov 2022 10:35:53 PM UTC
   
 
Category:  Build/Install Severity:  3 - Normal
Priority:  5 - Normal Status:  Fixed
Privacy:  Public Assigned to:  rockdaboot
Originator Name:  Open/Closed:  Closed
Release:  None Operating System:  None
Reproducibility:  Every Time Fixed Release:  trunk
Planned Release:  None Regression:  Yes
Work Required:  None Patch Included:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 10 Dec 2022 05:48:43 PM UTC, comment #2: 

It seems that the patch does not quite fully fix things for us.

Our purpose is to keep the no-SSL version of wget small, and avoid unnecessary features. (Context is OpenWrt, Linux for embedded routers with limited flash storage space).

Our buildbot also builds nettle as an optional extra package (along hundreds of others), so the wget compilation detects it in the build system, although we have no intention of forcing wget users to also install the rarely needed nettle.

With this new fix, I still similar error as earlier, that the presence of a nettle library forces it to be linked with "-lnettle" when there is no SSL feature. NTLM feature itself is shown disabled, but nettle is still forced into the build as a library.


--localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  --disable-rpath --disable-iri --disable-pcre2 --with-included-libunistring --without-libuuid --without-libpsl --disable-ntlm --without-ssl ; fi; )

configure: loading site script /Openwrt/e8450/include/site/aarch64
...
checking for zlib... yes
checking for nettle... yes
checking for INET6 protocol support... yes
...
  LDFlags:           -L/Openwrt/e8450/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/usr/lib -L/Openwrt/e8450/staging_dir/toolchain-aarch64_cortex-a53_gcc-11.3.0_musl/lib -znow -zrelro
  Libs:              -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lpcre  -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lnettle  -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lz 
  SSL:               no
  Zlib:              yes
  PSL:               no
  PCRE:              yes, via libpcre
  Digest:            yes
  NTLM:              no
  OPIE:              yes
  POSIX xattr:       yes


The fix apparently turns NTLM off, but still causes the nettle library to be included, although is only needed for the NTLM feature (to my understanding).

Likely line 644 in configure.ac gets applied.
https://git.savannah.gnu.org/cgit/wget.git/tree/configure.ac?id=485217d0ff8d0d17ea3815244b2bc2b747451e15#n644

In the earlier version of configure.ac, the inclusion of nettle was conditional for "if test x"$ENABLE_NTLM" != xno" on line 639. Otherwise the NETTLE_LIBS did not get applied on line 645:
https://git.savannah.gnu.org/cgit/wget.git/tree/configure.ac?id=c984cb316a790bf672b71d14d3b903921aacc00d#n635

Hopefully that behaviour can be restored.


For keeping the unnecessary nettle from being linked, I earlier authored the following patch to fix the problem. My patch fully disables nettle detection in the "disable-ntlm" case:

--- a/configure.ac
+++ b/configure.ac
@@ -630,6 +630,7 @@ then
     AC_DEFINE([ENABLE_NTLM], 1, [Define if you want the NTLM authorization support compiled in.])
   fi
 else
+ if test x"$ENABLE_NTLM" != xno; then
   PKG_CHECK_MODULES([NETTLE], nettle, [
     HAVE_NETTLE=yes
     LIBS="$NETTLE_LIBS $LIBS"
@@ -651,6 +652,7 @@ else
     ENABLE_NTLM=yes
     AC_DEFINE([ENABLE_NTLM], 1, [Define if you want the NTLM authorization support compiled in.])
   fi
+ fi
 fi
 
 dnl ********************************************************************





Hannu Nyman <hnyman>
Sat 10 Dec 2022 03:45:35 PM UTC, comment #1: 

Thanks for the report.

Tim Ruehsen <rockdaboot>
Group administrator
Sun 27 Nov 2022 10:35:53 PM UTC, original submission:  

Apparently with 1.21.3, the NTLM feature can't be disabled if the nettle library is detected to be present.

I suspect that commit a24e67e239e changed things so that the presence of nettle overrides the user's explicit selection of disabling NTLM.

https://git.savannah.gnu.org/cgit/wget.git/commit/?h=v1.21.3&id=a24e67e239ef949cc77a4c4e5a0beb703026a296

With the previous 1.21.2, the --disable-ntlm option worked ok, and the NTLM feature could be disabled even if the nettle library is present.


Extract from the configure step from the build log:
...
--localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls  --disable-rpath --disable-iri --disable-pcre2 --with-included-libunistring --without-libuuid --without-libpsl --disable-ntlm --without-ssl ; fi; )
configure: loading site script /Openwrt/e8450/include/site/aarch64
configure: configuring for GNU Wget 1.21.3
...
checking pkg-config is at least version 0.9.0... yes
checking for ZLIB... yes
checking for NETTLE... yes
checking for INET6 protocol support... yes
...
config.status: creating gnulib_po/Makefile
configure: Summary of build options:

  Version:           1.21.3
  Host OS:           linux-gnu
  Install prefix:    /usr
  Compiler:          aarch64-openwrt-linux-musl-gcc
  CFlags:            ...
  Libs:              -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lpcre  -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lnettle  -L/Openwrt/e8450/staging_dir/target-aarch64_cortex-a53_musl/usr/lib -lz 
  SSL:               no
  Zlib:              yes
  PSL:               no
  PCRE:              yes, via libpcre
  Digest:            yes
  NTLM:              yes
  OPIE:              yes
  POSIX xattr:       yes
...

Hannu Nyman <hnyman>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by rockdaboot (Posted a comment)
  • -email is unavailable- added by hnyman (Submitted the item)
  •  

    Follow 4 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-12-10 rockdaboot StatusNone Fixed
        Assigned toNone rockdaboot
        Open/ClosedOpen Closed
        Fixed ReleaseNone trunk

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code