From 66582dd6e7e63a2c179357e61fe2ccd53c83b02b Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 13 May 2005 03:21:39 +0000 Subject: * 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. --- winsup/cygwin/path.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'winsup/cygwin/path.h') diff --git a/winsup/cygwin/path.h b/winsup/cygwin/path.h index f21c4b999..1c6310326 100644 --- a/winsup/cygwin/path.h +++ b/winsup/cygwin/path.h @@ -39,7 +39,8 @@ enum pathconv_arg PC_NULLEMPTY = 0x0020, PC_CHECK_EA = 0x0040, PC_POSIX = 0x0080, - PC_NO_ACCESS_CHECK = 0x00800000 + PC_NO_ACCESS_CHECK = 0x00800000, + PC_WRITABLE = 0x00400000 }; enum case_checking @@ -51,7 +52,7 @@ enum case_checking #define PC_NONULLEMPTY -1 -#include +#include "sys/mount.h" enum path_types { @@ -62,6 +63,7 @@ enum path_types PATH_NOTEXEC = MOUNT_NOTEXEC, PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC, PATH_ENC = MOUNT_ENC, + PATH_RO = MOUNT_RO, PATH_ALL_EXEC = (PATH_CYGWIN_EXEC | PATH_EXEC), PATH_NO_ACCESS_CHECK = PC_NO_ACCESS_CHECK, PATH_LNK = 0x01000000, @@ -149,6 +151,7 @@ class path_conv int is_lnk_special () const {return is_fs_device () || isfifo () || is_lnk_symlink ();} int issocket () const {return dev.devn == FH_UNIX;} int iscygexec () const {return path_flags & PATH_CYGWIN_EXEC;} + bool isro () const {return !!(path_flags & PATH_RO);} bool exists () const {return fileattr != INVALID_FILE_ATTRIBUTES;} bool has_attribute (DWORD x) const {return exists () && (fileattr & x);} int isdir () const {return has_attribute (FILE_ATTRIBUTE_DIRECTORY);} -- cgit v1.2.3