From bbbb84fba76b14a84881b7121a05e848f39916d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 24 Feb 2026 16:47:59 +0100 Subject: [PATCH] sysrepo: Do not report old errors This is a bug introduced in sysrepo 4.x --- ...add-support-for-running-in-foregroun.patch | 6 +++- ...NE-to-return-any-error-to-sysrepocfg.patch | 6 +++- ...3-Allow-to-copy-from-factory-default.patch | 7 ++-- ...sysrepoctl-to-install-factory-config.patch | 7 ++-- ...e-new-log-level-SEC-for-audit-trails.patch | 6 +++- ...ail-for-high-priority-system-changes.patch | 6 +++- ...sr_shmsub_listen_thread-exit-process.patch | 6 +++- .../4.2.10/0008-Cross-compile-fixes.patch | 7 ++-- ...kfifo-set-sysrepo-group-if-available.patch | 6 +++- ..._path-reporting-stale-libyang-errors.patch | 32 +++++++++++++++++++ 10 files changed, 77 insertions(+), 12 deletions(-) create mode 100644 patches/sysrepo/4.2.10/0010-Fix-sr_lyd_new_path-reporting-stale-libyang-errors.patch diff --git a/patches/sysrepo/4.2.10/0001-sysrepo-plugind-add-support-for-running-in-foregroun.patch b/patches/sysrepo/4.2.10/0001-sysrepo-plugind-add-support-for-running-in-foregroun.patch index 251697fb..de6f9661 100644 --- a/patches/sysrepo/4.2.10/0001-sysrepo-plugind-add-support-for-running-in-foregroun.patch +++ b/patches/sysrepo/4.2.10/0001-sysrepo-plugind-add-support-for-running-in-foregroun.patch @@ -1,11 +1,15 @@ From efe7706fd7397c2feb384afea00ee97e74287df0 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 28 Mar 2023 10:37:53 +0200 -Subject: [PATCH 1/9] sysrepo-plugind: add support for running in foreground +Subject: [PATCH 01/10] sysrepo-plugind: add support for running in foreground with syslog +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/executables/sysrepo-plugind.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/patches/sysrepo/4.2.10/0002-Allow-SR_EV_DONE-to-return-any-error-to-sysrepocfg.patch b/patches/sysrepo/4.2.10/0002-Allow-SR_EV_DONE-to-return-any-error-to-sysrepocfg.patch index f09b7561..6ae9c268 100644 --- a/patches/sysrepo/4.2.10/0002-Allow-SR_EV_DONE-to-return-any-error-to-sysrepocfg.patch +++ b/patches/sysrepo/4.2.10/0002-Allow-SR_EV_DONE-to-return-any-error-to-sysrepocfg.patch @@ -1,7 +1,10 @@ From 11b9938206cf2bafc456bb22e14c7f85a604760c Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 7 May 2024 15:41:53 +0200 -Subject: [PATCH 2/9] Allow SR_EV_DONE to return any error to sysrepocfg +Subject: [PATCH 02/10] Allow SR_EV_DONE to return any error to sysrepocfg +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires Importing a system configuration with sysrepocfg the model callbacks do @@ -17,6 +20,7 @@ This patch is a clumsy way of forcing the (first) error to bubble up to the surface and cause a non-zero exit code from sysrepocfg. Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/shm_sub.c | 40 +++++++++++++++++++++++++++++++--------- src/shm_sub.h | 2 +- diff --git a/patches/sysrepo/4.2.10/0003-Allow-to-copy-from-factory-default.patch b/patches/sysrepo/4.2.10/0003-Allow-to-copy-from-factory-default.patch index ccf526eb..f0ff852a 100644 --- a/patches/sysrepo/4.2.10/0003-Allow-to-copy-from-factory-default.patch +++ b/patches/sysrepo/4.2.10/0003-Allow-to-copy-from-factory-default.patch @@ -1,10 +1,13 @@ From 9e0267d4f20733b2a26df6d0ee0bc4019db8b13f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Wed, 8 May 2024 17:00:50 +0200 -Subject: [PATCH 3/9] Allow to copy from factory default +Subject: [PATCH 03/10] Allow to copy from factory default +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires -Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/sysrepo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches/sysrepo/4.2.10/0004-Add-z-switch-to-sysrepoctl-to-install-factory-config.patch b/patches/sysrepo/4.2.10/0004-Add-z-switch-to-sysrepoctl-to-install-factory-config.patch index a2d0d547..9c4bed15 100644 --- a/patches/sysrepo/4.2.10/0004-Add-z-switch-to-sysrepoctl-to-install-factory-config.patch +++ b/patches/sysrepo/4.2.10/0004-Add-z-switch-to-sysrepoctl-to-install-factory-config.patch @@ -1,13 +1,16 @@ From e0c899ba266b959544d7cc08c917cebba7ac91c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Mon, 6 May 2024 14:49:32 +0200 -Subject: [PATCH 4/9] Add -z switch to sysrepoctl to install factory config +Subject: [PATCH 04/10] Add -z switch to sysrepoctl to install factory config from a json file +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires This to be able to load the yang modules during build time instead on boot. -Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/executables/sysrepoctl.c | 20 +++++++++++++-- src/lyd_mods.h | 7 ++++++ diff --git a/patches/sysrepo/4.2.10/0005-Introduce-new-log-level-SEC-for-audit-trails.patch b/patches/sysrepo/4.2.10/0005-Introduce-new-log-level-SEC-for-audit-trails.patch index 1884baf9..949e962c 100644 --- a/patches/sysrepo/4.2.10/0005-Introduce-new-log-level-SEC-for-audit-trails.patch +++ b/patches/sysrepo/4.2.10/0005-Introduce-new-log-level-SEC-for-audit-trails.patch @@ -1,7 +1,10 @@ From c7602dc8eabb941e0a163208aaf4de92dd5ef526 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 21 Aug 2024 16:00:35 +0200 -Subject: [PATCH 5/9] Introduce new log level [SEC] for audit trails +Subject: [PATCH 05/10] Introduce new log level [SEC] for audit trails +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires This adds a new log level for security and audit trail related log @@ -19,6 +22,7 @@ system log daemon, dropping any [SEVERITY] prefix. Also, \n is most often dropped by log daemons. Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/log.c | 18 +++++++++++++++++- src/log.h | 1 + diff --git a/patches/sysrepo/4.2.10/0006-Add-audit-trail-for-high-priority-system-changes.patch b/patches/sysrepo/4.2.10/0006-Add-audit-trail-for-high-priority-system-changes.patch index 68ce67cb..76255bd7 100644 --- a/patches/sysrepo/4.2.10/0006-Add-audit-trail-for-high-priority-system-changes.patch +++ b/patches/sysrepo/4.2.10/0006-Add-audit-trail-for-high-priority-system-changes.patch @@ -1,7 +1,10 @@ From a86dfdd4a5cb74c1f8c90c8d5aea6f5505c1b88c Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 21 Aug 2024 16:04:43 +0200 -Subject: [PATCH 6/9] Add audit trail for high priority system changes +Subject: [PATCH 06/10] Add audit trail for high priority system changes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires Committing a change to running, copying to a datastore, or calling an @@ -13,6 +16,7 @@ is when the system actually activates the changes. Copying to startup or other datastores is handled separately. Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/sysrepo.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/sysrepo/4.2.10/0007-On-error-in-sr_shmsub_listen_thread-exit-process.patch b/patches/sysrepo/4.2.10/0007-On-error-in-sr_shmsub_listen_thread-exit-process.patch index c02449e6..c941de79 100644 --- a/patches/sysrepo/4.2.10/0007-On-error-in-sr_shmsub_listen_thread-exit-process.patch +++ b/patches/sysrepo/4.2.10/0007-On-error-in-sr_shmsub_listen_thread-exit-process.patch @@ -1,7 +1,10 @@ From dbf08c67d8f17bdf98466b18fd72a230269e5d46 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Fri, 23 Aug 2024 12:22:06 +0200 -Subject: [PATCH 7/9] On error in sr_shmsub_listen_thread(), exit process +Subject: [PATCH 07/10] On error in sr_shmsub_listen_thread(), exit process +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires If processing callback events in, e.g., sysrepo-plugind, make sure to @@ -9,6 +12,7 @@ log the error and exit(1) the entire process so the system can decide to handle the problem. For example, restart all dependent services. Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/shm_sub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/patches/sysrepo/4.2.10/0008-Cross-compile-fixes.patch b/patches/sysrepo/4.2.10/0008-Cross-compile-fixes.patch index 221b13f9..87f0d085 100644 --- a/patches/sysrepo/4.2.10/0008-Cross-compile-fixes.patch +++ b/patches/sysrepo/4.2.10/0008-Cross-compile-fixes.patch @@ -1,10 +1,13 @@ From 2549c966c090dd38a7a09907d27d13107d15aedd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Tue, 16 Dec 2025 08:18:32 +0100 -Subject: [PATCH 8/9] Cross compile fixes +Subject: [PATCH 08/10] Cross compile fixes +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires -Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- CMakeModules/SetupPrintedContext.cmake | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/patches/sysrepo/4.2.10/0009-sr_mkfifo-set-sysrepo-group-if-available.patch b/patches/sysrepo/4.2.10/0009-sr_mkfifo-set-sysrepo-group-if-available.patch index d75f9d57..fb52d330 100644 --- a/patches/sysrepo/4.2.10/0009-sr_mkfifo-set-sysrepo-group-if-available.patch +++ b/patches/sysrepo/4.2.10/0009-sr_mkfifo-set-sysrepo-group-if-available.patch @@ -1,13 +1,17 @@ From 78d62382bf9d665764844a0f686b27e42d73bea9 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 7 Jan 2026 18:09:32 +0100 -Subject: [PATCH 9/9] sr_mkfifo(): set sysrepo group if available +Subject: [PATCH 09/10] sr_mkfifo(): set sysrepo group if available +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit Organization: Wires We already set the umask, set the group to allow users of the sysrepo group to initiate events. Signed-off-by: Joachim Wiberg +Signed-off-by: Mattias Walström --- src/common.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/patches/sysrepo/4.2.10/0010-Fix-sr_lyd_new_path-reporting-stale-libyang-errors.patch b/patches/sysrepo/4.2.10/0010-Fix-sr_lyd_new_path-reporting-stale-libyang-errors.patch new file mode 100644 index 00000000..af2266fa --- /dev/null +++ b/patches/sysrepo/4.2.10/0010-Fix-sr_lyd_new_path-reporting-stale-libyang-errors.patch @@ -0,0 +1,32 @@ +From ab76b2dd926cd181838b555ef4e25712539aeabc Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= +Date: Tue, 24 Feb 2026 16:45:35 +0100 +Subject: [PATCH 10/10] Fix sr_lyd_new_path() reporting stale libyang errors +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +Organization: Wires + +Signed-off-by: Mattias Walström +--- + src/ly_wrap.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/ly_wrap.c b/src/ly_wrap.c +index 340b8b2a..465580e0 100644 +--- a/src/ly_wrap.c ++++ b/src/ly_wrap.c +@@ -610,6 +610,10 @@ sr_lyd_new_path(struct lyd_node *parent, const struct ly_ctx *ctx, const char *p + { + sr_error_info_t *err_info = NULL; + uint32_t temp_lo = LY_LOSTORE; ++ const struct ly_ctx *err_ctx = ctx ? ctx : LYD_CTX(parent); ++ ++ /* clear any stale errors so sr_errinfo_new_ly() only finds fresh ones */ ++ ly_err_clean((struct ly_ctx *)err_ctx, NULL); + + ly_temp_log_options(&temp_lo); + +-- +2.43.0 +