summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2012-12-18 20:52:02 -0500
committerJakub Hrozek <jhrozek@redhat.com>2012-12-19 18:36:40 +0100
commit85da72d5b2730c0f7300c15ed17e672026987e44 (patch)
tree8125670049c44c1a55898115d15b747393d64ebd
parenteaeb4c5f754630f642ce0794f110540933d1b482 (diff)
downloadsssd-85da72d5b2730c0f7300c15ed17e672026987e44.tar.gz
sssd-85da72d5b2730c0f7300c15ed17e672026987e44.tar.xz
sssd-85da72d5b2730c0f7300c15ed17e672026987e44.zip
memberof: Prevent unneded failure case
When deleting a user we would fail the operation completely if the member attribute was not found on one of the groups it was allegedly member of. Failing in this case is unnecessary, and can cause issues. Found trying to upgrade db versione (and failing) on one of my RHEL machines. Also removed a tray \ in the companion function that removes ghost members, that function needs no changes as it was already ignoring this kind of failure.
-rw-r--r--src/ldb_modules/memberof.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ldb_modules/memberof.c b/src/ldb_modules/memberof.c
index 77662ebeb..338d18a46 100644
--- a/src/ldb_modules/memberof.c
+++ b/src/ldb_modules/memberof.c
@@ -2621,7 +2621,12 @@ static int mbof_del_muop_callback(struct ldb_request *req,
return ldb_module_done(ctx->req, NULL, NULL,
LDB_ERR_OPERATIONS_ERROR);
}
- if (ares->error != LDB_SUCCESS) {
+ /* if the attribute was not present it means the db is not
+ * perfectly consistent but failing here is not useful
+ * anyway and missing entries cause no harm if we are trying
+ * to remove them anyway */
+ if (ares->error != LDB_SUCCESS &&
+ ares->error != LDB_ERR_NO_SUCH_ATTRIBUTE) {
return ldb_module_done(ctx->req,
ares->controls,
ares->response,
@@ -2737,7 +2742,7 @@ static int mbof_del_ghop_callback(struct ldb_request *req,
* might have been directly nested in the parent as well and
* updated with another replace operation.
*/
- if (ares->error != LDB_SUCCESS && \
+ if (ares->error != LDB_SUCCESS &&
ares->error != LDB_ERR_NO_SUCH_ATTRIBUTE) {
return ldb_module_done(ctx->req,
ares->controls,