summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/db/sysdb_ops.c5
-rw-r--r--src/providers/ldap/ldap_id_netgroup.c6
2 files changed, 5 insertions, 6 deletions
diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 23264b41b..e8ef9a249 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -2275,10 +2275,13 @@ int sysdb_delete_netgroup(struct sysdb_ctx *sysdb,
ret = sysdb_search_netgroup_by_name(tmp_ctx, sysdb,
domain, name, NULL, &msg);
- if (ret != EOK) {
+ if (ret != EOK && ret != ENOENT) {
DEBUG(6, ("sysdb_search_netgroup_by_name failed: %d (%s)\n",
ret, strerror(ret)));
goto done;
+ } else if (ret == ENOENT) {
+ DEBUG(6, ("Netgroup does not exist, nothing to delete\n"));
+ goto done;
}
ret = sysdb_delete_entry(sysdb, msg->dn, false);
diff --git a/src/providers/ldap/ldap_id_netgroup.c b/src/providers/ldap/ldap_id_netgroup.c
index 6a668a1d6..11d0a39f3 100644
--- a/src/providers/ldap/ldap_id_netgroup.c
+++ b/src/providers/ldap/ldap_id_netgroup.c
@@ -201,14 +201,10 @@ static void netgroup_get_done(struct tevent_req *subreq)
if (ret == ENOENT) {
ret = sysdb_delete_netgroup(state->sysdb, state->domain, state->name);
- if (ret) {
+ if (ret != EOK && ret != ENOENT) {
tevent_req_error(req, ret);
return;
}
-
- state->dp_error = DP_ERR_OK;
- tevent_req_error(req, ENOENT);
- return;
}
state->dp_error = DP_ERR_OK;