* autoload.cc (NtQueryEaFile): Define.

(NtSetEaFile): Define.
	* fhandler.cc (fhandler_base::open): Use appropriate open flags
	in query case when allow_ntea is set.
	* ntdll.h (struct _FILE_GET_EA_INFORMATION): Define.
	(struct _FILE_FULL_EA_INFORMATION): Define.
	(NtQueryEaFile): Declare.
	(NtSetEaFile): Declare.
	* ntea.cc (read_ea): Rename from NTReadEA and rewrite using
	NtQueryEaFile.
	(write_ea): Rename from NTWriteEA and rewrite using NtSetEaFile.
	* path.cc (get_symlink_ea): Make static.  Add handle parameter to
	accomodate new read_ea call.
	(set_symlink_ea): Make static.  Add handle parameter to accomodate new
	write_ea call.
	(symlink_worker): Call set_symlink_ea while file is still open.
	(symlink_info::check): Call get_symlink_ea after file has been opened.
	* security.cc (get_file_attribute): Accomodate new read_ea call.
	(set_file_attribute): Accomodate new write_ea call.
	* security.h (read_ea): Change declaration accordingly.
	(write_ea): Ditto.
This commit is contained in:
Corinna Vinschen
2006-07-03 18:30:08 +00:00
parent e60e8d3b0e
commit 4635b6ebd8
8 changed files with 194 additions and 297 deletions

View File

@@ -1405,7 +1405,8 @@ get_file_attribute (int use_ntsec, HANDLE handle, const char *file,
if (allow_ntea)
{
int oatt = *attribute;
res = NTReadEA (file, ".UNIXATTR", (char *)attribute, sizeof (*attribute));
res = read_ea (handle, file, ".UNIXATTR", (char *)attribute,
sizeof (*attribute));
*attribute |= oatt;
}
else
@@ -1801,8 +1802,8 @@ set_file_attribute (bool use_ntsec, HANDLE handle, const char *file,
if (use_ntsec && allow_ntsec)
ret = set_nt_attribute (handle, file, uid, gid, attribute);
else if (allow_ntea && !NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
sizeof (attribute)))
else if (allow_ntea && !write_ea (handle, file, ".UNIXATTR",
(char *) &attribute, sizeof (attribute)))
{
__seterrno ();
ret = -1;