aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-01-09 16:20:26 +0000
committerCorinna Vinschen <corinna@vinschen.de>2009-01-09 16:20:26 +0000
commit54a83cc65add6561a3d6ed4af39c8b3a899a3d4a (patch)
tree001dac4daf54c24639b8bdf3f9fad9605b12e745
parentd95d8c5393988702112b8fcd154683150227cb7a (diff)
downloadnewlib-54a83cc65add6561a3d6ed4af39c8b3a899a3d4a.zip
newlib-54a83cc65add6561a3d6ed4af39c8b3a899a3d4a.tar.gz
newlib-54a83cc65add6561a3d6ed4af39c8b3a899a3d4a.tar.bz2
* mount.cc (mount_info::from_fstab_line): Always convert drive
letter in native path to uppercase. * path.cc (normalize_win32_path): Ditto. (path_prefix_p): Revert previous patch. * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER return code to circumvent weird behaviour of Samba 3.2.x shares.
-rw-r--r--winsup/cygwin/ChangeLog10
-rw-r--r--winsup/cygwin/mount.cc3
-rw-r--r--winsup/cygwin/path.cc45
3 files changed, 34 insertions, 24 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index a2c604c..2e10530 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-09 Corinna Vinschen <corinna@vinschen.de>
+
+ * mount.cc (mount_info::from_fstab_line): Always convert drive
+ letter in native path to uppercase.
+ * path.cc (normalize_win32_path): Ditto.
+ (path_prefix_p): Revert previous patch.
+
+ * path.cc (symlink_info::check): Check for STATUS_INVALID_PARAMETER
+ return code to circumvent weird behaviour of Samba 3.2.x shares.
+
2009-01-09 Christopher Faylor <me+cygwin@cgf.cx>
* include/sys/cygwin.h (CW_SETERRNO): Define.
diff --git a/winsup/cygwin/mount.cc b/winsup/cygwin/mount.cc
index 364c77b..67998b2 100644
--- a/winsup/cygwin/mount.cc
+++ b/winsup/cygwin/mount.cc
@@ -876,6 +876,9 @@ mount_info::from_fstab_line (char *line, bool user)
char *cend = find_ws (c);
*cend = '\0';
native_path = conv_fstab_spaces (c);
+ /* Always convert drive letter to uppercase for case sensitivity. */
+ if (isdrive (native_path))
+ native_path[0] = cyg_toupper (native_path[0]);
/* Second field: POSIX path. */
c = skip_ws (cend + 1);
if (!*c)
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index f736be4..2cca8f8 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -169,20 +169,8 @@ path_prefix_p (const char *path1, const char *path2, int len1,
return isdirsep (path2[0]) && !isdirsep (path2[1]);
if (isdirsep (path2[len1]) || path2[len1] == 0 || path1[len1 - 1] == ':')
- {
- if (len1 < 2 || (path1[1] != ':') || (path2[1] != ':'))
- /* nothing */;
- else if (tolower (*path1) != tolower(*path2))
- return 0;
- else
- {
- path1 += 2;
- path2 += 2;
- len1 -= 2;
- }
- return caseinsensitive ? strncasematch (path1, path2, len1)
- : !strncmp (path1, path2, len1);
- }
+ return caseinsensitive ? strncasematch (path1, path2, len1)
+ : !strncmp (path1, path2, len1);
return 0;
}
@@ -1177,17 +1165,23 @@ normalize_win32_path (const char *src, char *dst, char *&tail)
}
}
}
- if (tail == dst && !isdrive (src) && *src != '/')
+ if (tail == dst)
{
- if (beg_src_slash)
- tail += cygheap->cwd.get_drive (dst);
- else if (!cygheap->cwd.get (dst, 0))
- return get_errno ();
- else
+ if (isdrive (src))
+ /* Always convert drive letter to uppercase for case sensitivity. */
+ *tail++ = cyg_toupper (*src++);
+ else if (*src != '/')
{
- tail = strchr (tail, '\0');
- if (tail[-1] != '\\')
- *tail++ = '\\';
+ if (beg_src_slash)
+ tail += cygheap->cwd.get_drive (dst);
+ else if (!cygheap->cwd.get (dst, 0))
+ return get_errno ();
+ else
+ {
+ tail = strchr (tail, '\0');
+ if (tail[-1] != '\\')
+ *tail++ = '\\';
+ }
}
}
@@ -2167,7 +2161,10 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt,
| FILE_OPEN_FOR_BACKUP_INTENT,
eabuf, easize);
/* No right to access EAs or EAs not supported? */
- if (status == STATUS_ACCESS_DENIED || status == STATUS_EAS_NOT_SUPPORTED)
+ if (status == STATUS_ACCESS_DENIED || status == STATUS_EAS_NOT_SUPPORTED
+ /* Or a bug in Samba 3.2.x when accessing a share's root dir which
+ has EAs enabled? */
+ || status == STATUS_INVALID_PARAMETER)
{
no_ea = true;
/* If EAs are not supported, there's no sense to check them again