diff options
Diffstat (limited to 'source3/lib')
-rw-r--r-- | source3/lib/dbwrap_util.c | 11 | ||||
-rw-r--r-- | source3/lib/sharesec.c | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/source3/lib/dbwrap_util.c b/source3/lib/dbwrap_util.c index 1a636cc8a6..1005f36b60 100644 --- a/source3/lib/dbwrap_util.c +++ b/source3/lib/dbwrap_util.c @@ -200,7 +200,7 @@ NTSTATUS dbwrap_trans_store(struct db_context *db, TDB_DATA key, TDB_DATA dbuf, return status; } -int dbwrap_trans_delete(struct db_context *db, TDB_DATA key) +NTSTATUS dbwrap_trans_delete(struct db_context *db, TDB_DATA key) { int res; struct db_record *rec; @@ -209,12 +209,13 @@ int dbwrap_trans_delete(struct db_context *db, TDB_DATA key) res = db->transaction_start(db); if (res != 0) { DEBUG(5, ("transaction_start failed\n")); - return res; + return NT_STATUS_INTERNAL_DB_CORRUPTION; } rec = db->fetch_locked(db, talloc_tos(), key); if (rec == NULL) { DEBUG(5, ("fetch_locked failed\n")); + status = NT_STATUS_NO_MEMORY; goto cancel; } @@ -229,15 +230,17 @@ int dbwrap_trans_delete(struct db_context *db, TDB_DATA key) res = db->transaction_commit(db); if (res != 0) { DEBUG(5, ("tdb_transaction_commit failed\n")); + status = NT_STATUS_INTERNAL_DB_CORRUPTION; + goto cancel; } - return res; + return NT_STATUS_OK; cancel: if (db->transaction_cancel(db) != 0) { smb_panic("Cancelling transaction failed"); } - return -1; + return status; } NTSTATUS dbwrap_trans_store_int32(struct db_context *db, const char *keystr, diff --git a/source3/lib/sharesec.c b/source3/lib/sharesec.c index 33141a9671..471363b4be 100644 --- a/source3/lib/sharesec.c +++ b/source3/lib/sharesec.c @@ -253,6 +253,7 @@ bool delete_share_security(const char *servicename) { TDB_DATA kbuf; char *key; + NTSTATUS status; if (!(key = talloc_asprintf(talloc_tos(), "SECDESC/%s", servicename))) { @@ -260,9 +261,10 @@ bool delete_share_security(const char *servicename) } kbuf = string_term_tdb_data(key); - if (dbwrap_trans_delete(share_db, kbuf) != 0) { + status = dbwrap_trans_delete(share_db, kbuf); + if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("delete_share_security: Failed to delete entry for " - "share %s\n", servicename)); + "share %s: %s\n", servicename, nt_errstr(status))); return False; } |