|
|
8d3578 |
From 49b5baf0e6ef978d971427160677c2c95e89c418 Mon Sep 17 00:00:00 2001
|
|
|
8d3578 |
From: =?UTF-8?q?Pavel=20B=C5=99ezina?= <pbrezina@redhat.com>
|
|
|
8d3578 |
Date: Thu, 15 Aug 2019 13:50:17 +0200
|
|
|
8d3578 |
Subject: [PATCH 73/90] sysdb: add sysdb_del_autofsentry_by_key
|
|
|
8d3578 |
MIME-Version: 1.0
|
|
|
8d3578 |
Content-Type: text/plain; charset=UTF-8
|
|
|
8d3578 |
Content-Transfer-Encoding: 8bit
|
|
|
8d3578 |
|
|
|
8d3578 |
Resolves:
|
|
|
8d3578 |
https://pagure.io/SSSD/sssd/issue/2607
|
|
|
8d3578 |
|
|
|
8d3578 |
Reviewed-by: Tomáš Halman <thalman@redhat.com>
|
|
|
8d3578 |
---
|
|
|
8d3578 |
src/db/sysdb_autofs.c | 22 ++++++++++++++++++++++
|
|
|
8d3578 |
src/db/sysdb_autofs.h | 5 +++++
|
|
|
8d3578 |
2 files changed, 27 insertions(+)
|
|
|
8d3578 |
|
|
|
8d3578 |
diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c
|
|
|
8d3578 |
index 971abafa3..11841d50d 100644
|
|
|
8d3578 |
--- a/src/db/sysdb_autofs.c
|
|
|
8d3578 |
+++ b/src/db/sysdb_autofs.c
|
|
|
8d3578 |
@@ -449,6 +449,28 @@ sysdb_del_autofsentry(struct sss_domain_info *domain,
|
|
|
8d3578 |
return ret;
|
|
|
8d3578 |
}
|
|
|
8d3578 |
|
|
|
8d3578 |
+errno_t
|
|
|
8d3578 |
+sysdb_del_autofsentry_by_key(struct sss_domain_info *domain,
|
|
|
8d3578 |
+ const char *map_name,
|
|
|
8d3578 |
+ const char *entry_key)
|
|
|
8d3578 |
+{
|
|
|
8d3578 |
+ struct ldb_message *entry;
|
|
|
8d3578 |
+ errno_t ret;
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+ ret = sysdb_get_autofsentry(NULL, domain, map_name, entry_key, &entry);
|
|
|
8d3578 |
+ if (ret == ENOENT) {
|
|
|
8d3578 |
+ return EOK;
|
|
|
8d3578 |
+ } else if (ret != EOK) {
|
|
|
8d3578 |
+ DEBUG(SSSDBG_OP_FAILURE, "Unable to get autofs entry [%d]: %s\n",
|
|
|
8d3578 |
+ ret, sss_strerror(ret));
|
|
|
8d3578 |
+ return ret;
|
|
|
8d3578 |
+ }
|
|
|
8d3578 |
+
|
|
|
8d3578 |
+ ret = sysdb_delete_entry(domain->sysdb, entry->dn, true);
|
|
|
8d3578 |
+ talloc_free(entry);
|
|
|
8d3578 |
+ return ret;
|
|
|
8d3578 |
+}
|
|
|
8d3578 |
+
|
|
|
8d3578 |
errno_t
|
|
|
8d3578 |
sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
struct sss_domain_info *domain,
|
|
|
8d3578 |
diff --git a/src/db/sysdb_autofs.h b/src/db/sysdb_autofs.h
|
|
|
8d3578 |
index 79ecbd94e..3775e2a17 100644
|
|
|
8d3578 |
--- a/src/db/sysdb_autofs.h
|
|
|
8d3578 |
+++ b/src/db/sysdb_autofs.h
|
|
|
8d3578 |
@@ -75,6 +75,11 @@ errno_t
|
|
|
8d3578 |
sysdb_del_autofsentry(struct sss_domain_info *domain,
|
|
|
8d3578 |
const char *entry_dn);
|
|
|
8d3578 |
|
|
|
8d3578 |
+errno_t
|
|
|
8d3578 |
+sysdb_del_autofsentry_by_key(struct sss_domain_info *domain,
|
|
|
8d3578 |
+ const char *map_name,
|
|
|
8d3578 |
+ const char *entry_key);
|
|
|
8d3578 |
+
|
|
|
8d3578 |
errno_t
|
|
|
8d3578 |
sysdb_autofs_entries_by_map(TALLOC_CTX *mem_ctx,
|
|
|
8d3578 |
struct sss_domain_info *domain,
|
|
|
8d3578 |
--
|
|
|
8d3578 |
2.20.1
|
|
|
8d3578 |
|