summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-01-28 11:21:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-02-18 16:24:14 +0100
commitdcc7ceea40ffbe6bcf30c58180af632861cc32bb (patch)
treeef58f89e23176314c9a779f38cf7b1b2b462f67e
parent2ce4203ca72f265e664bfec3481a17b233b1832b (diff)
downloadsssd-dcc7ceea40ffbe6bcf30c58180af632861cc32bb.tar.gz
sssd-dcc7ceea40ffbe6bcf30c58180af632861cc32bb.tar.xz
sssd-dcc7ceea40ffbe6bcf30c58180af632861cc32bb.zip
LDAP: Add better DEBUG messages to the cleanup task
Some failures would shortcut to the done handler without telling us anything about why it failed. This commit decorates the cleanup task with more DEBUG statements. Reviewed-by: Pavel Reichl <preichl@redhat.com>
-rw-r--r--src/providers/ldap/ldap_id_cleanup.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/providers/ldap/ldap_id_cleanup.c b/src/providers/ldap/ldap_id_cleanup.c
index f78d4b404..dd1e2d7db 100644
--- a/src/providers/ldap/ldap_id_cleanup.c
+++ b/src/providers/ldap/ldap_id_cleanup.c
@@ -236,6 +236,7 @@ static int cleanup_users(struct sdap_options *opts,
* the cleanup in that case
*/
if (ret != EOK && ret != ENOSYS) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "get_uid_table failed: %d\n", ret);
goto done;
}
@@ -247,6 +248,7 @@ static int cleanup_users(struct sdap_options *opts,
ret = EFAULT;
goto done;
}
+ DEBUG(SSSDBG_TRACE_ALL, "Processing user %s\n", name);
if (uid_table) {
ret = cleanup_users_logged_in(uid_table, msgs[i]);
@@ -257,6 +259,8 @@ static int cleanup_users(struct sdap_options *opts,
"keeping data\n", name);
continue;
} else if (ret != ENOENT) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ "Cannot check if user is logged in: %d\n", ret);
goto done;
}
}
@@ -265,6 +269,7 @@ static int cleanup_users(struct sdap_options *opts,
DEBUG(SSSDBG_TRACE_ALL, "About to delete user %s\n", name);
ret = sysdb_delete_user(dom, name, 0);
if (ret) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "sysdb_delete_user failed: %d\n", ret);
goto done;
}
}
@@ -300,6 +305,7 @@ static int cleanup_users_logged_in(hash_table_t *table,
return ENOENT;
}
+ DEBUG(SSSDBG_OP_FAILURE, "hash_lookup failed: %d\n", ret);
return EIO;
}
@@ -356,6 +362,7 @@ static int cleanup_groups(TALLOC_CTX *memctx,
for (i = 0; i < count; i++) {
dn = ldb_dn_get_linearized(msgs[i]->dn);
if (!dn) {
+ DEBUG(SSSDBG_CRIT_FAILURE, "Cannot linearize DN!\n");
ret = EFAULT;
goto done;
}
@@ -387,6 +394,8 @@ static int cleanup_groups(TALLOC_CTX *memctx,
goto done;
}
+ DEBUG(SSSDBG_TRACE_LIBS, "Searching with: %s\n", subfilter);
+
ret = sysdb_search_entry(tmpctx, sysdb, base_dn,
LDB_SCOPE_SUBTREE, subfilter, NULL,
&u_count, &u_msgs);
@@ -410,6 +419,8 @@ static int cleanup_groups(TALLOC_CTX *memctx,
}
}
if (ret != EOK) {
+ DEBUG(SSSDBG_CRIT_FAILURE,
+ "Failed to search sysdb using %s: %d\n", subfilter, ret);
goto done;
}
talloc_zfree(u_msgs);