From 14c622c6e3b3e0c98ba739b731099879115f853a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Thu, 24 Dec 2009 12:53:43 +0000 Subject: * path.cc (symlink_info::check): Set fileattr to FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/path.cc | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'winsup/cygwin') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 26291f0d8..8a2111bed 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2009-12-24 Corinna Vinschen + + * path.cc (symlink_info::check): Set fileattr to + FILE_ATTRIBUTE_DIRECTORY in a certain error condition. Explain why. + 2009-12-22 Christopher Faylor * select.cc (fhandler_fifo::select_read): Fill in device specific 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 { -- cgit v1.2.3