Skip to content

Commit

Permalink
- fix write access check when write mode only is requested (not RW)
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrejoye committed Jan 30, 2010
1 parent 891d7eb commit 1bbc4f1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion TSRM/tsrm_win32.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
}

Expand Down

0 comments on commit 1bbc4f1

Please sign in to comment.