NACM: Improved error message when no username included, and added username

This commit is contained in:
Olof hagsand 2024-04-14 11:26:11 +02:00
parent 87e49ca37a
commit 1be158b7be
4 changed files with 18 additions and 8 deletions

View file

@ -1908,9 +1908,10 @@ cli_process_control(clixon_handle h,
clixon_err(OE_UNIX, errno, "cbuf_new");
goto done;
}
cprintf(cb, "<rpc xmlns=\"%s\"", NETCONF_BASE_NAMESPACE);
cprintf(cb, " %s", NETCONF_MESSAGE_ID_ATTR);
cprintf(cb, ">");
cprintf(cb, "<rpc xmlns=\"%s\" username=\"%s\" %s>",
NETCONF_BASE_NAMESPACE,
clicon_username_get(h),
NETCONF_MESSAGE_ID_ATTR);
cprintf(cb, "<process-control xmlns=\"%s\">", CLIXON_LIB_NS);
cprintf(cb, "<name>%s</name>", name);
cprintf(cb, "<operation>%s</operation>", opstr);