Commit e3b59eac authored by Ulrich Czekalla's avatar Ulrich Czekalla Committed by Alexandre Julliard

Don't mark a file as readonly if it has any write bit set.

parent 38972345
......@@ -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]))
......
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment