diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d8c7a7..84caa282 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,10 @@ * Restconf top-level operations GET root resource modified to comply with RFC 8040 Sec 3.1 * non-pretty print remove all spaces, eg `{"operations":{"clixon-example:client-rpc":[null]` * Replaced JSON `null` with `[null]` as proper empty JSON leaf/leaf-list encoding. - + +### Minor changes +* Configure and test modification for better Freebsd port + ### Corrected Bugs * Hello netconf candidate capability misspelled, mentioned in [Can clixon_netconf receive netconf packets as a server? #93](https://github.com/clicon/clixon/issues/93) * [Cannot write to config using restconf example #91](https://github.com/clicon/clixon/issues/91) diff --git a/configure b/configure index 3a9fbad8..07acdc2f 100755 --- a/configure +++ b/configure @@ -686,7 +686,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -769,7 +768,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE}' @@ -1022,15 +1020,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;; - -runstatedir | --runstatedir | --runstatedi | --runstated \ - | --runstate | --runstat | --runsta | --runst | --runs \ - | --run | --ru | --r) - ac_prev=runstatedir ;; - -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ - | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ - | --run=* | --ru=* | --r=*) - runstatedir=$ac_optarg ;; - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ @@ -1168,7 +1157,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. @@ -1321,7 +1310,6 @@ Fine tuning of the installation directories: --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] @@ -1381,8 +1369,8 @@ Some influential environment variables: you have headers in a nonstandard directory CPP C preprocessor YACC The `Yet Another Compiler Compiler' implementation to use. - Defaults to the first program found out of: `bison -y', `byacc', - `yacc'. + Defaults to the first program found out of: `bison -o y.tab.c', + `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. This script will default YFLAGS to the empty string to avoid a default value of `-d' given by some make applications. @@ -4011,7 +3999,7 @@ $as_echo "CFLAGS is $CFLAGS" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: INSTALLFLAGS is $INSTALLFLAGS" >&5 $as_echo "INSTALLFLAGS is $INSTALLFLAGS" >&6; } -for ac_prog in 'bison -y' byacc +for ac_prog in 'bison -o y.tab.c' byacc do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -4218,11 +4206,11 @@ if test "$LEX" = ":"; then fi # Get "bison" from bison -y or other string -bisonstr=$(expr substr "$YACC" 1 5) -if test "$bisonstr" != "bison"; then +if test "$YACC" = "${YACC##bison}" ; then as_fn_error $? "CLIXON does not find bison. There are several problems with yacc and byacc. Please install bison. YACC=\"$YACC\"" "$LINENO" 5 fi - +# Hardcoded to bison -y, seems to work in all bisons? +YACC="bison -y" if test "$prefix" = "NONE"; then prefix=${ac_default_prefix} diff --git a/configure.ac b/configure.ac index 7b4146b1..d4dff867 100644 --- a/configure.ac +++ b/configure.ac @@ -127,11 +127,11 @@ if test "$LEX" = ":"; then fi # Get "bison" from bison -y or other string -bisonstr=$(expr substr "$YACC" 1 5) -if test "$bisonstr" != "bison"; then +if test "$YACC" = "${YACC##bison}" ; then AC_MSG_ERROR(CLIXON does not find bison. There are several problems with yacc and byacc. Please install bison. YACC="$YACC") fi - +# Hardcoded to bison -y, seems to work in all bisons? +YACC="bison -y" if test "$prefix" = "NONE"; then prefix=${ac_default_prefix} diff --git a/doc/DEVELOP.md b/doc/DEVELOP.md index 5653251b..46b69d74 100644 --- a/doc/DEVELOP.md +++ b/doc/DEVELOP.md @@ -121,3 +121,7 @@ After release: CLIXON_VERSION="\"${CLIXON_VERSION_MAJOR}.${CLIXON_VERSION_MINOR}.${CLIXON_VERSION_PATCH}.PRE\"" ``` * Run autoconf + +## Use of constants etc + +Use MAXPATHLEN (not PATH_MAX) \ No newline at end of file diff --git a/lib/clixon/clixon.h.in b/lib/clixon/clixon.h.in index b1c81efa..c810acd9 100644 --- a/lib/clixon/clixon.h.in +++ b/lib/clixon/clixon.h.in @@ -48,6 +48,7 @@ #include #include /* gettimeofday */ #include +#include /* MAXPATHLEN */ /* * CLIXON version macros diff --git a/lib/clixon/clixon_plugin.h b/lib/clixon/clixon_plugin.h index f51a5b4f..2b8445c1 100644 --- a/lib/clixon/clixon_plugin.h +++ b/lib/clixon/clixon_plugin.h @@ -180,7 +180,7 @@ typedef struct clixon_plugin_api* (plginit2_t)(clicon_handle); /* Clixon plug struct clixon_plugin_api{ /*--- Common fields. ---*/ - char ca_name[PATH_MAX]; /* Name of plugin (given by plugin) */ + char ca_name[MAXPATHLEN]; /* Name of plugin (given by plugin) */ plginit2_t *ca_init; /* Clixon plugin Init (implicit) */ plgstart_t *ca_start; /* Plugin start */ plgexit_t *ca_exit; /* Plugin exit */ @@ -235,7 +235,7 @@ typedef struct clixon_plugin_api clixon_plugin_api; /* Internal plugin structure with dlopen() handle and plugin_api */ struct clixon_plugin{ - char cp_name[PATH_MAX]; /* Plugin filename. Note api ca_name is given by plugin itself */ + char cp_name[MAXPATHLEN]; /* Plugin filename. Note api ca_name is given by plugin itself */ plghndl_t cp_handle; /* Handle to plugin using dlopen(3) */ clixon_plugin_api cp_api; }; diff --git a/lib/src/clixon_plugin.c b/lib/src/clixon_plugin.c index c2d5cd3c..3541d0a1 100644 --- a/lib/src/clixon_plugin.c +++ b/lib/src/clixon_plugin.c @@ -509,7 +509,7 @@ rpc_callback_register(clicon_handle h, char *namespace, char *name) { - rpc_callback_t *rc; + rpc_callback_t *rc = NULL; if (name == NULL || namespace == NULL){ clicon_err(OE_DB, EINVAL, "name or namespace NULL"); diff --git a/lib/src/clixon_yang_module.c b/lib/src/clixon_yang_module.c index a5389275..5165af33 100644 --- a/lib/src/clixon_yang_module.c +++ b/lib/src/clixon_yang_module.c @@ -55,6 +55,7 @@ #include #include #include +#include /* cligen */ #include diff --git a/lib/src/clixon_yang_type.c b/lib/src/clixon_yang_type.c index b665dca3..9016cdc3 100644 --- a/lib/src/clixon_yang_type.c +++ b/lib/src/clixon_yang_type.c @@ -78,6 +78,7 @@ #include #include #include +#include /* cligen */ #include diff --git a/test/lib.sh b/test/lib.sh index eb9ab0c9..d2fa7c2d 100755 --- a/test/lib.sh +++ b/test/lib.sh @@ -77,7 +77,11 @@ testname= : ${RCLOG:=} # Wait after daemons (backend/restconf) start. See mem.sh for valgrind -: ${RCWAIT:=2} +: ${RCWAIT:=2} + +# www user (on linux typically www-data, freebsd www) +# could be taken from configure +: ${wwwuser:=www-data} # Parse yangmodels from https://github.com/YangModels/yang # Recommended: checkout yangmodels elsewhere in the tree and set the env diff --git a/test/test_augment.sh b/test/test_augment.sh index 313aa8ca..ac2db916 100755 --- a/test/test_augment.sh +++ b/test/test_augment.sh @@ -156,7 +156,7 @@ if [ $BE -ne 0 ]; then fi new "kill old restconf daemon" -sudo pkill -u www-data clixon_restconf +sudo pkill -u $wwwuser clixon_restconf new "start restconf daemon" start_restconf -f $cfg diff --git a/util/clixon_util_regexp.c b/util/clixon_util_regexp.c index d0990ef7..997df129 100644 --- a/util/clixon_util_regexp.c +++ b/util/clixon_util_regexp.c @@ -160,7 +160,7 @@ main(int argc, int c; char *regexp = NULL; char *content = NULL; - int ret; + int ret = 0; int nr = 1; int mode = 0; /* 0 is posix, 1 is libxml */