You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by mt...@apache.org on 2009/08/18 18:59:21 UTC
svn commit: r805494 -
/commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c
Author: mturk
Date: Tue Aug 18 16:59:21 2009
New Revision: 805494
URL: http://svn.apache.org/viewvc?rev=805494&view=rev
Log:
Use Ansi instead Unicode version. There is no unicode chars possible
Modified:
commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c
Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c?rev=805494&r1=805493&r2=805494&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/wusec.c Tue Aug 18 16:59:21 2009
@@ -298,52 +298,49 @@
DWORD dwUsersAccessMask,
DWORD dwGroupAccessMask)
{
- wchar_t sdd[ACR_MBUFF_SIZ];
- wchar_t saa[32] = L"";
+ char sdd[ACR_MBUFF_SIZ];
+ char saa[32] = "";
PSECURITY_DESCRIPTOR pSD = NULL;
- wcscpy(sdd, "D:(D;OICI;GA;;;BG)(D;OICI;GA;;;AN)");
- swprintf(saa, L"(A;OICI;0x%08x", dwAdminAccessMask);
+ strcpy(sdd, "D:(D;OICI;GA;;;BG)(D;OICI;GA;;;AN)");
+ sprintf(saa, "(A;OICI;0x%08x", dwAdminAccessMask);
/* Builtin Adminstrators */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;BA)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;BA)");
/* Creator Owner */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;CO)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;CO)");
/* Local Service */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;LS)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;LS)");
/* Local System */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;SY)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;SY)");
/* Logon Service */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;SU)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;SU)");
if (dwUsersAccessMask) {
- swprintf(saa, L"(A;OICI;0x%08x", dwUsersAccessMask);
+ sprintf(saa, "(A;OICI;0x%08x", dwUsersAccessMask);
/* Authenticated users */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;AU)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;AU)");
}
if (dwGroupAccessMask) {
- swprintf(saa, L"(A;OICI;0x%08x", dwGroupAccessMask);
+ sprintf(saa, "(A;OICI;0x%08x", dwGroupAccessMask);
/* Creator Group */
- wcscat(sdd, saa);
- wcscat(sdd, L";;;CG)");
+ strcat(sdd, saa);
+ strcat(sdd, ";;;CG)");
}
- fprintf(stdout, "SD %S\n", sdd);
- if (!ConvertStringSecurityDescriptorToSecurityDescriptorW(sdd,
+ if (!ConvertStringSecurityDescriptorToSecurityDescriptorA(sdd,
SDDL_REVISION_1, &pSD, NULL)) {
pSD = NULL;
if (!IS_INVALID_HANDLE(_E)) {
ACR_ThrowException(_E, THROW_FMARK, ACR_EX_ENOMEM,
ACR_GET_OS_ERROR());
}
- fprintf(stdout, "Failed!\n");
}
- fflush(stdout);
return pSD;
}