summaryrefslogtreecommitdiff
path: root/server/db
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2009-02-13 19:28:44 -0500
committerSimo Sorce <idra@samba.org>2009-02-13 19:30:00 -0500
commit314f09402c10ab5a049f25b44f59d75ce5880910 (patch)
treeb2ecb12fa233dda64c596a06f8d22a90bb8c67d5 /server/db
parent7e58b7fb3b62b8aad0762631a26f606fbfd43673 (diff)
downloadsssd-314f09402c10ab5a049f25b44f59d75ce5880910.tar.gz
sssd-314f09402c10ab5a049f25b44f59d75ce5880910.tar.bz2
sssd-314f09402c10ab5a049f25b44f59d75ce5880910.zip
Object not found on delete is not really an error.
Diffstat (limited to 'server/db')
-rw-r--r--server/db/sysdb.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/server/db/sysdb.c b/server/db/sysdb.c
index db047bc3..a3a7064f 100644
--- a/server/db/sysdb.c
+++ b/server/db/sysdb.c
@@ -1071,7 +1071,7 @@ int sysdb_posix_remove_user(TALLOC_CTX *memctx,
{
TALLOC_CTX *tmp_ctx;
struct ldb_dn *user_dn;
- int ret;
+ int lret, ret = EOK;
tmp_ctx = talloc_new(memctx);
if (!tmp_ctx) {
@@ -1086,9 +1086,9 @@ int sysdb_posix_remove_user(TALLOC_CTX *memctx,
return ENOMEM;
}
- ret = ldb_delete(sysdb->ldb, user_dn);
+ lret = ldb_delete(sysdb->ldb, user_dn);
- if (ret != LDB_SUCCESS) {
+ if (lret != LDB_SUCCESS && lret != LDB_ERR_NO_SUCH_OBJECT) {
DEBUG(2, ("LDB Error: %s(%d)\nError Message: [%s]\n",
ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)));
ret = EIO;
@@ -1161,9 +1161,9 @@ int sysdb_posix_remove_user_by_uid(TALLOC_CTX *memctx,
talloc_free(res);
res = NULL;
- ret = ldb_delete(sysdb->ldb, user_dn);
+ lret = ldb_delete(sysdb->ldb, user_dn);
- if (ret != LDB_SUCCESS) {
+ if (lret != LDB_SUCCESS && lret != LDB_ERR_NO_SUCH_OBJECT) {
DEBUG(2, ("LDB Error: %s(%d)\nError Message: [%s]\n",
ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)));
ret = EIO;
@@ -1469,7 +1469,7 @@ int sysdb_posix_remove_group(TALLOC_CTX *memctx,
{
TALLOC_CTX *tmp_ctx;
struct ldb_dn *group_dn;
- int ret;
+ int lret, ret = EOK;
tmp_ctx = talloc_new(memctx);
if (!tmp_ctx) {
@@ -1484,9 +1484,9 @@ int sysdb_posix_remove_group(TALLOC_CTX *memctx,
return ENOMEM;
}
- ret = ldb_delete(sysdb->ldb, group_dn);
+ lret = ldb_delete(sysdb->ldb, group_dn);
- if (ret != LDB_SUCCESS) {
+ if (lret != LDB_SUCCESS && lret != LDB_ERR_NO_SUCH_OBJECT) {
DEBUG(2, ("LDB Error: %s(%d)\nError Message: [%s]\n",
ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)));
ret = EIO;
@@ -1559,9 +1559,9 @@ int sysdb_posix_remove_group_by_gid(TALLOC_CTX *memctx,
talloc_free(res);
res = NULL;
- ret = ldb_delete(sysdb->ldb, group_dn);
+ lret = ldb_delete(sysdb->ldb, group_dn);
- if (ret != LDB_SUCCESS) {
+ if (lret != LDB_SUCCESS && lret != LDB_ERR_NO_SUCH_OBJECT) {
DEBUG(2, ("LDB Error: %s(%d)\nError Message: [%s]\n",
ldb_strerror(ret), ret, ldb_errstring(sysdb->ldb)));
ret = EIO;