1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: allow setting ARCHIVE bit in POSIX context with "store dos attributes"

Cf https://lists.samba.org/archive/samba-technical/2023-October/138504.html

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2023-10-31 12:25:38 +01:00 committed by Jeremy Allison
parent cd858a2a23
commit 95abd2f59f
2 changed files with 6 additions and 4 deletions

View File

@ -925,8 +925,10 @@ int file_set_dosmode(connection_struct *conn,
return -1;
}
if (fsp->fsp_flags & FSP_POSIX_FLAGS_OPEN) {
return;
if (smb_fname->fsp->posix_flags & FSP_POSIX_FLAGS_OPEN &&
!lp_store_dos_attributes(SNUM(conn)))
{
return 0;
}
unixmode = smb_fname->st.st_ex_mode;

View File

@ -143,7 +143,7 @@ bool run_posix_ls_wildcard_test(int dummy)
.name = symlnk_in_share,
.target = symlnk_dst_in_share,
.expected = symlnk_in_share,
.attr_win = FILE_ATTRIBUTE_NORMAL,
.attr_win = FILE_ATTRIBUTE_ARCHIVE,
.attr_lin = FILE_ATTRIBUTE_NORMAL,
}, {
.name = symlnk_outside_share,
@ -319,7 +319,7 @@ bool run_posix_ls_single_test(int dummy)
.name = symlnk_in_share,
.target = symlnk_dst_in_share,
.expected = symlnk_in_share,
.attr_win = FILE_ATTRIBUTE_NORMAL,
.attr_win = FILE_ATTRIBUTE_ARCHIVE,
.attr_lin = FILE_ATTRIBUTE_NORMAL,
}, {
.name = symlnk_outside_share,