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 12:10:52 UTC

svn commit: r805343 - in /commons/sandbox/runtime/trunk/src/main/native/os/win32: main.c platform.c

Author: mturk
Date: Tue Aug 18 10:10:52 2009
New Revision: 805343

URL: http://svn.apache.org/viewvc?rev=805343&view=rev
Log:
Move SD init to PlatformInitialize

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c?rev=805343&r1=805342&r2=805343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/main.c Tue Aug 18 10:10:52 2009
@@ -283,26 +283,6 @@
     if (IS_INVALID_HANDLE(dll_psig_handle))
         return ACR_GET_OS_ERROR();
 
-    /*
-     * Create standard security descriptors
-     */
-    acr_sd_generic_admin = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
-                                                     GENERIC_ALL,
-                                                     0,
-                                                     0);
-    acr_sd_filesys_admin = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
-                                                     GENERIC_ALL | FILE_ALL_ACCESS,
-                                                     0,
-                                                     0);
-    acr_sd_generic_users = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
-                                                     GENERIC_ALL,
-                                                     GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
-                                                     0);
-    acr_sd_filesys_users = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
-                                                     GENERIC_ALL | FILE_ALL_ACCESS,
-                                                     GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE |
-                                                     FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE,
-                                                     0);
     /* Do not display file not found messge boxes.
      * Return the error to the application instead
      */

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c?rev=805343&r1=805342&r2=805343&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/platform.c Tue Aug 18 10:10:52 2009
@@ -26,6 +26,11 @@
 extern PSID acr_everyone_sid;
 extern PSID acr_adminsgr_sid;
 extern LPSYSTEM_INFO acr_osinf;
+extern LPSECURITY_DESCRIPTOR acr_sd_generic_admin;
+extern LPSECURITY_DESCRIPTOR acr_sd_filesys_admin;
+extern LPSECURITY_DESCRIPTOR acr_sd_generic_users;
+extern LPSECURITY_DESCRIPTOR acr_sd_filesys_users;
+
 acr_size_t  acr_page_size;
 int         acr_native_codepage = ACR_CP_DEFAULT;
 
@@ -47,6 +52,38 @@
     if (!acr_adminsgr_sid) {
         acr_adminsgr_sid = ACR_AllocateWellKnownSid(_E, WinBuiltinAdministratorsSid);
     }
+    /*
+     * Create standard security descriptors
+     */
+    if (!acr_sd_generic_admin) {
+        /* All access to Admins */
+        acr_sd_generic_admin = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
+                                                         GENERIC_ALL,
+                                                         0,
+                                                         0);
+    }
+    if (!acr_sd_filesys_admin) {
+        /* All file access to Admins */
+        acr_sd_filesys_admin = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
+                                                         GENERIC_ALL | FILE_ALL_ACCESS,
+                                                         0,
+                                                         0);
+    }
+    if (!acr_sd_generic_users) {
+        /* RWX access to Authenticated users */
+        acr_sd_generic_users = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
+                                                         GENERIC_ALL,
+                                                         GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE,
+                                                         0);
+    }
+    if (!acr_sd_filesys_users) {
+        /* RWX file access to Authenticated users */
+        acr_sd_filesys_users = ACR_GetSecurityDescriptor(INVALID_HANDLE_VALUE,
+                                                         GENERIC_ALL | FILE_ALL_ACCESS,
+                                                         GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE |
+                                                         FILE_GENERIC_READ | FILE_GENERIC_WRITE | FILE_GENERIC_EXECUTE,
+                                                         0);
+    }
     return acr_ioh_init(ios);
 }