This is the mail archive of the
cygwin-developers@cygwin.com
mailing list for the Cygwin project.
ntea & chmod
- From: "Pierre A. Humblet" <Pierre dot Humblet at ieee dot org>
- To: cygwin-developers at cygwin dot com
- Date: Sat, 28 Aug 2004 23:38:45 -0400
- Subject: ntea & chmod
As far as I understand the code (I am on WinME),
ntea doesn't work properly in 1.5.10
For example in ::fchmod, the line
if (!set_file_attribute (pc.has_acls (), get_io_handle (), pc,
ILLEGAL_UID, ILLEGAL_GID, mode)
&& allow_ntsec)
res = 0;
guarantees a -1 return when ntea is on and allow_ntsec is off.
When both are on, it should work OK on FAT, but not on FAT32,
which does not support extended attributes.
I think the right logic on NT would be to modify set_file_attribute
as follows:
set_file_attribute (path_conv & pc .... <=== new arg type
{
int ret = 0;
if (allow_ntsec && pc.has_acls ())
ret = set_nt_attribute (handle, file, uid, gid, attribute);
else if (allow_ntea && pc.fs_has_ea ())
{
SetFileAttributes (pc, (DWORD) pc & ~FILE_ATTRIBUTE_READONLY)
bool res = NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
sizeof (attribute)))
....
}
pc.fs_has_ea () should be set properly as well in path.cc.
Currently it's set to make sense for symlink (that's obsolete),
not for ntea.
Pierre