Index: ntea.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/ntea.cc,v retrieving revision 1.3 diff -u -p -2 -r1.3 ntea.cc --- ntea.cc 2000/09/08 02:56:54 1.3 +++ ntea.cc 2001/05/10 15:29:19 @@ -86,8 +86,4 @@ int __stdcall NTReadEA (const char *file, const char *attrname, char *attrbuf, int len) { - /* return immediately if NTEA usage is turned off */ - if (! allow_ntea) - return FALSE; - HANDLE hFileSource; int eafound = 0; @@ -255,10 +251,6 @@ NTReadEARaw (HANDLE hFileSource, int *le BOOL __stdcall -NTWriteEA (const char *file, const char *attrname, char *buf, int len) +NTWriteEA (const char *file, const char *attrname, const char *buf, int len) { - /* return immediately if NTEA usage is turned off */ - if (! allow_ntea) - return TRUE; - HANDLE hFileSource; WIN32_STREAM_ID StreamId; Index: path.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/path.cc,v retrieving revision 1.137 diff -u -p -2 -r1.137 path.cc --- path.cc 2001/05/09 18:59:10 1.137 +++ path.cc 2001/05/10 15:29:20 @@ -2421,4 +2421,24 @@ symlink (const char *topath, const char && WriteFile (h, w32topath, win_len, &written, NULL) && written == win_len; + char root [MAX_PATH]; + char fsname [MAX_PATH]; + DWORD fsflags; + strcpy (root, win32_path); + if (rootdir (root) || + GetCurrentDirectory (sizeof (root), root) && rootdir (root)) + { + if (!GetVolumeInformation (root, + NULL, 0, + NULL, NULL, + &fsflags, + fsname, sizeof (fsname))) + debug_printf ("error getting fs type for %s: %E", root); + else if (strncasematch (fsname, "NTFS", 4)) + { + if (!NTWriteEA(win32_path, SYMLINK_EA_NAME, + topath, strlen (topath) + 1)) + debug_printf ("error writing EA"); + } + } } else @@ -2703,4 +2723,12 @@ symlink_info::check (char *path, const s if (!sym_check) goto file_not_symlink; + + if (sym_check > 0 && + (res = NTReadEA (suffix.path, SYMLINK_EA_NAME, contents, sizeof (contents)) - 1) > 0) + { + pflags = PATH_SYMLINK; + debug_printf ("got symlink from ea: %s", contents); + goto out; + } /* Open the file. */ Index: path.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/path.h,v retrieving revision 1.26 diff -u -p -2 -r1.26 path.h --- path.h 2001/04/17 23:12:11 1.26 +++ path.h 2001/05/10 15:29:20 @@ -129,4 +129,6 @@ class path_conv #define SYMLINK_COOKIE "!" +#define SYMLINK_EA_NAME ".CYGSYMLINK" + /* Socket marker */ #define SOCKET_COOKIE "!" Index: security.cc =================================================================== RCS file: /cvs/src/src/winsup/cygwin/security.cc,v retrieving revision 1.46 diff -u -p -2 -r1.46 security.cc --- security.cc 2001/04/30 21:19:42 1.46 +++ security.cc 2001/05/10 15:29:20 @@ -545,5 +545,8 @@ get_file_attribute (int use_ntsec, const return 0; - res = NTReadEA (file, ".UNIXATTR", (char *) attribute, sizeof (*attribute)); + if (allow_ntea) + res = NTReadEA (file, ".UNIXATTR", (char *) attribute, sizeof (*attribute)); + else + res = 0; /* symlinks are everything for everyone!*/ @@ -869,5 +872,5 @@ set_file_attribute (int use_ntsec, const attribute |= S_IRWXU | S_IRWXG | S_IRWXO; - if (!use_ntsec || !allow_ntsec) + if (allow_ntea && (!use_ntsec || !allow_ntsec)) { if (!NTWriteEA (file, ".UNIXATTR", Index: security.h =================================================================== RCS file: /cvs/src/src/winsup/cygwin/security.h,v retrieving revision 1.7 diff -u -p -2 -r1.7 security.h --- security.h 2001/04/30 21:19:42 1.7 +++ security.h 2001/05/10 15:29:20 @@ -103,3 +103,3 @@ extern SECURITY_ATTRIBUTES *__stdcall se int __stdcall NTReadEA (const char *file, const char *attrname, char *buf, int len); -BOOL __stdcall NTWriteEA (const char *file, const char *attrname, char *buf, int len); +BOOL __stdcall NTWriteEA (const char *file, const char *attrname, const char *buf, int len);