* security.h (setacl): Add parameter for writability flag.

* sec_acl.cc (setacl): Ditto.  Set to true if any ACE with write
	permissions is created.
	* fhandler_disk_file.cc (fhandler_disk_file::facl): Reset
	FILE_ATTRIBUTE_READONLY if ACL contains an ACE with write permissions.
This commit is contained in:
Corinna Vinschen
2007-01-07 12:44:10 +00:00
parent 7ce031f211
commit 6bcc8fd7b1
4 changed files with 26 additions and 6 deletions

View File

@ -746,7 +746,12 @@ fhandler_disk_file::facl (int cmd, int nentries, __aclent32_t *aclbufp)
{
case SETACL:
if (!aclsort32 (nentries, 0, aclbufp))
res = setacl (get_io_handle (), pc, nentries, aclbufp);
{
bool rw = false;
res = setacl (get_io_handle (), pc, nentries, aclbufp, rw);
if (rw)
SetFileAttributes (pc, (DWORD) pc & ~FILE_ATTRIBUTE_READONLY);
}
break;
case GETACL:
if (!aclbufp)