diff --git a/dlls/ntdll/directory.c b/dlls/ntdll/directory.c index 47eae4363e..df7cc74061 100644 --- a/dlls/ntdll/directory.c +++ b/dlls/ntdll/directory.c @@ -628,7 +628,7 @@ static FILE_BOTH_DIR_INFORMATION *append_entry( void *info_ptr, ULONG *pos, ULON info->FileAttributes = FILE_ATTRIBUTE_ARCHIVE; } - if (!(st.st_mode & S_IWUSR)) + if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) info->FileAttributes |= FILE_ATTRIBUTE_READONLY; if (!show_dot_files && long_name[0] == '.' && long_name[1] && (long_name[1] != '.' || long_name[2])) diff --git a/dlls/ntdll/file.c b/dlls/ntdll/file.c index 777e038fb6..ca4b80974b 100644 --- a/dlls/ntdll/file.c +++ b/dlls/ntdll/file.c @@ -966,7 +966,8 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, { if (S_ISDIR(st.st_mode)) info->FileAttributes = FILE_ATTRIBUTE_DIRECTORY; else info->FileAttributes = FILE_ATTRIBUTE_ARCHIVE; - if (!(st.st_mode & S_IWUSR)) info->FileAttributes |= FILE_ATTRIBUTE_READONLY; + if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + info->FileAttributes |= FILE_ATTRIBUTE_READONLY; RtlSecondsSince1970ToTime( st.st_mtime, &info->CreationTime); RtlSecondsSince1970ToTime( st.st_mtime, &info->LastWriteTime); RtlSecondsSince1970ToTime( st.st_ctime, &info->ChangeTime); @@ -1053,7 +1054,7 @@ NTSTATUS WINAPI NtQueryInformationFile( HANDLE hFile, PIO_STATUS_BLOCK io, info->StandardInformation.NumberOfLinks = st.st_nlink; info->StandardInformation.DeletePending = FALSE; /* FIXME */ } - if (!(st.st_mode & S_IWUSR)) + if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) info->BasicInformation.FileAttributes |= FILE_ATTRIBUTE_READONLY; RtlSecondsSince1970ToTime( st.st_mtime, &info->BasicInformation.CreationTime); RtlSecondsSince1970ToTime( st.st_mtime, &info->BasicInformation.LastWriteTime); @@ -1249,7 +1250,8 @@ NTSTATUS WINAPI NtQueryFullAttributesFile( const OBJECT_ATTRIBUTES *attr, info->AllocationSize.QuadPart = (ULONGLONG)st.st_blocks * 512; info->EndOfFile.QuadPart = st.st_size; } - if (!(st.st_mode & S_IWUSR)) info->FileAttributes |= FILE_ATTRIBUTE_READONLY; + if (!(st.st_mode & (S_IWUSR | S_IWGRP | S_IWOTH))) + info->FileAttributes |= FILE_ATTRIBUTE_READONLY; RtlSecondsSince1970ToTime( st.st_mtime, &info->CreationTime ); RtlSecondsSince1970ToTime( st.st_mtime, &info->LastWriteTime ); RtlSecondsSince1970ToTime( st.st_ctime, &info->ChangeTime );