diff options
author | Christopher Faylor <me@cgf.cx> | 2003-12-15 07:16:42 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-12-15 07:16:42 +0300 |
commit | 9908d9977b131249201b9c19219fd7d61fd65701 (patch) | |
tree | f57144fb183b3f75b68602d708a6704fde7be29a /winsup/cygwin | |
parent | 228f99a6c1a60d778fe0182ad9e66b8cd755daf8 (diff) |
* winsup.h (access_worker): Declare with added fhandler_base parameter.
* syscalls.cc (access_worker): Accommodate extra fhandler_base argument. Use
it instead of stat_worker to determine stat information, when appropriate.
* fhandler.cc (fhandler_base::device_access_denied): Pass fhandler pointer to
access_worker so that it can use the proper method for determining stat
information.
* fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r-- | winsup/cygwin/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/cygwin/fhandler.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 4 | ||||
-rw-r--r-- | winsup/cygwin/winsup.h | 2 |
6 files changed, 17 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 8bb514833..e747b6744 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,16 @@ 2003-12-14 Christopher Faylor <cgf@redhat.com> + * winsup.h (access_worker): Declare with added fhandler_base parameter. + * syscalls.cc (access_worker): Accommodate extra fhandler_base + argument. Use it instead of stat_worker to determine stat information, + when appropriate. + * fhandler.cc (fhandler_base::device_access_denied): Pass fhandler + pointer to access_worker so that it can use the proper method for + determining stat information. + * fhandler_disk_file.cc (fhandler_disk_file::opendir): Ditto. + +2003-12-14 Christopher Faylor <cgf@redhat.com> + * exceptions.cc (ctrl_c_handler): Remove this thread from the signal handler chain. diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index d9d377004..9be543a06 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -328,7 +328,7 @@ fhandler_base::device_access_denied (int flags) if (!mode) mode |= R_OK; - return access_worker (pc, mode); + return access_worker (pc, mode, this); } /* Open system call handler function. */ diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index a8e9ea8e6..f86432a31 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -632,7 +632,7 @@ fhandler_disk_file::opendir () set_errno (ENOMEM); goto free_dirname; } - else if (access_worker (pc, R_OK) != 0) + else if (access_worker (pc, R_OK, this) != 0) goto free_dirent; else { diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 11350d25b..d801a6665 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -556,7 +556,7 @@ path_conv::check (const char *src, unsigned opt, if (dev.major == DEV_CYGDRIVE_MAJOR) { if (!component) - fileattr = FILE_ATTRIBUTE_DIRECTORY; + fileattr = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_READONLY; else { dev.devn = FH_FS; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 992218271..2bb701d8e 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -1240,7 +1240,7 @@ lstat (const char *name, struct __stat32 *buf) } int -access_worker (path_conv& real_path, int flags) +access_worker (path_conv& real_path, int flags, fhandler_base *fh) { if (real_path.error) { @@ -1268,7 +1268,7 @@ access_worker (path_conv& real_path, int flags) return check_file_access (real_path, flags); struct __stat64 st; - int r = stat_worker (real_path, &st, 0); + int r = fh ? fh->fstat (&st) : stat_worker (real_path, &st, 0); if (r) return -1; r = -1; diff --git a/winsup/cygwin/winsup.h b/winsup/cygwin/winsup.h index 26be3d0c3..2d60fcd52 100644 --- a/winsup/cygwin/winsup.h +++ b/winsup/cygwin/winsup.h @@ -296,7 +296,7 @@ int symlink_worker (const char *, const char *, bool, bool) __attribute__ ((regparm (3))); class path_conv; -int access_worker (path_conv&, int) __attribute__ ((regparm (2))); +int access_worker (path_conv&, int, class fhandler_base * = NULL) __attribute__ ((regparm (3))); int fcntl_worker (int fd, int cmd, void *arg); |