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
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-05-29 15:04:02 +0400
committerCorinna Vinschen <corinna@vinschen.de>2005-05-29 15:04:02 +0400
commit7897d3fd88aedb20e8e11314f7b8585f72455c6d (patch)
tree40457056a291d00de5f8feffa0f6ae0ee92f46f8 /winsup
parentf330e7b8e845f29e901b97eb887d9486815a32ea (diff)
* path.cc (path_conv::check): Move component to function scope. Set
PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual paths. Allow non-retrievable shares to be handled as files.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog6
-rw-r--r--winsup/cygwin/path.cc22
2 files changed, 24 insertions, 4 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 7225d1520..fee9fd9d3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,9 @@
+2005-05-29 Corinna Vinschen <corinna@vinschen.de>
+
+ * path.cc (path_conv::check): Move component to function scope. Set
+ PATH_RO only on *real* FH_NETDRIVEs or on non-FH_NETDRIVE virtual
+ paths. Allow non-retrievable shares to be handled as files.
+
2005-05-29 Eric Blake <ebb9@byu.net>
* include/limits.h (LLONG_MIN, LLONG_MAX, ULLONG_MAX): Always define.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index dcf0871c1..2f9c450cb 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -550,6 +550,7 @@ path_conv::check (const char *src, unsigned opt,
memset (&dev, 0, sizeof (dev));
fs.clear ();
normalized_path = NULL;
+ int component = 0; // Number of translated components
if (!(opt & PC_NULLEMPTY))
error = 0;
@@ -582,7 +583,7 @@ path_conv::check (const char *src, unsigned opt,
Also: be careful to preserve the errno returned from
symlink.check as the caller may need it. */
/* FIXME: Do we have to worry about multiple \'s here? */
- int component = 0; // Number of translated components
+ component = 0; // Number of translated components
sym.contents[0] = '\0';
int symlen = 0;
@@ -671,7 +672,8 @@ path_conv::check (const char *src, unsigned opt,
fileattr = INVALID_FILE_ATTRIBUTES;
goto virtual_component_retry;
}
- path_flags |= PATH_RO;
+ if (component == 0 || dev.devn != FH_NETDRIVE)
+ path_flags |= PATH_RO;
goto out;
}
/* devn should not be a device. If it is, then stop parsing now. */
@@ -886,8 +888,20 @@ out:
}
else if (isvirtual_dev (dev.devn) && fileattr == INVALID_FILE_ATTRIBUTES)
{
- error = dev.devn == FH_NETDRIVE ? ENOSHARE : ENOENT;
- return;
+ if (dev.devn == FH_NETDRIVE && component)
+ {
+ /* This case indicates a non-existant resp. a non-retrievable
+ share. This happens for instance if the share is a printer.
+ In this case the path must not be treated like a FH_NETDRIVE,
+ but like a FH_FS instead, so the usual open call for files
+ is used on it. */
+ dev.parse (FH_FS);
+ }
+ else
+ {
+ error = dev.devn == FH_NETDRIVE ? ENOSHARE : ENOENT;
+ return;
+ }
}
else if (!need_directory || error)
/* nothing to do */;