]> granicus.if.org Git - php/commitdiff
- fix write access check when write mode only is requested (not RW)
authorPierre Joye <pajoye@php.net>
Sat, 30 Jan 2010 20:55:01 +0000 (20:55 +0000)
committerPierre Joye <pajoye@php.net>
Sat, 30 Jan 2010 20:55:01 +0000 (20:55 +0000)
TSRM/tsrm_win32.c

index 4058636f0efbec38212c81914ee9334b1818f2f7..f4727c82de85d547a14835f510135fa7bba0912e 100644 (file)
@@ -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;
                        }
                }