1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3: smbd: Ensure we set fsp->file_id in openat_pathref_dirfsp_nosymlink().

This is a subtle one. The dirfsp returned by openat_pathref_dirfsp_nosymlink()
can be used inside open.c and passed to check_parent_access_fsp() to
check if a delete_on_close flag has been set on an existing "real"
open fsp. So the file_id must be correctly set in order for this
to work. Without it, samba3.base.delete fails in deltest20 when
we convert reply_open_and_X() to use filename_convert_dirfsp().

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison 2022-07-27 14:36:33 -07:00 committed by Volker Lendecke
parent 3469895aca
commit 1a653fdc44

View File

@ -937,6 +937,12 @@ next:
nt_errstr(status)); nt_errstr(status));
goto fail; goto fail;
} }
/*
* We must correctly set fsp->file_id as code inside
* open.c will use this to check if delete_on_close
* has been set on the dirfsp.
*/
fsp->file_id = vfs_file_id_from_sbuf(conn, &fsp->fsp_name->st);
result = cp_smb_filename(mem_ctx, fsp->fsp_name); result = cp_smb_filename(mem_ctx, fsp->fsp_name);
if (result == NULL) { if (result == NULL) {