diff options
Diffstat (limited to 'server/tools/sss_groupmod.c')
-rw-r--r-- | server/tools/sss_groupmod.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/server/tools/sss_groupmod.c b/server/tools/sss_groupmod.c index cca9abc6..6f60b6eb 100644 --- a/server/tools/sss_groupmod.c +++ b/server/tools/sss_groupmod.c @@ -156,13 +156,13 @@ static void remove_from_groups(struct ops_ctx *data) struct ldb_dn *member_dn; struct tevent_req *req; - parent_dn = sysdb_group_dn(data->ctx->sysdb, data, + parent_dn = sysdb_group_dn(data->sysdb, data, data->domain->name, data->name); if (!parent_dn) { return mod_group_done(data, ENOMEM); } - member_dn = sysdb_group_dn(data->ctx->sysdb, data, + member_dn = sysdb_group_dn(data->sysdb, data, data->domain->name, data->rmgroups[data->cur]); if (!member_dn) { @@ -213,13 +213,13 @@ static void add_to_groups(struct ops_ctx *data) struct ldb_dn *member_dn; struct tevent_req *req; - parent_dn = sysdb_group_dn(data->ctx->sysdb, data, + parent_dn = sysdb_group_dn(data->sysdb, data, data->domain->name, data->name); if (!parent_dn) { return mod_group_done(data, ENOMEM); } - member_dn = sysdb_group_dn(data->ctx->sysdb, data, + member_dn = sysdb_group_dn(data->sysdb, data, data->domain->name, data->addgroups[data->cur]); if (!member_dn) { @@ -463,7 +463,15 @@ int main(int argc, const char **argv) goto fini; } - req = sysdb_transaction_send(ctx, ctx->ev, ctx->sysdb); + 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; + } + + 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 modify group.\n"); |