sal/osl/w32/file_dirvol.cxx | 4 ++++ 1 file changed, 4 insertions(+) New commits: commit d724b51c7da391c9afe5e47476d432aecf1c4c67 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Tue Sep 26 09:52:29 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Tue Sep 26 11:59:54 2023 +0200
tdf#157448: ignore FILE_ATTRIBUTE_READONLY when FILE_ATTRIBUTE_DIRECTORY is set Change-Id: I3fbcf15924b30e2c7fe5501e706cdaf32921e103 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157263 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sal/osl/w32/file_dirvol.cxx b/sal/osl/w32/file_dirvol.cxx index f9d821605e86..f0c03d0d0033 100644 --- a/sal/osl/w32/file_dirvol.cxx +++ b/sal/osl/w32/file_dirvol.cxx @@ -1553,6 +1553,10 @@ oslFileError SAL_CALL osl_getFileStatus( pStatus->uValidFields |= osl_FileStatus_Mask_Type; pStatus->uAttributes = pItemImpl->FindData.dwFileAttributes; + // tdf#157448: RO attribute is ignored for directories on Windows: + // https://learn.microsoft.com/en-us/windows/desktop/FileIO/file-attribute-constants + if (pStatus->uAttributes & FILE_ATTRIBUTE_DIRECTORY) + pStatus->uAttributes &= ~sal_uInt64(FILE_ATTRIBUTE_READONLY); pStatus->uValidFields |= osl_FileStatus_Mask_Attributes; pStatus->uFileSize = static_cast<sal_uInt64>(pItemImpl->FindData.nFileSizeLow) + (static_cast<sal_uInt64>(pItemImpl->FindData.nFileSizeHigh) << 32);