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/05/02 11:55:48 UTC

svn commit: r770919 - in /commons/sandbox/runtime/trunk/src/main/native/os/win32: group.c user.c

Author: mturk
Date: Sat May  2 09:55:48 2009
New Revision: 770919

URL: http://svn.apache.org/viewvc?rev=770919&view=rev
Log:
Add effective uid and gid

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

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c?rev=770919&r1=770918&r2=770919&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/group.c Sat May  2 09:55:48 2009
@@ -261,14 +261,11 @@
         }
     }
     grp = ACR_GetTokenInformation(_E, token, TokenPrimaryGroup);
-    if (!grp) {
-        goto cleanup;
+    if (grp) {
+        gid = ACR_GroupObjectCreateFromId(_E, grp->PrimaryGroup);
+        free(grp);
     }
-    gid = ACR_GroupObjectCreateFromId(_E, grp->PrimaryGroup);
 
-cleanup:
-    if (grp)
-        free(grp);
     CloseHandle(token);
     return gid;
 }
@@ -307,7 +304,7 @@
         goto cleanup;
     }
     for (i = 0; i < grp->GroupCount; i++) {
-        if (grp[i].Attributes & SE_GROUP_OWNER) {
+        if (grp->Groups[i].Attributes & SE_GROUP_OWNER) {
             gid = ACR_GroupObjectCreateFromId(_E, grp->Groups[i].Sid);
             if (!gid) {
                 goto cleanup;

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c?rev=770919&r1=770918&r2=770919&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/user.c Sat May  2 09:55:48 2009
@@ -401,14 +401,11 @@
         }
     }
     usr = ACR_GetTokenInformation(_E, token, TokenUser);
-    if (!usr) {
-        goto cleanup;
+    if (usr) {
+        uid = ACR_UserObjectCreateFromId(_E, usr->User.Sid);
+        free(usr);
     }
-    uid = ACR_UserObjectCreateFromId(_E, usr->User.Sid);
 
-cleanup:
-    if (usr)
-        free(usr);
     CloseHandle(token);
     return uid;
 }
@@ -445,10 +442,9 @@
     usr = ACR_GetTokenInformation(_E, token, TokenOwner);
     if (usr) {
         uid = ACR_UserObjectCreateFromId(_E, usr->Owner);
+        free(usr);
     }
 
-    if (usr)
-        free(usr);
     CloseHandle(token);
     return uid;
 }