mirror of
https://github.com/samba-team/samba.git
synced 2025-01-12 09:18:10 +03:00
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>
This commit is contained in:
parent
0c2a706a11
commit
b1143a0c7e
@ -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);
|
||||
uint8_t id_buf[16];
|
||||
|
||||
/*
|
||||
* If rec == NULL there's not much we can do about it
|
||||
*/
|
||||
/* For backwards compatibility only store the dev/inode. */
|
||||
push_file_id_16((char *)id_buf, &id);
|
||||
|
||||
if (rec == NULL) {
|
||||
DEBUG(10,("acl_tdb_delete: rec == NULL\n"));
|
||||
TALLOC_FREE(rec);
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
||||
status = dbwrap_record_delete(rec);
|
||||
TALLOC_FREE(rec);
|
||||
status = dbwrap_delete(db, make_tdb_data(id_buf, sizeof(id_buf)));
|
||||
return status;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user