* fhandler_disk_file.cc (fhandler_base::fstat_helper): Don't remove

write bits for directories with R/O attribute.
	(fhandler_base::fhaccess): Don't shortcircuit R/O attribute with W_OK
	scenarios for directories.
This commit is contained in:
Corinna Vinschen
2007-10-30 12:32:16 +00:00
parent 2b50cd503e
commit 101f07b907
3 changed files with 11 additions and 3 deletions

View File

@@ -535,7 +535,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
{
/* If read-only attribute is set, modify ntsec return value */
if (::has_attribute (dwFileAttributes, FILE_ATTRIBUTE_READONLY)
&& !pc.issymlink ())
&& !pc.isdir () && !pc.issymlink ())
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
if (buf->st_mode & S_IFMT)
@@ -554,7 +554,7 @@ fhandler_base::fstat_helper (struct __stat64 *buf,
buf->st_mode |= STD_RBITS;
if (!::has_attribute (dwFileAttributes, FILE_ATTRIBUTE_READONLY)
&& !pc.issymlink ())
&& !pc.isdir () && !pc.issymlink ())
buf->st_mode |= STD_WBITS;
/* | S_IWGRP | S_IWOTH; we don't give write to group etc */