sysrepo BUGFIX skip NACM on copy running->candidate
... which is technically discard-changes.
Reverts
Refs
@@ -3578,14 +3578,14 @@ sr_copy_config(sr_session_ctx_t *session, const char *module_name, sr_datastore_
}
}
- if ((src_datastore == SR_DS_RUNNING) && (session->ds == SR_DS_CANDIDATE) && !session->nacm_user) {
+ if ((src_datastore == SR_DS_RUNNING) && (session->ds == SR_DS_CANDIDATE)) {
/* add modules into mod_info without data */
if ((err_info = sr_modinfo_consolidate(&mod_info, 0, SR_LOCK_WRITE, SR_MI_DATA_NO | SR_MI_PERM_NO, session->sid,
session->orig_name, session->orig_data, 0, 0, 0))) {
goto cleanup;
}
- /* special case, just reset candidate */
+ /* special case, just reset candidate, no NACM checks (ref https://datatracker.ietf.org/doc/html/rfc8341#section-3.2.9) */
err_info = sr_modinfo_candidate_reset(&mod_info);
goto cleanup;
}
@@ -3604,8 +3604,7 @@ sr_copy_config(sr_session_ctx_t *session, const char *module_name, sr_datastore_
goto cleanup;
}
- if (((src_datastore == SR_DS_CANDIDATE) && (session->ds == SR_DS_RUNNING)) ||
- ((src_datastore == SR_DS_RUNNING) && (session->ds == SR_DS_CANDIDATE))) {
+ if ((src_datastore == SR_DS_CANDIDATE) && (session->ds == SR_DS_RUNNING)) {
/* MODULES WRITE LOCK */
if ((err_info = sr_shmmod_modinfo_wrlock(&mod_info, session->sid, 0))) {
goto cleanup;
