vfs: Use dbwrap_delete() in acl_tdb_delete()
authorVolker Lendecke <vl@samba.org>
Wed, 13 Nov 2019 15:02:11 +0000 (16:02 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 14 Nov 2019 22:26:30 +0000 (22:26 +0000)
Use the wrapper function that's already available for exactly this
purpose.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/modules/vfs_acl_tdb.c

index 51eaeda0b75bfa6790f2ae48f97a1de5c7547ed4..ed88b2bc4a6a6fee887c75ece083b0d532504a99 100644 (file)
@@ -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;
 }