diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2008-04-13 16:47:21 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2008-04-13 16:47:21 +0000 |
commit | 9bf7c7e96cf97fb10054775cfc84a92b4f45dea0 (patch) | |
tree | d528c007b7748d18400c7cec4ee9fa20665e9f9d /winsup/cygwin/fhandler_disk_file.cc | |
parent | a7ff2096f7f5ca58a2ea202033a579675e695199 (diff) | |
download | cygnal-9bf7c7e96cf97fb10054775cfc84a92b4f45dea0.tar.gz cygnal-9bf7c7e96cf97fb10054775cfc84a92b4f45dea0.tar.bz2 cygnal-9bf7c7e96cf97fb10054775cfc84a92b4f45dea0.zip |
* fhandler_disk_file.cc (fhandler_disk_file::readdir_helper): Simplify
code which checks for symlinks. Fix problem with UNC paths.
* environ.cc (struct parse_thing): Remove transparent_exe option.
* syscalls.cc (transparent_exe): Remove.
(unlink): Always add stat_suffixes, drop transparent_exe check.
(open): Ditto.
(link): Ditto.
(pathconf): Ditto.
* fhandler_disk_file.cc (fhandler_disk_file::link): Ditto.
* fhandler_process.cc (fhandler_process::fill_filebuf): Always remove
.exe suffix.
* path.cc (realpath): Never attach known_suffix.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 112ad9c1d..0f400bbe8 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -22,6 +22,7 @@ details. */ #include "shared_info.h" #include "pinfo.h" #include "ntdll.h" +#include "tls_pbuf.h" #include <winioctl.h> #define _COMPILING_NEWLIB @@ -1063,8 +1064,7 @@ fhandler_disk_file::link (const char *newpath) { extern bool allow_winsymlinks; - path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX, - transparent_exe ? stat_suffixes : NULL); + path_conv newpc (newpath, PC_SYM_NOFOLLOW | PC_POSIX, stat_suffixes); if (newpc.error) { set_errno (newpc.case_clash ? ECASECLASH : newpc.error); @@ -1607,21 +1607,23 @@ fhandler_disk_file::readdir_helper (DIR *dir, dirent *de, DWORD w32_err, fname->Buffer + fname->Length / sizeof (WCHAR) - 4, 4 * sizeof (WCHAR)); - RtlInitCountedUnicodeString (&lname, (PWCHAR) L".lnk", - 4 * sizeof (WCHAR)); - + RtlInitUnicodeString (&lname, (PWCHAR) L".lnk"); if (RtlEqualUnicodeString (&uname, &lname, TRUE)) { - UNICODE_STRING dirname = *pc.get_nt_native_path (); - dirname.Buffer += 4; /* Skip leading \??\ */ - dirname.Length -= 4 * sizeof (WCHAR); + tmp_pathbuf tp; UNICODE_STRING fbuf; - ULONG len = dirname.Length + fname->Length + 2 * sizeof (WCHAR); - - RtlInitEmptyUnicodeString (&fbuf, (PCWSTR) alloca (len), len); - RtlCopyUnicodeString (&fbuf, &dirname); + + tp.u_get (&fbuf); + RtlCopyUnicodeString (&fbuf, pc.get_nt_native_path ()); RtlAppendUnicodeToString (&fbuf, L"\\"); RtlAppendUnicodeStringToString (&fbuf, fname); + fbuf.Buffer += 4; /* Skip leading \??\ */ + fbuf.Length -= 4 * sizeof (WCHAR); + if (*fbuf.Buffer == L'U') /* UNC path */ + { + *(fbuf.Buffer += 2) = L'\\'; + fbuf.Length -= 2 * sizeof (WCHAR); + } path_conv fpath (&fbuf, PC_SYM_NOFOLLOW); if (fpath.issymlink () || fpath.is_fs_special ()) fname->Length -= 4 * sizeof (WCHAR); |