From 18c29f018a68e5ee892b4c0e5b27a594e504b046 Mon Sep 17 00:00:00 2001 From: Olof hagsand Date: Mon, 17 Feb 2025 10:46:38 +0100 Subject: [PATCH] Restconf: include -E configdir when starting restconf daemon --- apps/backend/backend_plugin_restconf.c | 6 ++++++ apps/restconf/restconf_main_native.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/backend/backend_plugin_restconf.c b/apps/backend/backend_plugin_restconf.c index cbdb75f7..18db73c8 100644 --- a/apps/backend/backend_plugin_restconf.c +++ b/apps/backend/backend_plugin_restconf.c @@ -270,6 +270,8 @@ restconf_pseudo_process_control(clixon_handle h) #ifdef RESTCONF_INLINE nr += 2; #endif + if (clicon_option_str(h, "CLICON_CONFIGDIR")) + nr += 2; if ((argv = calloc(nr, sizeof(char *))) == NULL){ clixon_err(OE_UNIX, errno, "calloc"); goto done; @@ -315,6 +317,10 @@ restconf_pseudo_process_control(clixon_handle h) argv[i++] = pgm; argv[i++] = "-f"; argv[i++] = clicon_option_str(h, "CLICON_CONFIGFILE"); + if (clicon_option_str(h, "CLICON_CONFIGDIR")) { + argv[i++] = "-E"; + argv[i++] = clicon_option_str(h, "CLICON_CONFIGDIR"); + } /* Add debug if backend has debug. * There is also a debug flag in clixon-restconf.yang but it kicks in after it starts * see restconf_pseudo_set_log which sets flag when process starts diff --git a/apps/restconf/restconf_main_native.c b/apps/restconf/restconf_main_native.c index 6be6b9f8..a60b962f 100644 --- a/apps/restconf/restconf_main_native.c +++ b/apps/restconf/restconf_main_native.c @@ -676,7 +676,14 @@ restconf_clixon_backend(clixon_handle h, clicon_session_id_set(h, id); break; } - if ((nsc = xml_nsctx_init(NULL, CLIXON_RESTCONF_NS)) == NULL) + if ((nsc = xml_nsctx_init(NULL, + /* XXX HARDCODED NAMESPACE NEEDS GENERIC MECHANISM */ +#if 1 + "http://clicon.org/controller" +#else + CLIXON_RESTCONF_NS +#endif + )) == NULL) goto done; if ((pw = getpwuid(getuid())) == NULL){ clixon_err(OE_UNIX, errno, "getpwuid");