From 9e0267d4f20733b2a26df6d0ee0bc4019db8b13f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= <lazzer@gmail.com>
Date: Wed, 8 May 2024 17:00:50 +0200
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: Mattias Walström <lazzer@gmail.com>
---
 src/sysrepo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/sysrepo.c b/src/sysrepo.c
index 542a55ba..80bfb42c 100644
--- a/src/sysrepo.c
+++ b/src/sysrepo.c
@@ -5023,7 +5023,7 @@ sr_copy_config(sr_session_ctx_t *session, const char *module_name, sr_datastore_
     const struct lys_module *ly_mod = NULL;
     sr_datastore_t ds1, ds2;
 
-    SR_CHECK_ARG_APIRET(!session || !SR_IS_CONVENTIONAL_DS(src_datastore) || !SR_IS_CONVENTIONAL_DS(session->ds),
+    SR_CHECK_ARG_APIRET(!session || (!SR_IS_CONVENTIONAL_DS(src_datastore) && (src_datastore != SR_DS_FACTORY_DEFAULT)) || !SR_IS_CONVENTIONAL_DS(session->ds),
             session, err_info);
 
     if (src_datastore == session->ds) {
-- 
2.43.0

