Log if restconf started w/o configuration

This commit is contained in:
Philip Prindeville 2023-08-24 16:45:31 -06:00 committed by Olof Hagsand
parent 4a3fef4946
commit 6e314dd96f
2 changed files with 6 additions and 21 deletions

View file

@ -301,23 +301,10 @@ restconf_verify_certs(int preverify_ok,
static int
alpn_proto_dump(const char *label,
const char *inp,
int len)
unsigned len)
{
int retval = -1;
char *str = NULL;
if ((str = malloc(len+1)) == NULL){
clicon_err(OE_UNIX, errno, "malloc");
goto done;
}
strncpy(str, inp, len);
str[len] = '\0';
clicon_debug(1, "%s %s", label, str);
retval = 0;
done:
free(str);
return retval;
clicon_debug(1, "%s %.*s", label, (int)len, inp);
return 0;
}
/*! Application-layer Protocol Negotiation (alpn) callback
@ -533,7 +520,6 @@ restconf_checkcert_file(cxobj *xrestconf,
static int
restconf_accept_client(int fd,
void *arg)
{
int retval = -1;
restconf_socket *rsock;
@ -1315,7 +1301,7 @@ main(int argc,
if ((ret = restconf_clixon_init(h, inline_config, &xrestconf)) < 0)
goto done;
if (ret == 0){ /* restconf disabled */
clicon_debug(1, "restconf configuration not found or disabled");
clicon_log(LOG_INFO, "restconf configuration not found or disabled");
retval = 0;
goto done;
}

View file

@ -374,8 +374,7 @@ plugin_load_one(clicon_handle h,
if ((p=strrchr(name, '.')) != NULL)
*p = '\0';
/* Copy name to struct */
snprintf(cp->cp_name, sizeof(cp->cp_name), "%*s",
(int)strlen(name), name);
snprintf(cp->cp_name, sizeof(cp->cp_name), "%s", name);
cp->cp_api = *api;
if (cp){
*cpp = cp;
@ -481,7 +480,7 @@ clixon_pseudo_plugin(clicon_handle h,
goto done;
}
memset(cp, 0, sizeof(struct clixon_plugin));
snprintf(cp->cp_name, sizeof(cp->cp_name), "%*s", (int)strlen(name), name);
snprintf(cp->cp_name, sizeof(cp->cp_name), "%s", name);
ADDQ(cp, ms->ms_plugin_list);
*cpp = cp;
cp = NULL;