1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

smbd: Revert "smbd: Simplify filename_convert_dirfsp()"

This reverts commit bd30c9c128.

While this does indeed slightly simplify code, it simplifies too much: Soon we
will need filename_convert_dirfsp_nosymlink raw without looking at
UCF_LCOMP_LNK_OK. So in hindsight this went too far.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
Volker Lendecke 2024-11-19 11:48:12 +01:00 committed by Ralph Boehme
parent ec64f81df9
commit 76f5156906

View File

@ -1041,13 +1041,6 @@ static NTSTATUS filename_convert_dirfsp_nosymlink(
}
done:
if (S_ISLNK(smb_fname->st.st_ex_mode) &&
!(ucf_flags & UCF_LCOMP_LNK_OK)) {
status = NT_STATUS_STOPPED_ON_SYMLINK;
*_symlink_err = symlink_err;
goto fail;
}
*_dirfsp = smb_dirname->fsp;
*_smb_fname = smb_fname;
*_symlink_err = symlink_err;
@ -1109,6 +1102,18 @@ next:
_smb_fname_rel,
&symlink_err);
if (NT_STATUS_IS_OK(status) && S_ISLNK((*_smb_fname)->st.st_ex_mode)) {
/*
* lcomp is a symlink
*/
if (ucf_flags & UCF_LCOMP_LNK_OK) {
TALLOC_FREE(symlink_err);
return NT_STATUS_OK;
}
close_file_free(NULL, _dirfsp, ERROR_CLOSE);
status = NT_STATUS_STOPPED_ON_SYMLINK;
}
if (!NT_STATUS_EQUAL(status, NT_STATUS_STOPPED_ON_SYMLINK)) {
return status;
}