From f0a33e7b286a1004493fa9f5f634730af92bd202 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Wed, 16 Sep 2020 09:45:59 +0200 Subject: [PATCH] client: drop support for GNU readline GNU readline switched to GPLv3+ in version 6.0, which is incompatible with the chrony's GPLv2 license. Drop support for the readline library. Only editline is supported now. --- client.c | 7 +----- configure | 50 ++----------------------------------------- doc/installation.adoc | 39 +-------------------------------- 3 files changed, 4 insertions(+), 92 deletions(-) diff --git a/client.c b/client.c index d117969..548875b 100644 --- a/client.c +++ b/client.c @@ -44,12 +44,7 @@ #include "util.h" #ifdef FEAT_READLINE -#ifdef USE_EDITLINE #include -#else -#include -#include -#endif #endif /* ================================================== */ @@ -1267,7 +1262,7 @@ give_help(void) } /* ================================================== */ -/* Tab-completion when editline/readline is available */ +/* Tab-completion when editline is available */ #ifdef FEAT_READLINE diff --git a/configure b/configure index d13b85e..027da70 100755 --- a/configure +++ b/configure @@ -108,11 +108,7 @@ for instance \`--prefix=$HOME'. For better control, use the options below. --disable-readline Disable line editing support - --without-readline Don't use GNU readline even if it is available --without-editline Don't use editline even if it is available - --with-readline-includes=DIR Specify where readline include directory is - --with-readline-library=DIR Specify where readline lib directory is - --with-ncurses-library=DIR Specify where ncurses lib directory is --disable-sechash Disable support for hashes other than MD5 --without-nettle Don't use nettle even if it is available --without-nss Don't use NSS even if it is available @@ -225,7 +221,6 @@ feat_cmdmon=1 feat_ntp=1 feat_refclock=1 feat_readline=1 -try_readline=1 try_editline=1 feat_sechash=1 try_nettle=1 @@ -241,9 +236,6 @@ try_clockctl=0 feat_scfilter=0 try_seccomp=-1 priv_ops="" -readline_lib="" -readline_inc="" -ncurses_lib="" feat_ipv6=1 feat_phc=1 try_phc=0 @@ -274,21 +266,9 @@ do --disable-readline ) feat_readline=0 ;; - --without-readline ) - try_readline=0 - ;; --without-editline ) try_editline=0 ;; - --with-readline-library=* ) - readline_lib=-L`echo $option | sed -e 's/^.*=//;'` - ;; - --with-readline-includes=* ) - readline_inc=-I`echo $option | sed -e 's/^.*=//;'` - ;; - --with-ncurses-library=* ) - ncurses_lib=-L`echo $option | sed -e 's/^.*=//;'` - ;; --prefix=* | --install_prefix=* ) SETPREFIX=`echo $option | sed -e 's/[^=]*=//;'` ;; @@ -878,37 +858,11 @@ fi READLINE_LINK="" if [ $feat_readline = "1" ]; then if [ $try_editline = "1" ]; then - if test_code editline 'stdio.h editline/readline.h' \ - "$readline_inc" "$readline_lib -ledit" \ + if test_code editline 'stdio.h editline/readline.h' '' '-ledit' \ 'add_history(readline("prompt"));' then add_def FEAT_READLINE - add_def USE_EDITLINE - MYCPPFLAGS="$MYCPPFLAGS $readline_inc" - READLINE_LINK="$readline_lib -ledit" - fi - fi - - if [ "x$READLINE_LINK" = "x" ] && [ $try_readline = "1" ]; then - if test_code readline 'stdio.h readline/readline.h readline/history.h' \ - "$readline_inc" "$readline_lib -lreadline" \ - 'add_history(readline("prompt"));' - then - add_def FEAT_READLINE - MYCPPFLAGS="$MYCPPFLAGS $readline_inc" - READLINE_LINK="$readline_lib -lreadline" - fi - fi - - if [ "x$READLINE_LINK" = "x" ] && [ $try_readline = "1" ]; then - if test_code 'readline with -lncurses' \ - 'stdio.h readline/readline.h readline/history.h' \ - "$readline_inc" "$readline_lib $ncurses_lib -lreadline -lncurses" \ - 'add_history(readline("prompt"));' - then - add_def FEAT_READLINE - MYCPPFLAGS="$MYCPPFLAGS $readline_inc" - READLINE_LINK="$readline_lib $ncurses_lib -lreadline -lncurses" + READLINE_LINK="-ledit" fi fi diff --git a/doc/installation.adoc b/doc/installation.adoc index 4684208..3a5c324 100644 --- a/doc/installation.adoc +++ b/doc/installation.adoc @@ -100,7 +100,7 @@ than MD5, which can be used for NTP authentication with a symmetric key. If you don't want to enable the support, specify the `--disable-sechash` flag to `configure`. -If development files for the editline or readline library are available, +If development files for the editline library are available, `chronyc` will be built with line editing support. If you don't want this, specify the `--disable-readline` flag to `configure`. @@ -170,43 +170,6 @@ https://github.com/seccomp/libseccomp[libseccomp] library and the the kernel attack surface and possibly prevent kernel exploits from `chronyd` if it is compromised. -== Support for line editing libraries - -`chronyc` can be built with support for line editing, this allows you to use -the cursor keys to replay and edit old commands. Two libraries are supported -which provide such functionality, editline and GNU readline. - -Please note that readline since version 6.0 is licensed under GPLv3+ which is -incompatible with chrony's license GPLv2. You should use editline instead if -you don't want to use older readline versions. - -The `configure` script will automatically enable the line editing support if -one of the supported libraries is available. If they are both available, the -editline library will be used. - -If you don't want to use it (in which case `chronyc` will use a minimal command -line interface), invoke `configure` like this: - ----- -./configure --disable-readline other-options... ----- - -If you have editline, readline or ncurses installed in locations that aren't -normally searched by the compiler and linker, you need to use extra options: - -`--with-readline-includes=directory_name`:: - This defines the name of the directory above the one where `readline.h` is. - `readline.h` is assumed to be in `editline` or `readline` subdirectory of the - named directory. - -`--with-readline-library=directory_name`:: - This defines the directory containing the `libedit.a` or `libedit.so` file, - or `libreadline.a` or `libreadline.so` file. - -`--with-ncurses-library=directory_name`:: - This defines the directory containing the `libncurses.a` or `libncurses.so` - file. - == Extra options for package builders The `configure` and `make` procedures have some extra options that may be