This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Bind mounts require POSIX paths


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=117ebc802fe35dcaa404d52dda3437c09c817bef

commit 117ebc802fe35dcaa404d52dda3437c09c817bef
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jun 8 17:37:55 2015 +0200

    Bind mounts require POSIX paths
    
    	* path.cc (from_fstab_line): Don't convert slashes to backslashes for
    	bind mounts.  Explain why.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/utils/ChangeLog | 5 +++++
 winsup/utils/path.cc   | 9 +++++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/winsup/utils/ChangeLog b/winsup/utils/ChangeLog
index bfdb42a..70fef4a 100644
--- a/winsup/utils/ChangeLog
+++ b/winsup/utils/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-08  Corinna Vinschen  <corinna@vinschen.de>
+
+	* path.cc (from_fstab_line): Don't convert slashes to backslashes for
+	bind mounts.  Explain why.
+
 2015-04-21  Corinna Vinschen  <corinna@vinschen.de>
 
 	* tzmap-from-unicode.org: Convert Calcutta to Kolkata.
diff --git a/winsup/utils/path.cc b/winsup/utils/path.cc
index d1d01e9..e34741f 100644
--- a/winsup/utils/path.cc
+++ b/winsup/utils/path.cc
@@ -1,7 +1,7 @@
 /* path.cc
 
    Copyright 2001, 2002, 2003, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
-   2013 Red Hat, Inc.
+   2013, 2015 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -443,7 +443,12 @@ from_fstab_line (mnt_t *m, char *line, bool user)
 	    return false;
 	  }
       m->posix = strdup (posix_path);
-      unconvert_slashes (native_path);
+      /* Bind mounts require POSIX paths, otherwise the path is wrongly
+	 prefixed with the Cygwin root dir when trying to convert it to
+	 a Win32 path in mount(2). So don't convert slashes to backslashes
+         in this case. */
+      if (!(mount_flags & MOUNT_BIND))
+	unconvert_slashes (native_path);
       m->native = strdup (native_path);
       m->flags = mount_flags;
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]