diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-12-24 12:53:43 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-12-24 12:53:43 +0000 |
commit | 14c622c6e3b3e0c98ba739b731099879115f853a (patch) | |
tree | 96fee1e38241429755124e98dbabfe15931434c3 /winsup/cygwin/path.cc | |
parent | daee16e053f4f9c476b4e3e22f39c31e4bb20b0f (diff) | |
download | cygnal-14c622c6e3b3e0c98ba739b731099879115f853a.tar.gz cygnal-14c622c6e3b3e0c98ba739b731099879115f853a.tar.bz2 cygnal-14c622c6e3b3e0c98ba739b731099879115f853a.zip |
* path.cc (symlink_info::check): Set fileattr to
FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index bd3463d88..559c87339 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -2327,7 +2327,12 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt, if (!NT_SUCCESS (status)) { debug_printf ("%p = NtOpenFile(%S)", status, &dirname); - fileattr = 0; + /* There's a special case if the file is itself the root + of a drive which is not accessible by the current user. + This case is only recognized by the length of the + basename part. If it's 0, the incoming file is the + root of a drive. So we at least know it's a directory. */ + fileattr = basename.Length ? 0 : FILE_ATTRIBUTE_DIRECTORY; } else { |