From: Volker Lendecke Date: Thu, 20 Mar 2025 08:47:15 +0000 (+0100) Subject: lib: Pass "dirfsp" to ad_collect_one_stream() X-Git-Tag: tevent-0.17.0~469 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=441a85e033f8ec2fba4e92b24485d0416b1ffa9d;p=thirdparty%2Fsamba.git lib: Pass "dirfsp" to ad_collect_one_stream() Avoid a call to SMB_VFS_CREATE_FILE with dirfsp==NULL Signed-off-by: Volker Lendecke Reviewed-by: Anoop C S --- diff --git a/source3/lib/adouble.c b/source3/lib/adouble.c index b2fae5a50ca..6f5ffe35c8f 100644 --- a/source3/lib/adouble.c +++ b/source3/lib/adouble.c @@ -1733,6 +1733,7 @@ struct ad_collect_state { static NTSTATUS ad_collect_one_stream(struct vfs_handle_struct *handle, struct char_mappings **cmaps, + struct files_struct *dirfsp, struct smb_filename *smb_fname, const struct stream_struct *stream, struct adouble *ad, @@ -1774,7 +1775,7 @@ static NTSTATUS ad_collect_one_stream(struct vfs_handle_struct *handle, status = SMB_VFS_CREATE_FILE( handle->conn, NULL, /* req */ - NULL, /* dirfsp */ + dirfsp, /* dirfsp */ sname, FILE_READ_DATA|DELETE_ACCESS, FILE_SHARE_READ, @@ -1837,7 +1838,7 @@ static NTSTATUS ad_collect_one_stream(struct vfs_handle_struct *handle, if (is_afpresource_stream(stream->name)) { ad->ad_rsrc_data = talloc_size(ad, stream->size); if (ad->ad_rsrc_data == NULL) { - ok = false; + status = NT_STATUS_NO_MEMORY; goto out; } @@ -2089,8 +2090,13 @@ NTSTATUS ad_unconvert(TALLOC_CTX *mem_ctx, } for (i = 0; i < num_streams; i++) { - status = ad_collect_one_stream( - handle, cmaps, fullname, &streams[i], ad, &state); + status = ad_collect_one_stream(handle, + cmaps, + dirfsp, + fullname, + &streams[i], + ad, + &state); if (!NT_STATUS_IS_OK(status)) { goto out; }