sysrepo BUGFIX check internal module in replace_config
@@ -2689,6 +2689,10 @@ sr_replace_config(sr_session_ctx_t *session, const char *module_name, struct lyd
if (!ly_mod) {
sr_errinfo_new(&err_info, SR_ERR_NOT_FOUND, "Module \"%s\" was not found in sysrepo.", module_name);
goto cleanup;
+ } else if (!strcmp(ly_mod->name, SR_YANG_MOD)) {
+ sr_errinfo_new(&err_info, SR_ERR_UNSUPPORTED, "Data of internal module \"%s\" cannot be modified.",
+ SR_YANG_MOD);
+ goto cleanup;
}
}
@@ -2731,6 +2735,10 @@ sr_copy_config(sr_session_ctx_t *session, const char *module_name, sr_datastore_
if (!ly_mod) {
sr_errinfo_new(&err_info, SR_ERR_NOT_FOUND, "Module \"%s\" was not found in sysrepo.", module_name);
goto cleanup;
+ } else if (!strcmp(ly_mod->name, SR_YANG_MOD)) {
+ sr_errinfo_new(&err_info, SR_ERR_UNSUPPORTED, "Data of internal module \"%s\" cannot be modified.",
+ SR_YANG_MOD);
+ goto cleanup;
}
}
