summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2015-01-28 11:21:40 +0100
committerJakub Hrozek <jhrozek@redhat.com>2015-02-17 16:04:52 +0100
commiteb85a718f4fd69ea1734b502f3d5f91758bd2020 (patch)
tree8dec79fa07366b7e540045c71a68ad14d555e5bc /src
parent2fec5f131ff3086d50e9e06e24951aa9f7d6ab5e (diff)
downloadsssd-eb85a718f4fd69ea1734b502f3d5f91758bd2020.tar.gz
sssd-eb85a718f4fd69ea1734b502f3d5f91758bd2020.tar.xz
sssd-eb85a718f4fd69ea1734b502f3d5f91758bd2020.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>
Diffstat (limited to 'src')
-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);