summaryrefslogtreecommitdiff
path: root/server/tools/sss_userdel.c
diff options
context:
space:
mode:
Diffstat (limited to 'server/tools/sss_userdel.c')
-rw-r--r--server/tools/sss_userdel.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/server/tools/sss_userdel.c b/server/tools/sss_userdel.c
index 7c796bb6..2e595f55 100644
--- a/server/tools/sss_userdel.c
+++ b/server/tools/sss_userdel.c
@@ -91,7 +91,7 @@ static void user_del(struct tevent_req *req)
return userdel_done(data, ret, NULL);
}
- user_dn = sysdb_user_dn(data->ctx->sysdb, data,
+ user_dn = sysdb_user_dn(data->sysdb, data,
data->domain->name, data->name);
if (!user_dn) {
DEBUG(1, ("Could not construct a user DN\n"));
@@ -265,8 +265,16 @@ int main(int argc, const char **argv)
goto fini;
}
+ ret = sysdb_get_ctx_from_list(ctx->db_list, data->domain, &data->sysdb);
+ if (ret != EOK) {
+ DEBUG(0, ("Cannot get domain database!\n"));
+ ERROR("Internal error accesing database\n");
+ ret = EXIT_FAILURE;
+ goto fini;
+ }
+
/* userdel */
- req = sysdb_transaction_send(ctx, ctx->ev, ctx->sysdb);
+ req = sysdb_transaction_send(ctx, ctx->ev, data->sysdb);
if (!req) {
DEBUG(1, ("Could not start transaction (%d)[%s]\n", ret, strerror(ret)));
ERROR("Transaction error. Could not remove user.\n");