Attachment "patch2_tclWinTest.c" to
ticket [1193497fff]
added by
fvogelnew1
2006-03-21 04:06:04.
--- K:\Francois\Developpement\tcl-cvs\win\tclWinTest.c Mon Mar 20 08:40:44 2006
+++ K:\Francois\Developpement\tcl-cvs\win\tclWinTest_fixed.c Mon Mar 20 21:55:48 2006
@@ -501,18 +501,16 @@
static int
TestplatformChmod(CONST char *nativePath, int pmode)
{
- SID_IDENTIFIER_AUTHORITY userSidAuthority =
- SECURITY_WORLD_SID_AUTHORITY;
+ SID_IDENTIFIER_AUTHORITY userSidAuthority = SECURITY_WORLD_SID_AUTHORITY;
typedef DWORD (WINAPI *getSidLengthRequiredDef) ( UCHAR );
- typedef BOOL (WINAPI *initializeSidDef) ( PSID,
- PSID_IDENTIFIER_AUTHORITY, BYTE );
+ typedef BOOL (WINAPI *initializeSidDef) ( PSID, PSID_IDENTIFIER_AUTHORITY, BYTE );
typedef PDWORD (WINAPI *getSidSubAuthorityDef) ( PSID, DWORD );
static getSidLengthRequiredDef getSidLengthRequiredProc;
static initializeSidDef initializeSidProc;
static getSidSubAuthorityDef getSidSubAuthorityProc;
- static const char everyoneBuf[] = "EVERYONE";
+
static const SECURITY_INFORMATION infoBits = OWNER_SECURITY_INFORMATION
| GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION;
static const DWORD readOnlyMask = FILE_DELETE_CHILD | FILE_ADD_FILE
@@ -537,7 +535,6 @@
SID *userSid = 0;
DWORD userDomainLen = 32;
TCHAR *userDomain = 0;
- SID_NAME_USE userSidUse;
DWORD attr;
@@ -665,24 +662,10 @@
}
}
- /* Get the "Everyone" SID */
+ /* Get the World SID */
userSid = (SID*) ckalloc(getSidLengthRequiredProc(1));
initializeSidProc( userSid, &userSidAuthority, 1);
*(getSidSubAuthorityProc( userSid, 0)) = SECURITY_WORLD_RID;
- userDomain = (TCHAR *) ckalloc(userDomainLen);
- if (!lookupAccountNameProc(NULL, everyoneBuf, userSid, &userSidLen,
- userDomain, &userDomainLen, &userSidUse)) {
- if (GetLastError() == ERROR_INSUFFICIENT_BUFFER) {
- ckfree((char *)userSid);
- userSid = (SID *) ckalloc(userSidLen);
- ckfree(userDomain);
- userDomain = (TCHAR *) ckalloc(userDomainLen);
- if (!lookupAccountNameProc(NULL, everyoneBuf, userSid,
- &userSidLen, userDomain, &userDomainLen, &userSidUse))
- goto done;
- } else
- goto done;
- }
/* If curAclPresent == false then curAcl and curAclDefaulted not valid */
if (!getSecurityDescriptorDaclProc(secDesc, &curAclPresent,