]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
vfs: Use dbwrap_store() in store_acl_blob_fsp()
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 c1e9a757917bd91dbdc099d03dee04eb0b5d2f18..51eaeda0b75bfa6790f2ae48f97a1de5c7547ed4 100644 (file)
@@ -206,7 +206,6 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
        struct file_id id;
        TDB_DATA data = { .dptr = pblob->data, .dsize = pblob->length };
        struct db_context *db = acl_db;
-       struct db_record *rec;
        NTSTATUS status;
 
        DEBUG(10,("store_acl_blob_fsp: storing blob length %u on file %s\n",
@@ -221,14 +220,10 @@ static NTSTATUS store_acl_blob_fsp(vfs_handle_struct *handle,
 
        /* For backwards compatibility only store the dev/inode. */
        push_file_id_16((char *)id_buf, &id);
-       rec = dbwrap_fetch_locked(db, talloc_tos(),
-                                 make_tdb_data(id_buf,
-                                               sizeof(id_buf)));
-       if (rec == NULL) {
-               DEBUG(0, ("store_acl_blob_fsp_tdb: fetch_lock failed\n"));
-               return NT_STATUS_INTERNAL_DB_CORRUPTION;
-       }
-       return dbwrap_record_store(rec, data, 0);
+
+       status = dbwrap_store(
+               db, make_tdb_data(id_buf, sizeof(id_buf)), data, 0);
+       return status;
 }
 
 /*********************************************************************