From 51efa5e2746cd164c0354531ea85c354f0051205 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 21 Aug 2024 14:26:46 +0200 Subject: [PATCH] cli: enable sysrepo logging to syslog for copy command Ensure audit trail events are logged for 'copy' to datastores. Signed-off-by: Joachim Wiberg --- src/klish-plugin-infix/src/infix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/klish-plugin-infix/src/infix.c b/src/klish-plugin-infix/src/infix.c index dbca27c3..5fa597cc 100644 --- a/src/klish-plugin-infix/src/infix.c +++ b/src/klish-plugin-infix/src/infix.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -434,9 +435,12 @@ int infix_copy(kcontext_t *ctx) goto err; } + sr_log_syslog("klishd", SR_LL_WRN); + if (sr_session_start(conn, dstds->datastore, &sess)) { fprintf(stderr, ERRMSG "unable to open transaction to %s\n", dst); } else { + sr_nacm_set_user(sess, username); rc = sr_copy_config(sess, NULL, srcds->datastore, 0); if (rc) emsg(sess, ERRMSG "unable to copy configuration, err %d: %s\n",