commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r769843 - in /commons/sandbox/runtime/trunk/src/main/native/os: unix/group.c unix/user.c win32/group.c win32/user.c
Date Wed, 29 Apr 2009 17:22:03 GMT
Author: mturk
Date: Wed Apr 29 17:22:03 2009
New Revision: 769843

URL: http://svn.apache.org/viewvc?rev=769843&view=rev
Log:
Invalid values are not equal

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c
    commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c
    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/unix/group.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c?rev=769843&r1=769842&r2=769843&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/group.c Wed Apr 29 17:22:03 2009
@@ -156,7 +156,10 @@
     gid_t gida = ACR_DescriptorGetInt(_E, a);
     gid_t gidb = ACR_DescriptorGetInt(_E, b);
 
-    return V2Z(gida == gidb);
+    if (gida >= 0 && gida >= 0 && gida == gidb)
+        return JNI_TRUE;
+    else
+        return JNI_FALSE;
 }
 
 ACR_JNI_EXPORT_DECLARE(jobjectArray, Group, enum1)(ACR_JNISTDARGS)

Modified: commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c?rev=769843&r1=769842&r2=769843&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/unix/user.c Wed Apr 29 17:22:03 2009
@@ -177,7 +177,10 @@
     uid_t uida = ACR_DescriptorGetInt(_E, a);
     uid_t uidb = ACR_DescriptorGetInt(_E, b);
 
-    return V2Z(uida == uidb);
+    if (uida >= 0 && uida >= 0 && uida == uidb)
+        return JNI_TRUE;
+    else
+        return JNI_FALSE;
 }
 
 ACR_JNI_EXPORT_DECLARE(jobjectArray, User, enum1)(ACR_JNISTDARGS)

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=769843&r1=769842&r2=769843&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 Wed Apr 29 17:22:03 2009
@@ -178,6 +178,8 @@
     PSID gida = ACR_DescriptorGetPtr(_E, a);
     PSID gidb = ACR_DescriptorGetPtr(_E, b);
 
+    if (!gida || !gidb)
+        return JNI_FALSE;
     return V2Z(EqualSid(gida, gidb));
 }
 

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=769843&r1=769842&r2=769843&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 Wed Apr 29 17:22:03 2009
@@ -278,6 +278,8 @@
     PSID uida = ACR_DescriptorGetPtr(_E, a);
     PSID uidb = ACR_DescriptorGetPtr(_E, b);
 
+    if (!uida || !uidb)
+        return JNI_FALSE;
     return V2Z(EqualSid(uida, uidb));
 }
 



Mime
View raw message