diff options
author | Egor Duda <deo@logos-m.ru> | 2001-06-05 10:45:52 +0000 |
---|---|---|
committer | Egor Duda <deo@logos-m.ru> | 2001-06-05 10:45:52 +0000 |
commit | 149da470f31c237d82903e106f029d1e0b392542 (patch) | |
tree | 5b29b77e89f4fd3473ceecb7cd972e7fb0ede7c2 /winsup/cygwin/security.cc | |
parent | fa821be37b56798f70b488530a07adeb2092b69b (diff) | |
download | cygnal-149da470f31c237d82903e106f029d1e0b392542.tar.gz cygnal-149da470f31c237d82903e106f029d1e0b392542.tar.bz2 cygnal-149da470f31c237d82903e106f029d1e0b392542.zip |
* 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.
Diffstat (limited to 'winsup/cygwin/security.cc')
-rw-r--r-- | winsup/cygwin/security.cc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/winsup/cygwin/security.cc b/winsup/cygwin/security.cc index 82f1dd8e6..155b0d934 100644 --- a/winsup/cygwin/security.cc +++ b/winsup/cygwin/security.cc @@ -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))) |