* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat

inability to open file as failure if only SetFileAttributes is
	going to be called.  Only call set_file_attribute if really necessary.
This commit is contained in:
Corinna Vinschen 2005-05-03 19:03:20 +00:00
parent 2ba719de27
commit 21b9fe3e33
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-05-03 Corinna Vinschen <corinna@vinschen.de>
* fhandler_disk_file.cc (fhandler_disk_file::fchmod): Don't treat
inability to open file as failure if only SetFileAttributes is
going to be called. Only call set_file_attribute if really necessary.
2005-05-03 Corinna Vinschen <corinna@vinschen.de> 2005-05-03 Corinna Vinschen <corinna@vinschen.de>
* fhandler_socket.cc (get_inet_addr): Add missing __seterrno call. * fhandler_socket.cc (get_inet_addr): Add missing __seterrno call.

View File

@ -466,10 +466,15 @@ fhandler_disk_file::fchmod (mode_t mode)
{ {
query_open (query_write_control); query_open (query_write_control);
if (!(oret = open (O_BINARY, 0))) if (!(oret = open (O_BINARY, 0)))
{
/* If the file couldn't be opened, that's really only a problem if
ACLs or EAs should get written. */
if ((allow_ntsec && pc.has_acls ()) || allow_ntea)
return -1; return -1;
} }
}
if (wincap.has_security ()) if ((allow_ntsec && pc.has_acls ()) || allow_ntea)
{ {
if (!allow_ntsec && allow_ntea) /* Not necessary when manipulating SD. */ if (!allow_ntsec && allow_ntea) /* Not necessary when manipulating SD. */
SetFileAttributes (pc, (DWORD) pc & ~FILE_ATTRIBUTE_READONLY); SetFileAttributes (pc, (DWORD) pc & ~FILE_ATTRIBUTE_READONLY);