diff options
author | vincentdarley <vincentdarley> | 2003-12-09 14:57:18 (GMT) |
---|---|---|
committer | vincentdarley <vincentdarley> | 2003-12-09 14:57:18 (GMT) |
commit | e59347aca80cd4e89dac4bea20bed1e42b090418 (patch) | |
tree | 1db7931db750fecc4df0e506dcdd4d1ec45f3795 /win/tclWinFile.c | |
parent | 714062429727db934f7ab082dbe42ecf849cd5ef (diff) | |
download | tcl-e59347aca80cd4e89dac4bea20bed1e42b090418.zip tcl-e59347aca80cd4e89dac4bea20bed1e42b090418.tar.gz tcl-e59347aca80cd4e89dac4bea20bed1e42b090418.tar.bz2 |
NT file permissions fix and tests
Diffstat (limited to 'win/tclWinFile.c')
-rw-r--r-- | win/tclWinFile.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/win/tclWinFile.c b/win/tclWinFile.c index f787669..548fd65 100644 --- a/win/tclWinFile.c +++ b/win/tclWinFile.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinFile.c,v 1.55 2003/10/13 16:48:07 vincentdarley Exp $ + * RCS: @(#) $Id: tclWinFile.c,v 1.56 2003/12/09 14:57:18 vincentdarley Exp $ */ //#define _WIN32_WINNT 0x0500 @@ -1413,22 +1413,24 @@ NativeAccess(nativePath, mode) goto accessError; } (*tclWinProcs->revertToSelfProc)(); + memset (&genMap, 0x00, sizeof (GENERIC_MAPPING)); + /* - * Fill GenericMask type according to access priveleges - * we are checking. + * Setup desiredAccess according to the access priveleges we + * are checking. */ genMap.GenericAll = 0; if (mode & R_OK) { - genMap.GenericRead = FILE_GENERIC_READ; + desiredAccess |= FILE_GENERIC_READ; } if (mode & W_OK) { - genMap.GenericWrite = FILE_GENERIC_WRITE; + desiredAccess |= FILE_GENERIC_WRITE; } if (mode & X_OK) { - genMap.GenericExecute = FILE_GENERIC_EXECUTE; + desiredAccess |= FILE_GENERIC_EXECUTE; } - (*tclWinProcs->mapGenericMaskProc)(&desiredAccess, &genMap); + /* * Perform access check using the token. */ |