From 81b4fdb274a2dd17eff4f7a5d82aba75fd345194 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Tue, 28 Nov 2023 17:02:13 +0100 Subject: [PATCH] Added SSHD_BIN in configure.ac --- configure | 55 ++++++++++++++++++++++++++++-- configure.ac | 8 +++-- include/clixon_config.h.in | 3 ++ lib/src/clixon_datastore_write.c | 1 + util/clixon_netconf_ssh_callhome.c | 2 +- 5 files changed, 64 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 248c4e4b..22f31aed 100755 --- a/configure +++ b/configure @@ -654,6 +654,7 @@ CLIGEN_DIR WC_BIN TAIL_BIN GREP +SSHD_BIN SSH_BIN LEXLIB LEX_OUTPUT_ROOT @@ -5685,7 +5686,7 @@ if test "$LEX" = ":"; then as_fn_error $? "CLIXON does not find lex or flex." "$LINENO" 5 fi -# SSH binary path +# SSH binary path for client and test # Extract the first word of "ssh", so it can be a program name with args. set dummy ssh; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 @@ -5732,7 +5733,57 @@ fi -printf "%s\n" "#define SSH_BIN \"$SSH_BIN\"" >>confdefs.h +printf "%s\n" "#define SSH_BIN \"${SSH_BIN}\"" >>confdefs.h + + +# SSHD binary path for test +# Extract the first word of "sshd", so it can be a program name with args. +set dummy sshd; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SSHD_BIN+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SSHD_BIN in + [\\/]* | ?:[\\/]*) + ac_cv_path_SSHD_BIN="$SSHD_BIN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SSHD_BIN="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + ;; +esac +fi +SSHD_BIN=$ac_cv_path_SSHD_BIN +if test -n "$SSHD_BIN"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SSHD_BIN" >&5 +printf "%s\n" "$SSHD_BIN" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + + +printf "%s\n" "#define SSHD_BIN \"${SSHD_BIN}\"" >>confdefs.h # For cli pipe output functions diff --git a/configure.ac b/configure.ac index 797e480a..a9e8ae11 100644 --- a/configure.ac +++ b/configure.ac @@ -151,9 +151,13 @@ if test "$LEX" = ":"; then AC_MSG_ERROR(CLIXON does not find lex or flex.) fi -# SSH binary path +# SSH binary path for client and test AC_PATH_PROG(SSH_BIN, ssh) -AC_DEFINE_UNQUOTED(SSH_BIN, "$SSH_BIN", [SSH binary]) +AC_DEFINE_UNQUOTED(SSH_BIN, "${SSH_BIN}", [SSH binary]) + +# SSHD binary path for test +AC_PATH_PROG(SSHD_BIN, sshd) +AC_DEFINE_UNQUOTED(SSHD_BIN, "${SSHD_BIN}", [SSHD binary]) # For cli pipe output functions AC_PROG_GREP diff --git a/include/clixon_config.h.in b/include/clixon_config.h.in index 32b8430e..16318b16 100644 --- a/include/clixon_config.h.in +++ b/include/clixon_config.h.in @@ -171,6 +171,9 @@ /* Default restconf network namespace */ #undef RESTCONF_NETNS_DEFAULT +/* SSHD binary */ +#undef SSHD_BIN + /* SSH binary */ #undef SSH_BIN diff --git a/lib/src/clixon_datastore_write.c b/lib/src/clixon_datastore_write.c index ef008562..524f3036 100644 --- a/lib/src/clixon_datastore_write.c +++ b/lib/src/clixon_datastore_write.c @@ -78,6 +78,7 @@ #include "clixon_yang_schema_mount.h" #include "clixon_xml_nsctx.h" #include "clixon_xml_io.h" +#include "clixon_xml_bind.h" #include "clixon_xml_default.h" #include "clixon_xml_map.h" #include "clixon_datastore.h" diff --git a/util/clixon_netconf_ssh_callhome.c b/util/clixon_netconf_ssh_callhome.c index 2fb09082..c1138861 100644 --- a/util/clixon_netconf_ssh_callhome.c +++ b/util/clixon_netconf_ssh_callhome.c @@ -83,7 +83,7 @@ sudo clixon_netconf_ssh_callhome -a 127.0.0.1 -c /var/tmp/./test_netconf_ssh_cal #include #define NETCONF_CH_SSH 4334 -#define SSHDBIN_DEFAULT CLIXON_CONFIG_SBINDIR "/sshd" +#define SSHDBIN_DEFAULT SSHD_BIN #define UTIL_OPTS "hD:f:a:p:s:c:C:" static int