diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/tools/sss_groupdel.c | 12 | ||||
-rw-r--r-- | server/tools/sss_userdel.c | 13 |
2 files changed, 20 insertions, 5 deletions
diff --git a/server/tools/sss_groupdel.c b/server/tools/sss_groupdel.c index 29778263..a8b93578 100644 --- a/server/tools/sss_groupdel.c +++ b/server/tools/sss_groupdel.c @@ -97,7 +97,7 @@ static void group_del(struct tevent_req *req) return groupdel_done(data, ENOMEM, NULL); } - subreq = sysdb_delete_entry_send(data, data->ev, data->handle, group_dn); + subreq = sysdb_delete_entry_send(data, data->ev, data->handle, group_dn, false); if (!subreq) return groupdel_done(data, ENOMEM, NULL); @@ -255,7 +255,15 @@ int main(int argc, const char **argv) if (data->error) { ret = data->error; DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); - ERROR("Transaction error. Could not remove group.\n"); + switch (ret) { + case ENOENT: + ERROR("No such group\n"); + break; + + default: + ERROR("Internal error. Could not remove group.\n"); + break; + } ret = EXIT_FAILURE; goto fini; } diff --git a/server/tools/sss_userdel.c b/server/tools/sss_userdel.c index c4d9abd3..f7cb7571 100644 --- a/server/tools/sss_userdel.c +++ b/server/tools/sss_userdel.c @@ -98,7 +98,7 @@ static void user_del(struct tevent_req *req) return userdel_done(data, ENOMEM, NULL); } - subreq = sysdb_delete_entry_send(data, data->ev, data->handle, user_dn); + subreq = sysdb_delete_entry_send(data, data->ev, data->handle, user_dn, false); if (!subreq) return userdel_done(data, ENOMEM, NULL); @@ -115,7 +115,6 @@ static void user_del_done(struct tevent_req *subreq) return userdel_done(data, ret, NULL); } - static int userdel_legacy(struct ops_ctx *ctx) { int ret = EOK; @@ -257,7 +256,15 @@ int main(int argc, const char **argv) if (data->error) { ret = data->error; DEBUG(1, ("sysdb operation failed (%d)[%s]\n", ret, strerror(ret))); - ERROR("Internal error. Could not remove user.\n"); + switch (ret) { + case ENOENT: + ERROR("No such user\n"); + break; + + default: + ERROR("Internal error. Could not remove user.\n"); + break; + } ret = EXIT_FAILURE; goto fini; } |