summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2019-11-13 16:02:11 +0100
committerJeremy Allison <jra@samba.org>2019-11-14 22:26:30 +0000
commitb1143a0c7e9080996bb47b52df9124d296e4345b (patch)
treeb791de21410c33c57558d3164963fdf8b4658d1f
parent0c2a706a11c0ac89476c07f7d7d2554ffd7c342b (diff)
downloadsamba-b1143a0c7e9080996bb47b52df9124d296e4345b.tar.gz
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 <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
-rw-r--r--source3/modules/vfs_acl_tdb.c34
1 files 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
@@ -90,24 +90,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;
}