* security.h (NTWriteEA): Change prototype.
* ntea.cc (NTReadEA): Don't check for global ntea setting, now it's caller responsibility. (NTWriteEA): Ditto. * security.cc (get_file_attribute): Read attribute from EA only if 'ntea' is enabled. (set_file_attribute): Ditto. * path.h: (class path_conv): Add members to store file system information. (path_conv::get_drive_type): New function. * syscalls.cc (stat_worker): Use it. * path.cc (path_conv::update_fs_info): New functions. (path_conv::check): Get file system information from device where file resides. On NTFS, try to read symlink contents from EA. (get_symlink_ea): New function. (set_symlink_ea): Ditto. (symlink): Store symlink in extended attribute, if possible.
This commit is contained in:
@@ -1199,9 +1199,14 @@ get_file_attribute (int use_ntsec, const char *file,
|
||||
if (!attribute)
|
||||
return 0;
|
||||
|
||||
int oatt = *attribute;
|
||||
res = NTReadEA (file, ".UNIXATTR", (char *) attribute, sizeof (*attribute));
|
||||
*attribute |= oatt;
|
||||
if (allow_ntea)
|
||||
{
|
||||
int oatt = *attribute;
|
||||
res = NTReadEA (file, ".UNIXATTR", (char *) attribute, sizeof (*attribute));
|
||||
*attribute |= oatt;
|
||||
}
|
||||
else
|
||||
res = 0;
|
||||
|
||||
/* symlinks are everything for everyone!*/
|
||||
if ((*attribute & S_IFLNK) == S_IFLNK)
|
||||
@@ -1523,7 +1528,7 @@ set_file_attribute (int use_ntsec, const char *file,
|
||||
if ((attribute & S_IFLNK) == S_IFLNK)
|
||||
attribute |= S_IRWXU | S_IRWXG | S_IRWXO;
|
||||
|
||||
if (!use_ntsec || !allow_ntsec)
|
||||
if (allow_ntea && (!use_ntsec || !allow_ntsec))
|
||||
{
|
||||
if (!NTWriteEA (file, ".UNIXATTR", (char *) &attribute,
|
||||
sizeof (attribute)))
|
||||
|
Reference in New Issue
Block a user