There seems to be a logic bug in sysdb_master_domain_add_info(). We
first update the domain data with sysdb search results and then update
sysdb. I think it should be the other way around.
>From e5c1647c53fef818ac3fe824cf623f4fe647d6c1 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Sat, 17 Aug 2013 09:12:03 +0200
Subject: [PATCH] DB: Update sss_domain_info with new updated data

---
 src/db/sysdb_subdomains.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/db/sysdb_subdomains.c b/src/db/sysdb_subdomains.c
index 
58df470182ea6ecbb5b48e288ab6a3d3bcec18ba..c89e4569492fcfb0c7984c1c983a8d4d39e5cf75
 100644
--- a/src/db/sysdb_subdomains.c
+++ b/src/db/sysdb_subdomains.c
@@ -264,11 +264,6 @@ errno_t sysdb_master_domain_add_info(struct 
sss_domain_info *domain,
         return ENOMEM;
     }
 
-    ret = sysdb_master_domain_update(domain);
-    if (ret != EOK) {
-        goto done;
-    }
-
     msg = ldb_msg_new(tmp_ctx);
     if (msg == NULL) {
         ret = ENOMEM;
@@ -350,6 +345,11 @@ errno_t sysdb_master_domain_add_info(struct 
sss_domain_info *domain,
         goto done;
     }
 
+    ret = sysdb_master_domain_update(domain);
+    if (ret != EOK) {
+        goto done;
+    }
+
     ret = EOK;
 
 done:
-- 
1.8.3.1

_______________________________________________
sssd-devel mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to