* cygtls.cc (_cygtls::remove): Eliminate compiler warning.

* dir.cc (mkdir): Check path for writability.
(rmdir): Ditto.  Remove check for special directories.
* path.cc (path_conv::check): Set PATH_RO for virtual devices.  Set error if
read-only and asked for writability.
* path.h (pathconv_arg): Add PC_WRITABLE.
(path_types): Add PATH_RO.
(path_conv::isro): Add (currently unused) check for read-only filesystem.
Return "ENOSHARE" when we know a share doesn't exist.
* include/sys/mount.h: Add MOUNT_RO flag.
* autoload.cc (WNetGetResourceInformationA): Import.
* fhandler_netdrive.cc (fhandler_netdrive::exists): Detect actual existence of
remote system rather than always assuming that it exists.
This commit is contained in:
Christopher Faylor
2005-05-13 03:21:39 +00:00
parent cf55bf5ee8
commit 66582dd6e7
8 changed files with 72 additions and 26 deletions

View File

@@ -224,7 +224,7 @@ mkdir (const char *dir, mode_t mode)
SECURITY_ATTRIBUTES sa = sec_none_nih;
security_descriptor sd;
path_conv real_dir (dir, PC_SYM_NOFOLLOW);
path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_WRITABLE);
if (real_dir.error)
{
@@ -263,15 +263,11 @@ extern "C" int
rmdir (const char *dir)
{
int res = -1;
DWORD devn;
path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_FULL);
path_conv real_dir (dir, PC_SYM_NOFOLLOW | PC_FULL | PC_WRITABLE);
if (real_dir.error)
set_errno (real_dir.error);
else if ((devn = real_dir.get_devn ()) == FH_PROC || devn == FH_REGISTRY
|| devn == FH_PROCESS)
set_errno (EROFS);
else if (!real_dir.exists ())
set_errno (ENOENT);
else if (!real_dir.isdir ())