sssd/0012-SECRETS-Return-ENOENT-when_deleting-a-non-existent-s.patch

49 lines
1.4 KiB
Diff
Raw Normal View History

From 2a287173752a2854df5e4bdb6b27328837be4805 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fabiano=20Fid=C3=AAncio?= <fidencio@redhat.com>
Date: Wed, 17 Aug 2016 13:12:21 +0200
Subject: [PATCH 12/39] SECRETS: Return ENOENT when_deleting a non-existent
secret
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
For this, just make use of the sysdb_error_to_errno() function.
Resolves:
https://fedorahosted.org/sssd/ticket/3125
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
(cherry picked from commit c4a3b24dc70fb50c8c0cc5490c29a3755d8b1b73)
---
src/responder/secrets/local.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/src/responder/secrets/local.c b/src/responder/secrets/local.c
index 17469249b357cbdc5e50ddff6b563fdf2f377577..ac3049b62fa77f69d44ec5792139fe3378afb3f4 100644
--- a/src/responder/secrets/local.c
+++ b/src/responder/secrets/local.c
@@ -375,15 +375,10 @@ int local_db_delete(TALLOC_CTX *mem_ctx,
int ret;
ret = local_db_dn(mem_ctx, lctx->ldb, req_path, &dn);
- if (ret != EOK) goto done;
+ if (ret != EOK) return ret;
ret = ldb_delete(lctx->ldb, dn);
- if (ret != EOK) {
- ret = EIO;
- }
-
-done:
- return ret;
+ return sysdb_error_to_errno(ret);
}
int local_db_create(TALLOC_CTX *mem_ctx,
--
2.9.3