Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2009-11-09 22:46:36 +0300
committerCorinna Vinschen <corinna@vinschen.de>2009-11-09 22:46:36 +0300
commit16a72f7e4b7d5c974dbd4c8fbaaa5ac8c3628db1 (patch)
tree4a8558fc0fad523efa1839e3cf50d06cbdf52d61 /winsup/cygwin/syscalls.cc
parented66791aba119e8f5f39d4749ad31b6b885b1d6f (diff)
* path.cc (symlink_info::check_reparse_point): Always check
SubstituteName for volume string to recognize volume mount points. Reuse subst when calling sys_wcstombs. * syscalls.cc (rename): Set errno to EBUSY when trying to rename volume mount points. Explain why.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 55415b631..7a4f239b8 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1758,6 +1758,16 @@ rename (const char *oldpath, const char *newpath)
set_errno (EROFS);
goto out;
}
+ if (oldpc.has_attribute (FILE_ATTRIBUTE_REPARSE_POINT) && !oldpc.issymlink ())
+ {
+ /* Volume mount point. If we try to rename a volume mount point, NT
+ returns STATUS_NOT_SAME_DEVICE ==> Win32 ERROR_NOT_SAME_DEVICE ==>
+ errno EXDEV. That's bad since mv(1) will now perform a cross-device
+ move. So what we do here is to treat the volume mount point just
+ like Linux treats a mount point. */
+ set_errno (EBUSY);
+ goto out;
+ }
if (old_dir_requested && !oldpc.isdir ())
{
/* Reject rename("file/","x"). */