From 5711c63d2790e4f190f5a50bd182e74760a947d9 Mon Sep 17 00:00:00 2001
From: Petr Cech <pcech@redhat.com>
Date: Tue, 23 Aug 2016 10:15:02 +0200
Subject: [PATCH 5/7] SYSDB: ldb_delete --> sss_ldb_delete in sysdb

Resolves:
https://fedorahosted.org/sssd/ticket/3060
---
 src/db/sysdb_ops.c     |  4 ++--
 src/db/sysdb_upgrade.c | 18 +++++++++---------
 src/db/sysdb_views.c   |  4 ++--
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c
index 90614cc7df5336ccba4718d7a5391af7b967075f..54dfc1a0c0e6587f9f8d66a43156f05b00127888 100644
--- a/src/db/sysdb_ops.c
+++ b/src/db/sysdb_ops.c
@@ -109,7 +109,7 @@ static int sysdb_delete_cache_entry(struct ldb_context *ldb,
 {
     int ret;
 
-    ret = ldb_delete(ldb, dn);
+    ret = sss_ldb_delete(ldb, dn);
     switch (ret) {
     case LDB_SUCCESS:
         return EOK;
@@ -3283,7 +3283,7 @@ int sysdb_delete_custom(struct sss_domain_info *domain,
         goto done;
     }
 
-    ret = ldb_delete(domain->sysdb->ldb, dn);
+    ret = sss_ldb_delete(domain->sysdb->ldb, dn);
 
     switch (ret) {
     case LDB_SUCCESS:
diff --git a/src/db/sysdb_upgrade.c b/src/db/sysdb_upgrade.c
index 83d1a531fbf5c93ab6c5db126b20509791b47a95..ee90b2cda7715f778b2e4de99dff7a29b085d861 100644
--- a/src/db/sysdb_upgrade.c
+++ b/src/db/sysdb_upgrade.c
@@ -498,7 +498,7 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
                           ret, ldb_errstring(sysdb->ldb));
             }
 
-            ret = ldb_delete(ldb, orig_dn);
+            ret = sss_ldb_delete(ldb, orig_dn);
             if (ret != LDB_SUCCESS) {
                 DEBUG(SSSDBG_FATAL_FAILURE,
                       "WARNING: Could not remove entry %s,"
@@ -511,21 +511,21 @@ int sysdb_check_upgrade_02(struct sss_domain_info *domains,
         /* now remove the basic containers from local */
         /* these were optional so debug at level 9 in case
          * of failure just for tracing */
-        ret = ldb_delete(ldb, groups_dn);
+        ret = sss_ldb_delete(ldb, groups_dn);
         if (ret != LDB_SUCCESS) {
             DEBUG(SSSDBG_TRACE_ALL, "WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
                       ldb_dn_get_linearized(groups_dn),
                       ret, ldb_errstring(ldb));
         }
-        ret = ldb_delete(ldb, users_dn);
+        ret = sss_ldb_delete(ldb, users_dn);
         if (ret != LDB_SUCCESS) {
             DEBUG(SSSDBG_TRACE_ALL, "WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
                       ldb_dn_get_linearized(users_dn),
                       ret, ldb_errstring(ldb));
         }
-        ret = ldb_delete(ldb, domain_dn);
+        ret = sss_ldb_delete(ldb, domain_dn);
         if (ret != LDB_SUCCESS) {
             DEBUG(SSSDBG_TRACE_ALL, "WARNING: Could not remove entry %s,"
                       " from old ldb file! (%d [%s])\n",
@@ -1167,7 +1167,7 @@ int sysdb_upgrade_10(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
         DEBUG(SSSDBG_TRACE_FUNC, "Removing fake user [%s]\n",
               ldb_dn_get_linearized(user->dn));
 
-        ret = ldb_delete(sysdb->ldb, user->dn);
+        ret = sss_ldb_delete(sysdb->ldb, user->dn);
         if (ret != LDB_SUCCESS) {
             ret = sysdb_error_to_errno(ret);
             goto done;
@@ -1269,7 +1269,7 @@ int sysdb_upgrade_11(struct sysdb_ctx *sysdb, struct sss_domain_info *domain,
         DEBUG(SSSDBG_TRACE_LIBS, "Deleting [%s]\n",
               ldb_dn_get_linearized(entry->dn));
 
-        ret = ldb_delete(sysdb->ldb, entry->dn);
+        ret = sss_ldb_delete(sysdb->ldb, entry->dn);
         if (ret != EOK) {
             DEBUG(SSSDBG_OP_FAILURE, "Cannot delete old autofs entry %s\n",
                   ldb_dn_get_linearized(entry->dn));
@@ -1408,7 +1408,7 @@ int sysdb_upgrade_13(struct sysdb_ctx *sysdb, const char **ver)
                 /* Do not remove subdomain containers, only their contents */
                 continue;
             }
-            ret = ldb_delete(sysdb->ldb, res->msgs[j]->dn);
+            ret = sss_ldb_delete(sysdb->ldb, res->msgs[j]->dn);
             if (ret) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "Failed to delete %s\n",
@@ -1500,7 +1500,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver)
             DEBUG(SSSDBG_OP_FAILURE,
                   "The object [%s] doesn't have a name\n",
                    ldb_dn_get_linearized(res->msgs[i]->dn));
-            ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn);
+            ret = sss_ldb_delete(sysdb->ldb, res->msgs[i]->dn);
             if (ret) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "Failed to delete %s\n",
@@ -1525,7 +1525,7 @@ int sysdb_upgrade_14(struct sysdb_ctx *sysdb, const char **ver)
                   "Failed to move [%s] to [%s]\n",
                    ldb_dn_get_linearized(res->msgs[i]->dn),
                    ldb_dn_get_linearized(newdn));
-            ret = ldb_delete(sysdb->ldb, res->msgs[i]->dn);
+            ret = sss_ldb_delete(sysdb->ldb, res->msgs[i]->dn);
             if (ret) {
                 DEBUG(SSSDBG_OP_FAILURE,
                       "Failed to delete %s\n",
diff --git a/src/db/sysdb_views.c b/src/db/sysdb_views.c
index 1706ba2c4c60b18d2368c1eef4e074dbc62a94ee..603241c625ac4ab209cf23c8340a25ee827d9680 100644
--- a/src/db/sysdb_views.c
+++ b/src/db/sysdb_views.c
@@ -481,10 +481,10 @@ errno_t sysdb_store_override(struct sss_domain_info *domain,
     in_transaction = true;
 
     if (has_override) {
-        ret = ldb_delete(domain->sysdb->ldb, override_dn);
+        ret = sss_ldb_delete(domain->sysdb->ldb, override_dn);
         if (ret != EOK) {
             DEBUG(SSSDBG_TRACE_ALL,
-                  "ldb_delete failed, maybe object did not exist. Ignoring.\n");
+                  "sss_ldb_delete failed, maybe object did not exist. Ignoring.\n");
         }
 
         ret = sysdb_attrs_get_string(attrs, SYSDB_NAME, &name_override);
-- 
2.7.4

