From b1143a0c7e9080996bb47b52df9124d296e4345b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 13 Nov 2019 16:02:11 +0100 Subject: [PATCH] vfs: Use dbwrap_delete() in acl_tdb_delete() Use the wrapper function that's already available for exactly this purpose. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- source3/modules/vfs_acl_tdb.c | 34 ++++------------------------------ 1 file changed, 4 insertions(+), 30 deletions(-) diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c index 51eaeda0b75..ed88b2bc4a6 100644 --- a/source3/modules/vfs_acl_tdb.c +++ b/source3/modules/vfs_acl_tdb.c @@ -89,24 +89,6 @@ static void disconnect_acl_tdb(struct vfs_handle_struct *handle) } } -/******************************************************************* - Fetch_lock the tdb acl record for a file -*******************************************************************/ - -static struct db_record *acl_tdb_lock(TALLOC_CTX *mem_ctx, - struct db_context *db, - const struct file_id *id) -{ - uint8_t id_buf[16]; - - /* For backwards compatibility only store the dev/inode. */ - push_file_id_16((char *)id_buf, id); - return dbwrap_fetch_locked(db, - mem_ctx, - make_tdb_data(id_buf, - sizeof(id_buf))); -} - /******************************************************************* Delete the tdb acl record for a file *******************************************************************/ @@ -117,20 +99,12 @@ static NTSTATUS acl_tdb_delete(vfs_handle_struct *handle, { NTSTATUS status; struct file_id id = vfs_file_id_from_sbuf(handle->conn, psbuf); - struct db_record *rec = acl_tdb_lock(talloc_tos(), db, &id); - - /* - * If rec == NULL there's not much we can do about it - */ + uint8_t id_buf[16]; - if (rec == NULL) { - DEBUG(10,("acl_tdb_delete: rec == NULL\n")); - TALLOC_FREE(rec); - return NT_STATUS_OK; - } + /* For backwards compatibility only store the dev/inode. */ + push_file_id_16((char *)id_buf, &id); - status = dbwrap_record_delete(rec); - TALLOC_FREE(rec); + status = dbwrap_delete(db, make_tdb_data(id_buf, sizeof(id_buf))); return status; } -- 2.34.1