summaryrefslogtreecommitdiff
path: root/TSRM/tsrm_win32.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-01-30 20:55:01 +0000
committerPierre Joye <pajoye@php.net>2010-01-30 20:55:01 +0000
commit1bbc4f1721b28865c9f475ae2672edf6360b9ba1 (patch)
tree244fcdeace0623a9b27278530cf5214b5471c991 /TSRM/tsrm_win32.c
parent891d7ebe1bc196e52e7c23af21f96ae88e0d2c9b (diff)
downloadphp-git-1bbc4f1721b28865c9f475ae2672edf6360b9ba1.tar.gz
- fix write access check when write mode only is requested (not RW)
Diffstat (limited to 'TSRM/tsrm_win32.c')
-rw-r--r--TSRM/tsrm_win32.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c
index 4058636f0e..f4727c82de 100644
--- a/TSRM/tsrm_win32.c
+++ b/TSRM/tsrm_win32.c
@@ -303,7 +303,7 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
fAccess = bucket->is_writable;
goto Finished;
}
- desired_access = FILE_GENERIC_READ | FILE_GENERIC_WRITE;
+ desired_access = FILE_GENERIC_WRITE;
} else if(mode <= 4) {
if(bucket != NULL && bucket->is_rvalid) {
fAccess = bucket->is_readable;
@@ -348,6 +348,11 @@ TSRM_API int tsrm_win32_access(const char *pathname, int mode)
else if(desired_access == FILE_GENERIC_WRITE) {
bucket->is_wvalid = 1;
bucket->is_writable = fAccess;
+ } else if (desired_access == FILE_GENERIC_READ | FILE_GENERIC_WRITE) {
+ bucket->is_rvalid = 1;
+ bucket->is_readable = fAccess;
+ bucket->is_wvalid = 1;
+ bucket->is_writable = fAccess;
}
}