[SSSD] [PATCH] SYSDB: More debugging during the conversion to ghost users

Jakub Hrozek jhrozek at redhat.com
Tue Dec 11 23:20:55 UTC 2012


We've been hitting situations where the sysdb conversion failed.
Unfortunately, the current code doesn't include enough debugging info to
pinpoint the failing entries. This patch adds more DEBUG statements for
each processed entry.
-------------- next part --------------
>From 069d6c37ebadf18a1b8a9b55b214da8a9f4f7435 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Tue, 11 Dec 2012 23:52:52 +0100
Subject: [PATCH] SYSDB: More debugging during the conversion to ghost users

We've been hitting situations where the sysdb conversion failed.
Unfortunately, the current code doesn't include enough debugging info to
pinpoint the failing entries. This patch adds more DEBUG statements for
each processed entry.
---
 src/db/sysdb_upgrade.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
index 87ae4d19f9491fbf758c2e702afd84f933863991..fc9b2c96442aa98af141a969f180b888d573206b 100644
--- a/src/db/sysdb_upgrade.c
+++ b/src/db/sysdb_upgrade.c
@@ -1059,6 +1059,9 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver)
             goto done;
         }
 
+        DEBUG(SSSDBG_TRACE_LIBS, ("User [%s] is a member of %d groups\n",
+              name, memberof_el->num_values));
+
         for (j = 0; j < memberof_el->num_values; j++) {
             msg = ldb_msg_new(tmp_ctx);
             if (msg == NULL) {
@@ -1091,6 +1094,9 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver)
                 goto done;
             }
 
+            DEBUG(SSSDBG_TRACE_FUNC, ("Adding ghost [%s] to entry [%s]\n",
+                  name, ldb_dn_get_linearized(msg->dn)));
+
             ret = ldb_modify(sysdb->ldb, msg);
             talloc_zfree(msg);
             if (ret != LDB_SUCCESS) {
@@ -1099,6 +1105,9 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, const char **ver)
             }
         }
 
+        DEBUG(SSSDBG_TRACE_FUNC, ("Removing fake user [%s]\n",
+              ldb_dn_get_linearized(user->dn)));
+
         ret = ldb_delete(sysdb->ldb, user->dn);
         if (ret != LDB_SUCCESS) {
             ret = sysdb_error_to_errno(ret);
-- 
1.8.0.1



More information about the sssd-devel mailing list