harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r446480 - in /incubator/harmony/enhanced/classlib/trunk/modules/auth: .settings/ src/main/java/common/org/apache/harmony/auth/login/ src/main/native/auth/linux/ src/main/native/auth/shared/ src/main/native/auth/windows/ src/test/java/common...
Date Fri, 15 Sep 2006 02:43:50 GMT
Author: ndbeyer
Date: Thu Sep 14 19:43:48 2006
New Revision: 446480

URL: http://svn.apache.org/viewvc?view=rev&rev=446480
Log:
Set eol-style = native for auth module.

Modified:
    incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/login/DefaultConfiguration.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ChoiceCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/LanguageCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/NameCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/PasswordCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextInputCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigParserTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/auth.conf   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/CredentialExpiredExceptionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/ChannelBindingTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSExceptionTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSManagerTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSNameTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/MessagePropTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java   (contents, props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/linux/org/apache/harmony/auth/module/UnixLoginModuleTest.java   (props changed)
    incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/windows/org/apache/harmony/auth/module/NTLoginModuleTest.java   (props changed)

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs Thu Sep 14 19:43:48 2006
@@ -1,12 +1,12 @@
-#Wed May 03 13:10:22 BST 2006
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+#Wed May 03 13:10:22 BST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.4
+org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.debug.lineNumber=generate
+org.eclipse.jdt.core.compiler.debug.localVariable=generate
+org.eclipse.jdt.core.compiler.debug.sourceFile=generate
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.core.prefs
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs Thu Sep 14 19:43:48 2006
@@ -1,3 +1,3 @@
-#Wed May 03 13:10:00 BST 2006
-eclipse.preferences.version=1
-internal.default.compliance=user
+#Wed May 03 13:10:00 BST 2006
+eclipse.preferences.version=1
+internal.default.compliance=user

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.jdt.ui.prefs
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs Thu Sep 14 19:43:48 2006
@@ -1,4 +1,4 @@
-#Fri Apr 07 13:57:42 BST 2006
-eclipse.preferences.version=1
-pluginProject.equinox=false
-pluginProject.extensions=false
+#Fri Apr 07 13:57:42 BST 2006
+eclipse.preferences.version=1
+pluginProject.equinox=false
+pluginProject.extensions=false

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/.settings/org.eclipse.pde.core.prefs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/java/common/org/apache/harmony/auth/login/DefaultConfiguration.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c Thu Sep 14 19:43:48 2006
@@ -1,159 +1,159 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
- * @author Alexander V. Astapchuk
- * @version $Revision$
- */
-#if defined( _WINDOWS)
-#include <windows.h>
-BOOL APIENTRY DllMain( HANDLE hModule, 
-                       DWORD  ul_reason_for_call, 
-                       LPVOID lpReserved
-                     )
-{
-    return TRUE;
-}
-
-
-    #include "nixemu.h"
-#else
-    #include <unistd.h>
-    #include <pwd.h>
-    #include <grp.h>
-#endif /* ifdef _WINDOWS */
-
-#include <stdlib.h>
-#include <assert.h>
-
-#include "vmi.h"
-#include "jni.h"
-
-jfieldID jf_uid = NULL;
-jfieldID jf_username = NULL;
-jfieldID jf_gid = NULL;
-jfieldID jf_groupname = NULL;
-
-jfieldID jf_groups = NULL;
-jfieldID jf_groupsNames = NULL;
-
-jclass jclassString = NULL;
-
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_auth_module_UnixSystem_load
-  (JNIEnv * jenv, jobject thiz)
-{
-    PORT_ACCESS_FROM_ENV(jenv);
-    uid_t uid;
-    gid_t gid;
-    struct passwd * pp;
-    struct group * pg;
-    int gcount;
-
-    if( NULL == jf_uid ) {
-        jclass klass = (*jenv)->GetObjectClass (jenv, thiz);
-        if( NULL == klass ) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not obtain object's Class");
-            return;
-        }
-
-        if( NULL == (jf_uid = (*jenv)->GetFieldID (jenv, klass, "uid", "J"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"uid\" of type long");
-            return;
-        }
-        if( NULL == (jf_username = (*jenv)->GetFieldID (jenv, klass, "username", "Ljava/lang/String;"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"username\" of type String");
-            return;
-        }
-        if( NULL == (jf_gid = (*jenv)->GetFieldID (jenv, klass, "gid", "J"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"gid\" of type long");
-            return;
-        }
-        if( NULL == (jf_groupname = (*jenv)->GetFieldID (jenv, klass, "groupname", "Ljava/lang/String;"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groupname\" of type String");
-            return;
-        }
-
-        if( NULL == (jf_groups = (*jenv)->GetFieldID (jenv, klass, "groups", "[J"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groups\" of type long[]");
-            return;
-        }
-        if( NULL == (jf_groupsNames = (*jenv)->GetFieldID (jenv, klass, "groupsNames", "[Ljava/lang/String;"))) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groupsNames\" of type String[]");
-            return;
-        }
-        if( NULL == (jclassString = (*jenv)->FindClass (jenv, "java/lang/String")) ) {
-            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-            assert(klassErr);
-            (*jenv)->ThrowNew (jenv, klassErr, "Could not find class java/lang/String");
-            return;
-        }
-        jclassString = (jclass)(*jenv)->NewGlobalRef (jenv, jclassString);
-    }
-
-    uid = getuid();
-    (*jenv)->SetLongField (jenv, thiz, jf_uid, (jlong)uid);
-    gid = getgid();
-    (*jenv)->SetLongField (jenv, thiz, jf_gid, (jlong)gid);
-
-    pp = getpwuid(uid);
-    (*jenv)->SetObjectField (jenv, thiz, jf_username, (*jenv)->NewStringUTF (jenv, pp->pw_name));
-
-    pg = getgrgid(gid);
-    (*jenv)->SetObjectField (jenv, thiz, jf_groupname, (*jenv)->NewStringUTF (jenv, pg->gr_name));
-
-    gcount = getgroups(0, NULL);
-    if( 0 != gcount ) {
-
-        gid_t * gids;
-        jlongArray jgs;
-        jlong * jgs_raw;
-        jobjectArray jgsnames;
-        int i;
-
-        gids = (gid_t*)hymem_allocate_memory(gcount*sizeof(gid_t));
-
-        getgroups(gcount, gids);
-        jgs = (*jenv)->NewLongArray (jenv, gcount);
-        jgs_raw = (*jenv)->GetLongArrayElements (jenv, jgs, NULL);
-        jgsnames = (*jenv)->NewObjectArray (jenv, gcount, jclassString, NULL);
-        for(i=0; i<gcount; i++ ) {
-            struct group * g = getgrgid(gids[i]);
-            jgs_raw[i] = g->gr_gid;
-            (*jenv)->SetObjectArrayElement (jenv, jgsnames, i, (*jenv)->NewStringUTF (jenv, g->gr_name));
-        }
-        (*jenv)->ReleaseLongArrayElements (jenv, jgs, jgs_raw, 0); /* here: 0='update java array with the passed values' */
-        (*jenv)->SetObjectField (jenv, thiz, jf_groups, jgs);
-        (*jenv)->SetObjectField (jenv, thiz, jf_groupsNames, jgsnames);
-
-        hymem_free_memory(gids);
-
-    };
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+ * @author Alexander V. Astapchuk
+ * @version $Revision$
+ */
+#if defined( _WINDOWS)
+#include <windows.h>
+BOOL APIENTRY DllMain( HANDLE hModule, 
+                       DWORD  ul_reason_for_call, 
+                       LPVOID lpReserved
+                     )
+{
+    return TRUE;
+}
+
+
+    #include "nixemu.h"
+#else
+    #include <unistd.h>
+    #include <pwd.h>
+    #include <grp.h>
+#endif /* ifdef _WINDOWS */
+
+#include <stdlib.h>
+#include <assert.h>
+
+#include "vmi.h"
+#include "jni.h"
+
+jfieldID jf_uid = NULL;
+jfieldID jf_username = NULL;
+jfieldID jf_gid = NULL;
+jfieldID jf_groupname = NULL;
+
+jfieldID jf_groups = NULL;
+jfieldID jf_groupsNames = NULL;
+
+jclass jclassString = NULL;
+
+JNIEXPORT void JNICALL
+Java_org_apache_harmony_auth_module_UnixSystem_load
+  (JNIEnv * jenv, jobject thiz)
+{
+    PORT_ACCESS_FROM_ENV(jenv);
+    uid_t uid;
+    gid_t gid;
+    struct passwd * pp;
+    struct group * pg;
+    int gcount;
+
+    if( NULL == jf_uid ) {
+        jclass klass = (*jenv)->GetObjectClass (jenv, thiz);
+        if( NULL == klass ) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not obtain object's Class");
+            return;
+        }
+
+        if( NULL == (jf_uid = (*jenv)->GetFieldID (jenv, klass, "uid", "J"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"uid\" of type long");
+            return;
+        }
+        if( NULL == (jf_username = (*jenv)->GetFieldID (jenv, klass, "username", "Ljava/lang/String;"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"username\" of type String");
+            return;
+        }
+        if( NULL == (jf_gid = (*jenv)->GetFieldID (jenv, klass, "gid", "J"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"gid\" of type long");
+            return;
+        }
+        if( NULL == (jf_groupname = (*jenv)->GetFieldID (jenv, klass, "groupname", "Ljava/lang/String;"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groupname\" of type String");
+            return;
+        }
+
+        if( NULL == (jf_groups = (*jenv)->GetFieldID (jenv, klass, "groups", "[J"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groups\" of type long[]");
+            return;
+        }
+        if( NULL == (jf_groupsNames = (*jenv)->GetFieldID (jenv, klass, "groupsNames", "[Ljava/lang/String;"))) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groupsNames\" of type String[]");
+            return;
+        }
+        if( NULL == (jclassString = (*jenv)->FindClass (jenv, "java/lang/String")) ) {
+            jclass klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+            assert(klassErr);
+            (*jenv)->ThrowNew (jenv, klassErr, "Could not find class java/lang/String");
+            return;
+        }
+        jclassString = (jclass)(*jenv)->NewGlobalRef (jenv, jclassString);
+    }
+
+    uid = getuid();
+    (*jenv)->SetLongField (jenv, thiz, jf_uid, (jlong)uid);
+    gid = getgid();
+    (*jenv)->SetLongField (jenv, thiz, jf_gid, (jlong)gid);
+
+    pp = getpwuid(uid);
+    (*jenv)->SetObjectField (jenv, thiz, jf_username, (*jenv)->NewStringUTF (jenv, pp->pw_name));
+
+    pg = getgrgid(gid);
+    (*jenv)->SetObjectField (jenv, thiz, jf_groupname, (*jenv)->NewStringUTF (jenv, pg->gr_name));
+
+    gcount = getgroups(0, NULL);
+    if( 0 != gcount ) {
+
+        gid_t * gids;
+        jlongArray jgs;
+        jlong * jgs_raw;
+        jobjectArray jgsnames;
+        int i;
+
+        gids = (gid_t*)hymem_allocate_memory(gcount*sizeof(gid_t));
+
+        getgroups(gcount, gids);
+        jgs = (*jenv)->NewLongArray (jenv, gcount);
+        jgs_raw = (*jenv)->GetLongArrayElements (jenv, jgs, NULL);
+        jgsnames = (*jenv)->NewObjectArray (jenv, gcount, jclassString, NULL);
+        for(i=0; i<gcount; i++ ) {
+            struct group * g = getgrgid(gids[i]);
+            jgs_raw[i] = g->gr_gid;
+            (*jenv)->SetObjectArrayElement (jenv, jgsnames, i, (*jenv)->NewStringUTF (jenv, g->gr_name));
+        }
+        (*jenv)->ReleaseLongArrayElements (jenv, jgs, jgs_raw, 0); /* here: 0='update java array with the passed values' */
+        (*jenv)->SetObjectField (jenv, thiz, jf_groups, jgs);
+        (*jenv)->SetObjectField (jenv, thiz, jf_groupsNames, jgsnames);
+
+        hymem_free_memory(gids);
+
+    };
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/linux/authnix.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c Thu Sep 14 19:43:48 2006
@@ -1,19 +1,19 @@
-/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* A copyright string included in each DLL and executable */
-
-const char hyCopyright[] =
-  "(c) Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.";
+/* Copyright 2006 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* A copyright string included in each DLL and executable */
+
+const char hyCopyright[] =
+  "(c) Copyright 2005, 2006 The Apache Software Foundation or its licensors, as applicable.";

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/shared/auth_copyright.c
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c Thu Sep 14 19:43:48 2006
@@ -1,527 +1,527 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-#undef _WIN32_WINNT
-#define _WIN32_WINNT 0x0500
-
-#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
-#include <windows.h>
-#include <sddl.h>
-
-//#include <winbase.h>
-#include "authwin32.h"
-
-#include <assert.h>
-
-#include "vmi.h"
-#include "jni.h"
-
-#pragma warning(disable:4311)
-
-void error(LPVOID lpJEnv, LPCSTR msg, DWORD dwErr);
-
-jfieldID jf_user = NULL;
-jfieldID jf_domainSid = NULL;
-    
-jfieldID jf_mainGroup = NULL;
-jfieldID jf_groups = NULL;
-jfieldID jf_token = NULL;
-
-jfieldID jf_debugNative = NULL;
-
-
-BOOLEAN
-getDebugNative( JNIEnv * jenv, jobject thiz )
-{
-	return (*jenv)->GetBooleanField (jenv, thiz, jf_debugNative) ? TRUE : FALSE;
-}
-
-
-JNIEXPORT void JNICALL 
-Java_org_apache_harmony_auth_module_NTSystem_initNatives
-(JNIEnv * jenv, jclass klass)
-{
-	jclass klassErr = NULL;
-
-	if( NULL == (jf_user = (*jenv)->GetFieldID (jenv, klass, "user", "Lorg/apache/harmony/auth/NTSidUserPrincipal;"))) {
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"user\" of type NTSidUserPrincipal");
-		return;
-	}
-
-	if( NULL == (jf_domainSid = (*jenv)->GetFieldID (jenv, klass, "domainSid", "Ljava/lang/String;")) ) {
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"domainSid\" of type String");
-		return;
-	}
-
-	if( NULL == (jf_mainGroup = (*jenv)->GetFieldID (jenv, klass, "mainGroup", "Lorg/apache/harmony/auth/NTSidPrimaryGroupPrincipal;")) ) {
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"mainGroup\" of type NTSidPrimaryGroupPrincipal");
-		return;
-	}
-
-	if( NULL == (jf_groups = (*jenv)->GetFieldID (jenv, klass, "groups", "[Lorg/apache/harmony/auth/NTSidGroupPrincipal;")) ) {
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groups\" of type NTSidPrimaryGroupPrincipal");
-		return;
-	}
-
-	if( NULL == (jf_token = (*jenv)->GetFieldID (jenv, klass, "token", "J")) ) {
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"token\" of type NTSidPrimaryGroupPrincipal");
-		return;
-	}
-
-	if( NULL == (jf_debugNative = (*jenv)->GetFieldID (jenv, klass, "debugNative", "Z")) ) {
-		if ( (*jenv)->ExceptionCheck (jenv) ) {
-			(*jenv)->ExceptionDescribe (jenv);
-			return;
-		}
-		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
-		assert(klassErr);
-		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"debugNative\" of type boolean.");
-		return;
-	}
-}
-
-
-LPVOID QueryInfo
-(JNIEnv * jenv, HANDLE hToken, TOKEN_INFORMATION_CLASS klass) 
-{
-	PORT_ACCESS_FROM_ENV (jenv);
-
-	DWORD dwSize;
-	LPVOID pData = NULL;
-
-	if( !GetTokenInformation(hToken, klass, NULL, 0, &dwSize) ) {
-		DWORD dwErr = GetLastError();
-		if( ERROR_INSUFFICIENT_BUFFER != dwErr ) {
-			return NULL;
-		}
-	}
-
-	pData = hymem_allocate_memory(dwSize);
-	if( !GetTokenInformation(hToken, klass, pData, dwSize, &dwSize) ) {
-		DWORD dwErr = GetLastError();
-		hymem_free_memory(pData);
-		SetLastError(dwErr);
-		return NULL;
-	}
-	return pData;
-}
-
-
-BOOLEAN GetInfo
-(JNIEnv * jenv, PSID sid, LPSTR* ppName, LPSTR* ppDomain) 
-{
-	PORT_ACCESS_FROM_ENV (jenv);
-
-	DWORD dwNameSize = 0;
-	DWORD dwDomainNameSize = 0;
-	SID_NAME_USE snu;
-	if( !LookupAccountSid(NULL, sid, NULL, &dwNameSize, NULL, &dwDomainNameSize, &snu)) {
-		if( ERROR_INSUFFICIENT_BUFFER != GetLastError() ) {
-			return FALSE;
-		}
-	}
-	*ppName = (LPSTR)hymem_allocate_memory(dwNameSize);
-	if( NULL == ppName ) {
-		return FALSE;
-	}
-	*ppDomain = (LPSTR)hymem_allocate_memory(dwDomainNameSize);
-	if( NULL == ppName ) {
-		DWORD err = GetLastError();
-		hymem_free_memory(*ppName);
-		SetLastError(err);
-		return FALSE;
-	}
-	if( !LookupAccountSid(NULL, sid, *ppName, &dwNameSize, *ppDomain, &dwDomainNameSize, &snu)) {
-		DWORD err = GetLastError();
-		hymem_free_memory(*ppName);
-		hymem_free_memory(*ppDomain);
-		SetLastError(err);
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
-
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_auth_module_NTSystem_load
-(JNIEnv * jenv, jobject thiz)
-{
-	DWORD i; /* tmp */
-
-	DWORD dwError = -1; /* presume unknown error */
-	LPCSTR errMsg = NULL;
-	DWORD dwSaveError = -1;
-
-	HANDLE hUser = INVALID_HANDLE_VALUE;
-	HANDLE iToken= INVALID_HANDLE_VALUE;
-
-	LPVOID lpUserData = NULL, lpGroupData = NULL, lpAllGroupsData = NULL;
-	LPSTR lpStr0 = NULL, lpStr1 = NULL, lpStr2 = NULL;
-	LPSTR lpUserSid = NULL, lpDomainName = NULL;
-	PSID domainSid = NULL;
-
-	SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
-
-	TOKEN_USER * ptu = NULL;
-	PSID userSid = NULL;
-
-	jclass jkl = NULL;
-	jmethodID ctor = NULL;
-
-	jstring jstrSid = NULL;
-	jstring jstrUser = NULL;
-	jstring jstrDomain = NULL;
-	jobject obj = NULL;
-
-	jstring jstrDomainSid = NULL;
-
-	PTOKEN_PRIMARY_GROUP ptpg = NULL;
-	PSID groupSid = NULL;
-
-	jclass jklassPrimaryGroup = NULL;
-	jobject jobj = NULL;
-
-	PTOKEN_GROUPS ptgs = NULL;
-
-	jclass klassGroup = NULL;
-	jmethodID groupCtor3 = NULL;
-	jmethodID groupCtor1 = NULL;
-	jobjectArray jgroups = NULL;
-
-	jobject jobj1 = NULL;
-
-	//
-	// Get the token for the user currently running this Thread
-	//
-	if( !OpenThreadToken(GetCurrentThread(), TOKEN_QUERY|TOKEN_DUPLICATE, TRUE, &hUser) ) {
-		// failed to open thread token. well, let's try process' one
-		if( !OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &hUser) ) {
-			errMsg = "Unable to obtain user token";
-			goto exit;
-		}
-	}
-
-	//
-	// Obtain the User's info
-	//
-	if( NULL == (lpUserData = (TOKEN_USER*)QueryInfo(jenv, hUser, TokenUser)) ) {
-		errMsg = "Unable to obtain user's token info";
-		goto exit;
-	}
-
-	ptu = (TOKEN_USER*)lpUserData;
-
-	if( !IsValidSid(ptu->User.Sid) ) {
-		errMsg = "Got invalid user's SID";
-		goto exit;
-	}
-
-	userSid = ptu->User.Sid;
-
-	ConvertSidToStringSid(userSid, &lpStr0);
-	lpUserSid = lpStr0;
-	lpStr0 = NULL;
-
-	//
-    // step +n:  Retrieve user name and domain name basing on user's SID.
-	//
-	if( !GetInfo(jenv, userSid, &lpStr0, &lpStr1) ) {
-		errMsg = "Unable to retrieve user's name and domain";
-		goto exit;
-	};
-
-	jkl = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidUserPrincipal");
-	if( NULL == jkl || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find class NTSidUserPrincipal";
-		goto exit;
-	}
-	ctor = (*jenv)->GetMethodID (jenv, jkl, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
-	if( NULL == ctor || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find ctor at NTSidUserPrincipal class";
-		goto exit;
-	}
-
-	jstrSid = (*jenv)->NewStringUTF (jenv, lpUserSid);
-	jstrUser = (*jenv)->NewStringUTF (jenv, lpStr0);
-	jstrDomain = (*jenv)->NewStringUTF (jenv, lpStr1);
-	obj = (*jenv)->NewObject (jenv, jkl, ctor, jstrSid, jstrUser, jstrDomain);
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-	(*jenv)->SetObjectField (jenv, thiz, jf_user, obj);
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-	
-	LocalFree(lpStr0); lpStr0 = NULL;
-	lpDomainName = lpStr1; 
-	lpStr1 = NULL;
-
-	//
-	// Step +1: Obtain domain SID
-	//
-	if( !AllocateAndInitializeSid(
-		&sia, 4, 
-		*GetSidSubAuthority(userSid, 0), 
-		*GetSidSubAuthority(userSid, 1), 
-		*GetSidSubAuthority(userSid, 2),
-		*GetSidSubAuthority(userSid, 3), 
-		0, 0, 0, 0, 
-		&domainSid)) {
-
-		errMsg = "Unable to allocate domain SID";
-		goto exit;
-	}
-
-	if( !IsValidSid(domainSid) ) {
-		errMsg = "Got invalid domain SID";
-		goto exit;
-	}
-
-	ConvertSidToStringSid(domainSid, &lpStr0);
-
-	jstrDomainSid = (*jenv)->NewStringUTF (jenv, lpStr0);
-	(*jenv)->SetObjectField (jenv, thiz, jf_domainSid, jstrDomainSid);
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-	LocalFree(lpStr0); lpStr0 = NULL;
-
-	//
-	// step +1: get primary group sid
-	//
-	if( NULL == (lpGroupData = QueryInfo(jenv, hUser, TokenPrimaryGroup)) ) {
-		errMsg = "Unable to get primaty group";
-		goto exit;
-	};
-
-	ptpg = (PTOKEN_PRIMARY_GROUP)lpGroupData;
-	groupSid = ptpg->PrimaryGroup;
-
-	if( !IsValidSid(groupSid) ) {
-		errMsg = "Got invalid primary groups' SID";
-		goto exit;
-	}
-
-	if( !GetInfo(jenv, groupSid, &lpStr0, &lpStr1) ) {
-		errMsg = "Unable to get primary group's info";
-		goto exit;
-	}
-	ConvertSidToStringSid(groupSid, &lpStr2);
-
-	jklassPrimaryGroup = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidPrimaryGroupPrincipal");
-	if( NULL == jklassPrimaryGroup || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find class NTSidPrimaryGroupPrincipal";
-		goto exit;
-	}
-
-	ctor = (*jenv)->GetMethodID (jenv, jklassPrimaryGroup, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
-	if( NULL == ctor ) {
-		errMsg = "Could not find appropriate ctor at NTSidPrimaryGroupPrincipal";
-		goto exit;
-	}
-
-	jobj = (*jenv)->NewObject (jenv, jklassPrimaryGroup, ctor, 
-		(*jenv)->NewStringUTF (jenv, lpStr2), (*jenv)->NewStringUTF (jenv, lpStr0), (*jenv)->NewStringUTF (jenv, lpStr1));
-
-	LocalFree(lpStr0); lpStr0 = NULL;
-	LocalFree(lpStr1); lpStr1 = NULL;
-	LocalFree(lpStr2); lpStr2 = NULL;
-
-
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-	(*jenv)->SetObjectField (jenv, thiz, jf_mainGroup, jobj);
-
-	//
-	// step +1: get groups
-	//
-	if( NULL== (lpAllGroupsData = QueryInfo(jenv, hUser, TokenGroups)) ) {
-		errMsg = "Unable to query user's groups";
-		goto exit;
-	}
-
-	ptgs = (PTOKEN_GROUPS)lpAllGroupsData;
-
-	klassGroup = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidGroupPrincipal");
-	if( NULL == klassGroup || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find NTSidGroupPrincipal";
-		goto exit;
-	};
-
-	groupCtor3 = (*jenv)->GetMethodID (jenv, klassGroup, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
-	if( NULL == groupCtor3 || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find appropriate ctor with 3 Strings at NTSidGroupPrincipal";
-		goto exit;
-	};
-	groupCtor1 = (*jenv)->GetMethodID (jenv, klassGroup, "<init>", "(Ljava/lang/String;)V");
-	if( NULL == groupCtor1 || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not find appropriate ctor at NTSidGroupPrincipal";
-		goto exit;
-	};
-
-	// allocate an array 
-	jgroups = (*jenv)->NewObjectArray (jenv, ptgs->GroupCount, klassGroup, NULL);
-
-	if( NULL == jgroups || (*jenv)->ExceptionCheck (jenv) ) {
-		errMsg = "Could not create array of NTSidGroupPrincipal";
-		goto exit;
-	};
-
-	for( i=0; i<ptgs->GroupCount; i++ ) {
-
-		ConvertSidToStringSid(ptgs->Groups[i].Sid, &lpStr2);
-
-		if( !GetInfo(jenv, ptgs->Groups[i].Sid, &lpStr0, &lpStr1) ) {
-			jobj1 = (*jenv)->NewObject (jenv, klassGroup, groupCtor1, (*jenv)->NewStringUTF (jenv, lpStr2));
-			//printf("SET_FIELD: %d] Simple Group: %s\n", i, lpStr2 );
-		}
-		else {
-			jobj1 = (*jenv)->NewObject (jenv, klassGroup, groupCtor3, 
-				(*jenv)->NewStringUTF (jenv, lpStr2), (*jenv)->NewStringUTF (jenv, lpStr0), (*jenv)->NewStringUTF (jenv, lpStr1));
-//			printf("SET_FIELD: %d] Group: %s@%s \n\t %s\n", i, lpStr0, lpStr1, lpStr2 );
-		}
-		if( NULL != lpStr0 ) { LocalFree(lpStr0); lpStr0 = NULL; }
-		if( NULL != lpStr1 ) { LocalFree(lpStr1); lpStr1 = NULL; }
-		if( NULL != lpStr2 ) { LocalFree(lpStr2); lpStr2 = NULL; }
-		if( NULL == jobj1 || (*jenv)->ExceptionCheck (jenv) ) {
-			goto exit;
-		}
-		(*jenv)->SetObjectArrayElement (jenv, jgroups, i, jobj1);
-		if( (*jenv)->ExceptionCheck (jenv) ) {
-			goto exit;
-		}
-	};
-	(*jenv)->SetObjectField (jenv, thiz, jf_groups, jgroups);
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-
-	//
-	// step +1: get itoken
-	//
-
-	//FIXME: on NT 'SecurityImpersonation'  is not supported. 
-	// Check whether we support NT - just to be sure.
-	if (!DuplicateToken (hUser, SecurityImpersonation, &iToken)) {
-		errMsg = "Unable to duplicate impersonation token";
-		goto exit;
-	};
-
-	// printf("_SET_FIELD: iToken: %d \n", ((long)iToken) );
-	(*jenv)->SetLongField (jenv, thiz, jf_token, ((jlong)iToken));
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		goto exit;
-	}
-
-	dwError = 0;
-exit:
-	dwSaveError = GetLastError();
-
-	if( NULL != lpUserData )		LocalFree(lpUserData);
-	if( NULL != lpGroupData )		LocalFree(lpGroupData);
-	if( NULL != lpAllGroupsData )	LocalFree(lpAllGroupsData);
-	if( NULL != lpStr0 )			LocalFree(lpStr0);
-	if( NULL != lpStr1 )			LocalFree(lpStr1);
-	if( NULL != lpStr2 )			LocalFree(lpStr2);
-	if( NULL != lpUserSid )			LocalFree(lpUserSid);
-	if( NULL != lpDomainName)		LocalFree(lpDomainName);
-	//
-	if( NULL != domainSid )			FreeSid(domainSid);
-
-	if( INVALID_HANDLE_VALUE != hUser ) CloseHandle(hUser);
-
-	if( (*jenv)->ExceptionCheck (jenv) ) {
-		(*jenv)->ExceptionDescribe (jenv);
-	}
-	else {
-		if( (0 != dwError) || (NULL!=errMsg) ) {
-			if( dwError == -1 ) {
-				dwError = dwSaveError;
-			}
-			error((LPVOID)jenv, (LPCSTR)errMsg, dwError);
-		}
-	}
-	return;
-}
-
-/*
-* Class:     org_apache_harmony_auth_module_NTSystem
-* Method:    free
-* Signature: ()V
-*/
-JNIEXPORT void JNICALL
-Java_org_apache_harmony_auth_module_NTSystem_free
-(JNIEnv * jenv, jobject thiz)
-{
-	HANDLE hTok = (HANDLE)(*jenv)->GetLongField (jenv, thiz, jf_token);
-	if( !(0 == hTok || INVALID_HANDLE_VALUE == hTok) ) {
-		if( !CloseHandle(hTok) ) {
-			error((LPVOID)jenv, (LPCSTR) "Unable to close handle", GetLastError());
-		}
-	}
-}
-
-void
-error
-(LPVOID lpJEnv, LPCSTR msg, DWORD dwErr)
-{
-	JNIEnv * jenv = (JNIEnv*)lpJEnv;
-	LPVOID lpMsg = NULL;
-	LPVOID lpFullMsg = NULL;
-	DWORD args[3];
-	jclass excl = NULL;
-
-	if (!FormatMessage(
-		FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
-        NULL, dwErr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
-		(LPTSTR)&lpMsg, 0, NULL )) {
-			// error in error(). 
-		//assert(false);
-	}
-
-	args[0] = (DWORD)msg;
-	args[1] = dwErr;
-	args[2] = (DWORD)lpMsg;
-	
-	if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
-		"%1!s! (#%2!d!): \"%3!s!\"", 0, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
-		(LPTSTR)&lpFullMsg, 0, (va_list*)args)) {
-			// error in error(). 
-	}
-
-	excl = (*jenv)->FindClass (jenv, "java/lang/Error");
-	if( NULL == excl ) {
-		return;
-	}
-	(*jenv)->ThrowNew (jenv, excl, (LPCSTR)lpFullMsg);
-
-	// Free the buffer.
-	LocalFree( lpMsg );
-	LocalFree( lpFullMsg );
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+#undef _WIN32_WINNT
+#define _WIN32_WINNT 0x0500
+
+#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers
+#include <windows.h>
+#include <sddl.h>
+
+//#include <winbase.h>
+#include "authwin32.h"
+
+#include <assert.h>
+
+#include "vmi.h"
+#include "jni.h"
+
+#pragma warning(disable:4311)
+
+void error(LPVOID lpJEnv, LPCSTR msg, DWORD dwErr);
+
+jfieldID jf_user = NULL;
+jfieldID jf_domainSid = NULL;
+    
+jfieldID jf_mainGroup = NULL;
+jfieldID jf_groups = NULL;
+jfieldID jf_token = NULL;
+
+jfieldID jf_debugNative = NULL;
+
+
+BOOLEAN
+getDebugNative( JNIEnv * jenv, jobject thiz )
+{
+	return (*jenv)->GetBooleanField (jenv, thiz, jf_debugNative) ? TRUE : FALSE;
+}
+
+
+JNIEXPORT void JNICALL 
+Java_org_apache_harmony_auth_module_NTSystem_initNatives
+(JNIEnv * jenv, jclass klass)
+{
+	jclass klassErr = NULL;
+
+	if( NULL == (jf_user = (*jenv)->GetFieldID (jenv, klass, "user", "Lorg/apache/harmony/auth/NTSidUserPrincipal;"))) {
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"user\" of type NTSidUserPrincipal");
+		return;
+	}
+
+	if( NULL == (jf_domainSid = (*jenv)->GetFieldID (jenv, klass, "domainSid", "Ljava/lang/String;")) ) {
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"domainSid\" of type String");
+		return;
+	}
+
+	if( NULL == (jf_mainGroup = (*jenv)->GetFieldID (jenv, klass, "mainGroup", "Lorg/apache/harmony/auth/NTSidPrimaryGroupPrincipal;")) ) {
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"mainGroup\" of type NTSidPrimaryGroupPrincipal");
+		return;
+	}
+
+	if( NULL == (jf_groups = (*jenv)->GetFieldID (jenv, klass, "groups", "[Lorg/apache/harmony/auth/NTSidGroupPrincipal;")) ) {
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"groups\" of type NTSidPrimaryGroupPrincipal");
+		return;
+	}
+
+	if( NULL == (jf_token = (*jenv)->GetFieldID (jenv, klass, "token", "J")) ) {
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"token\" of type NTSidPrimaryGroupPrincipal");
+		return;
+	}
+
+	if( NULL == (jf_debugNative = (*jenv)->GetFieldID (jenv, klass, "debugNative", "Z")) ) {
+		if ( (*jenv)->ExceptionCheck (jenv) ) {
+			(*jenv)->ExceptionDescribe (jenv);
+			return;
+		}
+		klassErr = (*jenv)->FindClass (jenv, "java/lang/Error");
+		assert(klassErr);
+		(*jenv)->ThrowNew (jenv, klassErr, "Could not find field \"debugNative\" of type boolean.");
+		return;
+	}
+}
+
+
+LPVOID QueryInfo
+(JNIEnv * jenv, HANDLE hToken, TOKEN_INFORMATION_CLASS klass) 
+{
+	PORT_ACCESS_FROM_ENV (jenv);
+
+	DWORD dwSize;
+	LPVOID pData = NULL;
+
+	if( !GetTokenInformation(hToken, klass, NULL, 0, &dwSize) ) {
+		DWORD dwErr = GetLastError();
+		if( ERROR_INSUFFICIENT_BUFFER != dwErr ) {
+			return NULL;
+		}
+	}
+
+	pData = hymem_allocate_memory(dwSize);
+	if( !GetTokenInformation(hToken, klass, pData, dwSize, &dwSize) ) {
+		DWORD dwErr = GetLastError();
+		hymem_free_memory(pData);
+		SetLastError(dwErr);
+		return NULL;
+	}
+	return pData;
+}
+
+
+BOOLEAN GetInfo
+(JNIEnv * jenv, PSID sid, LPSTR* ppName, LPSTR* ppDomain) 
+{
+	PORT_ACCESS_FROM_ENV (jenv);
+
+	DWORD dwNameSize = 0;
+	DWORD dwDomainNameSize = 0;
+	SID_NAME_USE snu;
+	if( !LookupAccountSid(NULL, sid, NULL, &dwNameSize, NULL, &dwDomainNameSize, &snu)) {
+		if( ERROR_INSUFFICIENT_BUFFER != GetLastError() ) {
+			return FALSE;
+		}
+	}
+	*ppName = (LPSTR)hymem_allocate_memory(dwNameSize);
+	if( NULL == ppName ) {
+		return FALSE;
+	}
+	*ppDomain = (LPSTR)hymem_allocate_memory(dwDomainNameSize);
+	if( NULL == ppName ) {
+		DWORD err = GetLastError();
+		hymem_free_memory(*ppName);
+		SetLastError(err);
+		return FALSE;
+	}
+	if( !LookupAccountSid(NULL, sid, *ppName, &dwNameSize, *ppDomain, &dwDomainNameSize, &snu)) {
+		DWORD err = GetLastError();
+		hymem_free_memory(*ppName);
+		hymem_free_memory(*ppDomain);
+		SetLastError(err);
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
+
+JNIEXPORT void JNICALL
+Java_org_apache_harmony_auth_module_NTSystem_load
+(JNIEnv * jenv, jobject thiz)
+{
+	DWORD i; /* tmp */
+
+	DWORD dwError = -1; /* presume unknown error */
+	LPCSTR errMsg = NULL;
+	DWORD dwSaveError = -1;
+
+	HANDLE hUser = INVALID_HANDLE_VALUE;
+	HANDLE iToken= INVALID_HANDLE_VALUE;
+
+	LPVOID lpUserData = NULL, lpGroupData = NULL, lpAllGroupsData = NULL;
+	LPSTR lpStr0 = NULL, lpStr1 = NULL, lpStr2 = NULL;
+	LPSTR lpUserSid = NULL, lpDomainName = NULL;
+	PSID domainSid = NULL;
+
+	SID_IDENTIFIER_AUTHORITY sia = SECURITY_NT_AUTHORITY;
+
+	TOKEN_USER * ptu = NULL;
+	PSID userSid = NULL;
+
+	jclass jkl = NULL;
+	jmethodID ctor = NULL;
+
+	jstring jstrSid = NULL;
+	jstring jstrUser = NULL;
+	jstring jstrDomain = NULL;
+	jobject obj = NULL;
+
+	jstring jstrDomainSid = NULL;
+
+	PTOKEN_PRIMARY_GROUP ptpg = NULL;
+	PSID groupSid = NULL;
+
+	jclass jklassPrimaryGroup = NULL;
+	jobject jobj = NULL;
+
+	PTOKEN_GROUPS ptgs = NULL;
+
+	jclass klassGroup = NULL;
+	jmethodID groupCtor3 = NULL;
+	jmethodID groupCtor1 = NULL;
+	jobjectArray jgroups = NULL;
+
+	jobject jobj1 = NULL;
+
+	//
+	// Get the token for the user currently running this Thread
+	//
+	if( !OpenThreadToken(GetCurrentThread(), TOKEN_QUERY|TOKEN_DUPLICATE, TRUE, &hUser) ) {
+		// failed to open thread token. well, let's try process' one
+		if( !OpenProcessToken(GetCurrentProcess(), TOKEN_QUERY|TOKEN_DUPLICATE, &hUser) ) {
+			errMsg = "Unable to obtain user token";
+			goto exit;
+		}
+	}
+
+	//
+	// Obtain the User's info
+	//
+	if( NULL == (lpUserData = (TOKEN_USER*)QueryInfo(jenv, hUser, TokenUser)) ) {
+		errMsg = "Unable to obtain user's token info";
+		goto exit;
+	}
+
+	ptu = (TOKEN_USER*)lpUserData;
+
+	if( !IsValidSid(ptu->User.Sid) ) {
+		errMsg = "Got invalid user's SID";
+		goto exit;
+	}
+
+	userSid = ptu->User.Sid;
+
+	ConvertSidToStringSid(userSid, &lpStr0);
+	lpUserSid = lpStr0;
+	lpStr0 = NULL;
+
+	//
+    // step +n:  Retrieve user name and domain name basing on user's SID.
+	//
+	if( !GetInfo(jenv, userSid, &lpStr0, &lpStr1) ) {
+		errMsg = "Unable to retrieve user's name and domain";
+		goto exit;
+	};
+
+	jkl = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidUserPrincipal");
+	if( NULL == jkl || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find class NTSidUserPrincipal";
+		goto exit;
+	}
+	ctor = (*jenv)->GetMethodID (jenv, jkl, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+	if( NULL == ctor || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find ctor at NTSidUserPrincipal class";
+		goto exit;
+	}
+
+	jstrSid = (*jenv)->NewStringUTF (jenv, lpUserSid);
+	jstrUser = (*jenv)->NewStringUTF (jenv, lpStr0);
+	jstrDomain = (*jenv)->NewStringUTF (jenv, lpStr1);
+	obj = (*jenv)->NewObject (jenv, jkl, ctor, jstrSid, jstrUser, jstrDomain);
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+	(*jenv)->SetObjectField (jenv, thiz, jf_user, obj);
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+	
+	LocalFree(lpStr0); lpStr0 = NULL;
+	lpDomainName = lpStr1; 
+	lpStr1 = NULL;
+
+	//
+	// Step +1: Obtain domain SID
+	//
+	if( !AllocateAndInitializeSid(
+		&sia, 4, 
+		*GetSidSubAuthority(userSid, 0), 
+		*GetSidSubAuthority(userSid, 1), 
+		*GetSidSubAuthority(userSid, 2),
+		*GetSidSubAuthority(userSid, 3), 
+		0, 0, 0, 0, 
+		&domainSid)) {
+
+		errMsg = "Unable to allocate domain SID";
+		goto exit;
+	}
+
+	if( !IsValidSid(domainSid) ) {
+		errMsg = "Got invalid domain SID";
+		goto exit;
+	}
+
+	ConvertSidToStringSid(domainSid, &lpStr0);
+
+	jstrDomainSid = (*jenv)->NewStringUTF (jenv, lpStr0);
+	(*jenv)->SetObjectField (jenv, thiz, jf_domainSid, jstrDomainSid);
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+	LocalFree(lpStr0); lpStr0 = NULL;
+
+	//
+	// step +1: get primary group sid
+	//
+	if( NULL == (lpGroupData = QueryInfo(jenv, hUser, TokenPrimaryGroup)) ) {
+		errMsg = "Unable to get primaty group";
+		goto exit;
+	};
+
+	ptpg = (PTOKEN_PRIMARY_GROUP)lpGroupData;
+	groupSid = ptpg->PrimaryGroup;
+
+	if( !IsValidSid(groupSid) ) {
+		errMsg = "Got invalid primary groups' SID";
+		goto exit;
+	}
+
+	if( !GetInfo(jenv, groupSid, &lpStr0, &lpStr1) ) {
+		errMsg = "Unable to get primary group's info";
+		goto exit;
+	}
+	ConvertSidToStringSid(groupSid, &lpStr2);
+
+	jklassPrimaryGroup = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidPrimaryGroupPrincipal");
+	if( NULL == jklassPrimaryGroup || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find class NTSidPrimaryGroupPrincipal";
+		goto exit;
+	}
+
+	ctor = (*jenv)->GetMethodID (jenv, jklassPrimaryGroup, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+	if( NULL == ctor ) {
+		errMsg = "Could not find appropriate ctor at NTSidPrimaryGroupPrincipal";
+		goto exit;
+	}
+
+	jobj = (*jenv)->NewObject (jenv, jklassPrimaryGroup, ctor, 
+		(*jenv)->NewStringUTF (jenv, lpStr2), (*jenv)->NewStringUTF (jenv, lpStr0), (*jenv)->NewStringUTF (jenv, lpStr1));
+
+	LocalFree(lpStr0); lpStr0 = NULL;
+	LocalFree(lpStr1); lpStr1 = NULL;
+	LocalFree(lpStr2); lpStr2 = NULL;
+
+
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+	(*jenv)->SetObjectField (jenv, thiz, jf_mainGroup, jobj);
+
+	//
+	// step +1: get groups
+	//
+	if( NULL== (lpAllGroupsData = QueryInfo(jenv, hUser, TokenGroups)) ) {
+		errMsg = "Unable to query user's groups";
+		goto exit;
+	}
+
+	ptgs = (PTOKEN_GROUPS)lpAllGroupsData;
+
+	klassGroup = (*jenv)->FindClass (jenv, "org/apache/harmony/auth/NTSidGroupPrincipal");
+	if( NULL == klassGroup || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find NTSidGroupPrincipal";
+		goto exit;
+	};
+
+	groupCtor3 = (*jenv)->GetMethodID (jenv, klassGroup, "<init>", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V");
+	if( NULL == groupCtor3 || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find appropriate ctor with 3 Strings at NTSidGroupPrincipal";
+		goto exit;
+	};
+	groupCtor1 = (*jenv)->GetMethodID (jenv, klassGroup, "<init>", "(Ljava/lang/String;)V");
+	if( NULL == groupCtor1 || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not find appropriate ctor at NTSidGroupPrincipal";
+		goto exit;
+	};
+
+	// allocate an array 
+	jgroups = (*jenv)->NewObjectArray (jenv, ptgs->GroupCount, klassGroup, NULL);
+
+	if( NULL == jgroups || (*jenv)->ExceptionCheck (jenv) ) {
+		errMsg = "Could not create array of NTSidGroupPrincipal";
+		goto exit;
+	};
+
+	for( i=0; i<ptgs->GroupCount; i++ ) {
+
+		ConvertSidToStringSid(ptgs->Groups[i].Sid, &lpStr2);
+
+		if( !GetInfo(jenv, ptgs->Groups[i].Sid, &lpStr0, &lpStr1) ) {
+			jobj1 = (*jenv)->NewObject (jenv, klassGroup, groupCtor1, (*jenv)->NewStringUTF (jenv, lpStr2));
+			//printf("SET_FIELD: %d] Simple Group: %s\n", i, lpStr2 );
+		}
+		else {
+			jobj1 = (*jenv)->NewObject (jenv, klassGroup, groupCtor3, 
+				(*jenv)->NewStringUTF (jenv, lpStr2), (*jenv)->NewStringUTF (jenv, lpStr0), (*jenv)->NewStringUTF (jenv, lpStr1));
+//			printf("SET_FIELD: %d] Group: %s@%s \n\t %s\n", i, lpStr0, lpStr1, lpStr2 );
+		}
+		if( NULL != lpStr0 ) { LocalFree(lpStr0); lpStr0 = NULL; }
+		if( NULL != lpStr1 ) { LocalFree(lpStr1); lpStr1 = NULL; }
+		if( NULL != lpStr2 ) { LocalFree(lpStr2); lpStr2 = NULL; }
+		if( NULL == jobj1 || (*jenv)->ExceptionCheck (jenv) ) {
+			goto exit;
+		}
+		(*jenv)->SetObjectArrayElement (jenv, jgroups, i, jobj1);
+		if( (*jenv)->ExceptionCheck (jenv) ) {
+			goto exit;
+		}
+	};
+	(*jenv)->SetObjectField (jenv, thiz, jf_groups, jgroups);
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+
+	//
+	// step +1: get itoken
+	//
+
+	//FIXME: on NT 'SecurityImpersonation'  is not supported. 
+	// Check whether we support NT - just to be sure.
+	if (!DuplicateToken (hUser, SecurityImpersonation, &iToken)) {
+		errMsg = "Unable to duplicate impersonation token";
+		goto exit;
+	};
+
+	// printf("_SET_FIELD: iToken: %d \n", ((long)iToken) );
+	(*jenv)->SetLongField (jenv, thiz, jf_token, ((jlong)iToken));
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		goto exit;
+	}
+
+	dwError = 0;
+exit:
+	dwSaveError = GetLastError();
+
+	if( NULL != lpUserData )		LocalFree(lpUserData);
+	if( NULL != lpGroupData )		LocalFree(lpGroupData);
+	if( NULL != lpAllGroupsData )	LocalFree(lpAllGroupsData);
+	if( NULL != lpStr0 )			LocalFree(lpStr0);
+	if( NULL != lpStr1 )			LocalFree(lpStr1);
+	if( NULL != lpStr2 )			LocalFree(lpStr2);
+	if( NULL != lpUserSid )			LocalFree(lpUserSid);
+	if( NULL != lpDomainName)		LocalFree(lpDomainName);
+	//
+	if( NULL != domainSid )			FreeSid(domainSid);
+
+	if( INVALID_HANDLE_VALUE != hUser ) CloseHandle(hUser);
+
+	if( (*jenv)->ExceptionCheck (jenv) ) {
+		(*jenv)->ExceptionDescribe (jenv);
+	}
+	else {
+		if( (0 != dwError) || (NULL!=errMsg) ) {
+			if( dwError == -1 ) {
+				dwError = dwSaveError;
+			}
+			error((LPVOID)jenv, (LPCSTR)errMsg, dwError);
+		}
+	}
+	return;
+}
+
+/*
+* Class:     org_apache_harmony_auth_module_NTSystem
+* Method:    free
+* Signature: ()V
+*/
+JNIEXPORT void JNICALL
+Java_org_apache_harmony_auth_module_NTSystem_free
+(JNIEnv * jenv, jobject thiz)
+{
+	HANDLE hTok = (HANDLE)(*jenv)->GetLongField (jenv, thiz, jf_token);
+	if( !(0 == hTok || INVALID_HANDLE_VALUE == hTok) ) {
+		if( !CloseHandle(hTok) ) {
+			error((LPVOID)jenv, (LPCSTR) "Unable to close handle", GetLastError());
+		}
+	}
+}
+
+void
+error
+(LPVOID lpJEnv, LPCSTR msg, DWORD dwErr)
+{
+	JNIEnv * jenv = (JNIEnv*)lpJEnv;
+	LPVOID lpMsg = NULL;
+	LPVOID lpFullMsg = NULL;
+	DWORD args[3];
+	jclass excl = NULL;
+
+	if (!FormatMessage(
+		FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
+        NULL, dwErr, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+		(LPTSTR)&lpMsg, 0, NULL )) {
+			// error in error(). 
+		//assert(false);
+	}
+
+	args[0] = (DWORD)msg;
+	args[1] = dwErr;
+	args[2] = (DWORD)lpMsg;
+	
+	if (!FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER|FORMAT_MESSAGE_FROM_STRING|FORMAT_MESSAGE_ARGUMENT_ARRAY,
+		"%1!s! (#%2!d!): \"%3!s!\"", 0, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
+		(LPTSTR)&lpFullMsg, 0, (va_list*)args)) {
+			// error in error(). 
+	}
+
+	excl = (*jenv)->FindClass (jenv, "java/lang/Error");
+	if( NULL == excl ) {
+		return;
+	}
+	(*jenv)->ThrowNew (jenv, excl, (LPCSTR)lpFullMsg);
+
+	// Free the buffer.
+	LocalFree( lpMsg );
+	LocalFree( lpFullMsg );
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/main/native/auth/windows/authwin32.c
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ChoiceCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/ConfirmationCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/LanguageCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/NameCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/PasswordCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextInputCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/TextOutputCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/callback/UnsupportedCallbackExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/DelegationPermissionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/kerberos/ServicePermissionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrincipalTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/auth/x500/X500PrivateCredentialTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthenticationExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/AuthorizeCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/RealmChoiceCallbackTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl1Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl2Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl3Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/Sasl4Test.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/javax/security/sasl/SaslExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigParserTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java Thu Sep 14 19:43:48 2006
@@ -1,274 +1,274 @@
-/*
- *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
- *
- *  Licensed under the Apache License, Version 2.0 (the "License");
- *  you may not use this file except in compliance with the License.
- *  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- *  Unless required by applicable law or agreed to in writing, software
- *  distributed under the License is distributed on an "AS IS" BASIS,
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- *  See the License for the specific language governing permissions and
- *  limitations under the License.
- */
-
-/**
-* @author Maxim V. Makarov
-* @version $Revision$
-*/
-
-package org.apache.harmony.auth.login;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.security.Permission;
-import java.security.Security;
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.security.auth.AuthPermission;
-import javax.security.auth.login.AppConfigurationEntry;
-
-import junit.framework.TestCase;
-
-import org.apache.harmony.auth.tests.support.TestUtils;
-import org.apache.harmony.auth.login.DefaultConfiguration;
-
-
-/**
- * Tests default configuration implementation.  
- */
-
-public class DefaultConfigurationTest extends TestCase {
-
-    private static final String LOGIN_CONFIG = "java.security.auth.login.config";
-    
-    static String outputPath = System.getProperty("RESOURCE_DIR", "test/common/unit");
-    
-    static String otherConfFile = outputPath + File.separator + "org" + 
-        File.separator + "apache" + File.separator + "harmony" + 
-        File.separator + "auth" + File.separator + "login" +
-        File.separator + "auth.conf";
-
-	private static File defaultConfFile;
-
-	static AppConfigurationEntry[] ents = null;
-
-	SecurityManager old = System.getSecurityManager();
-
-	String oldp1 = null;
-	String oldp2 = null;
-
-	public void setUp() throws Exception {
-		createConfFile();
-		
-		oldp1 = Security.getProperty("login.config.url.1");
-		oldp2 = Security.getProperty("login.config.url.2");
-	}
-
-	public void tearDown() throws Exception {
-		System.setSecurityManager(old);
-
-		TestUtils.setSystemProperty("login.config.url.1", oldp1);
-		TestUtils.setSystemProperty("login.config.url.2", oldp2);
-
-		defaultConfFile.delete();
-	}
-
-	public static void main(String[] args) {
-		junit.textui.TestRunner.run(DefaultConfigurationTest.class);
-	}
-	
-	/**
-	 * loading a config file specified on the security property  
-	 * using login.config.url.1
-	 * XXX: load a default config file
-	 */
-	public static void testLoadConfigFile() throws Exception {
-			DefaultConfiguration dc = null;
-			dc = new DefaultConfiguration();
-			assertNotNull(dc);
-			ents = dc.getAppConfigurationEntry("Login1");
-			assertNull(ents);
-			ents = dc.getAppConfigurationEntry(null);
-			assertNull(ents);
-			Security.setProperty("login.config.url.1", "file:"
-					+ defaultConfFile.getCanonicalPath());
-			Security.setProperty("login.config.url.2", "file:"
-					+ new File(otherConfFile).getCanonicalPath());
-
-			dc = new DefaultConfiguration();
-			ents = dc.getAppConfigurationEntry("LoginNew");
-			assertNotNull(ents);
-			assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
-			Map m = new HashMap();
-			m.put("debug", "true");
-			m.put("test", "false");
-			assertEquals(m, ents[0].getOptions());
-			assertEquals("LoginModuleControlFlag: optional", ents[0].getControlFlag().toString());
-
-			ents = dc.getAppConfigurationEntry("Login1");
-			assertNotNull(ents);
-			for (int i = 0; i < ents.length; i++) {
-				assertEquals("com.intel.security.auth.module.LoginModule1",
-						ents[i].getLoginModuleName());
-				m.clear();
-				m.put("debug1", "true");
-				m.put("test1", "false");
-				assertEquals(m, ents[i].getOptions());
-				assertEquals("LoginModuleControlFlag: required", ents[i]
-						.getControlFlag().toString());
-			}
-			
-			
-			
-	}
-	/**
-	 * loading a config file specified on the system property
-	 * using -Djava.security.auth.login.config    
-	 */
-	public void testLoadConfigFile_1() throws IOException {
-		
-	    String oldp = System.getProperty(LOGIN_CONFIG);	
-		try {
-		System.setProperty(LOGIN_CONFIG, 
-				new File(otherConfFile).getCanonicalPath());
-		DefaultConfiguration dc = new DefaultConfiguration();
-		assertNotNull(dc);
-		
-		ents = dc.getAppConfigurationEntry("Login2");
-		assertNotNull(ents);
-		ents = dc.getAppConfigurationEntry("other");
-		assertNotNull(ents);
-		ents = dc.getAppConfigurationEntry("Login1");
-		assertNotNull(ents);
-		Map m = new HashMap();
-		for (int i = 0; i < ents.length; i++) {
-			assertEquals("com.intel.security.auth.module.LoginModule1",
-					ents[i].getLoginModuleName());
-			m.clear();
-			m.put("debug1", "true");
-			m.put("test1", "false");
-			assertEquals(m, ents[i].getOptions());
-			assertEquals("LoginModuleControlFlag: required", ents[i]
-					.getControlFlag().toString());
-		}
-		
-		ents = dc.getAppConfigurationEntry("Login7");
-		assertNotNull(ents);
-
-		
-		assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
-		assertEquals("com.intel.security.auth.module.LoginModule2", ents[1].getLoginModuleName());
-		assertEquals("com.intel.security.auth.module.LoginModule3", ents[2].getLoginModuleName());
-		assertEquals("com.intel.security.auth.module.LoginModule4",  ents[3].getLoginModuleName());
-		
-		assertEquals("LoginModuleControlFlag: required", ents[0].getControlFlag().toString());
-		assertEquals("LoginModuleControlFlag: optional", ents[1].getControlFlag().toString());
-		assertEquals("LoginModuleControlFlag: sufficient", ents[2].getControlFlag().toString());
-		assertEquals("LoginModuleControlFlag: requisite", ents[3].getControlFlag().toString());
-		
-		m.clear();
-		m.put("AAAA", "true");
-		m.put("BBB", "false");
-		assertEquals(m, ents[0].getOptions());
-		m.clear();
-		m.put("debug2", "true");
-		assertEquals(m, ents[1].getOptions());
-		m.clear();
-		m.put("debug2", "false");
-		assertEquals(m, ents[2].getOptions());
-		m.clear();
-		m.put("ticketCache", System.getProperty("user.home")+ File.separator+"tickets");
-		m.put("useTicketCache", "true");
-		assertEquals(m, ents[3].getOptions());
-
-		} finally {
-		    TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
-		}
-	}
-	/**
-	 * test of the refresh method
-	 */
-	public void testRefresh() throws IOException {
-	    
-	    String oldp = System.getProperty(LOGIN_CONFIG);
-		try {
-			System.setProperty(LOGIN_CONFIG, 
-					new File(otherConfFile).getCanonicalPath());
-
-		DefaultConfiguration dc = new DefaultConfiguration();
-		MySecurityManager checker = new MySecurityManager(new AuthPermission(
-				"refreshLoginConfiguration"), true);
-		System.setSecurityManager(checker);
-		dc.refresh();
-		assertTrue(checker.checkAsserted);
-		checker.reset();
-		checker.enableAccess = false;
-		try {
-			dc.refresh();
-			fail("No expected SecurityException");
-		} catch (SecurityException ex) {
-		}
-		} finally {
-		    TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
-		}
-
-	}
-
-	private static void createConfFile() throws SecurityException, IOException {
-		
-		defaultConfFile = File.createTempFile(".java.login.config", null);
-
-		String newConfFile = "LoginNew {\n com.intel.security.auth.module.LoginModule1 optional"
-			+ " debug=\"true\" test=false;\n};";
-
-		byte[] b = newConfFile.getBytes();
-
-		OutputStream os = new FileOutputStream(defaultConfFile);
-		for (int j = 0; j < b.length; j++) {
-			os.write(b[j]);
-		}
-		os.flush();
-		os.close();
-	}
-
-	/**
-	 * Easy the SecurityManager class
-	 * 
-	 */
-
-	class MySecurityManager extends SecurityManager {
-
-		public boolean enableAccess;
-
-		public Permission checkTarget;
-
-		public boolean checkAsserted;
-
-		public MySecurityManager(Permission target, boolean enable) {
-			checkAsserted = false;
-			checkTarget = target;
-			enableAccess = enable;
-		}
-
-		public void checkPermission(Permission p) {
-			if (p instanceof AuthPermission && checkTarget.equals(p)) {
-				checkAsserted = true;
-				if (!enableAccess) {
-					throw new SecurityException();
-				}
-			}
-		}
-
-		public MySecurityManager reset() {
-			checkAsserted = false;
-			return this;
-		}
-	}
-	
-}
+/*
+ *  Copyright 2005 The Apache Software Foundation or its licensors, as applicable.
+ *
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+
+/**
+* @author Maxim V. Makarov
+* @version $Revision$
+*/
+
+package org.apache.harmony.auth.login;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.security.Permission;
+import java.security.Security;
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.security.auth.AuthPermission;
+import javax.security.auth.login.AppConfigurationEntry;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.auth.tests.support.TestUtils;
+import org.apache.harmony.auth.login.DefaultConfiguration;
+
+
+/**
+ * Tests default configuration implementation.  
+ */
+
+public class DefaultConfigurationTest extends TestCase {
+
+    private static final String LOGIN_CONFIG = "java.security.auth.login.config";
+    
+    static String outputPath = System.getProperty("RESOURCE_DIR", "test/common/unit");
+    
+    static String otherConfFile = outputPath + File.separator + "org" + 
+        File.separator + "apache" + File.separator + "harmony" + 
+        File.separator + "auth" + File.separator + "login" +
+        File.separator + "auth.conf";
+
+	private static File defaultConfFile;
+
+	static AppConfigurationEntry[] ents = null;
+
+	SecurityManager old = System.getSecurityManager();
+
+	String oldp1 = null;
+	String oldp2 = null;
+
+	public void setUp() throws Exception {
+		createConfFile();
+		
+		oldp1 = Security.getProperty("login.config.url.1");
+		oldp2 = Security.getProperty("login.config.url.2");
+	}
+
+	public void tearDown() throws Exception {
+		System.setSecurityManager(old);
+
+		TestUtils.setSystemProperty("login.config.url.1", oldp1);
+		TestUtils.setSystemProperty("login.config.url.2", oldp2);
+
+		defaultConfFile.delete();
+	}
+
+	public static void main(String[] args) {
+		junit.textui.TestRunner.run(DefaultConfigurationTest.class);
+	}
+	
+	/**
+	 * loading a config file specified on the security property  
+	 * using login.config.url.1
+	 * XXX: load a default config file
+	 */
+	public static void testLoadConfigFile() throws Exception {
+			DefaultConfiguration dc = null;
+			dc = new DefaultConfiguration();
+			assertNotNull(dc);
+			ents = dc.getAppConfigurationEntry("Login1");
+			assertNull(ents);
+			ents = dc.getAppConfigurationEntry(null);
+			assertNull(ents);
+			Security.setProperty("login.config.url.1", "file:"
+					+ defaultConfFile.getCanonicalPath());
+			Security.setProperty("login.config.url.2", "file:"
+					+ new File(otherConfFile).getCanonicalPath());
+
+			dc = new DefaultConfiguration();
+			ents = dc.getAppConfigurationEntry("LoginNew");
+			assertNotNull(ents);
+			assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
+			Map m = new HashMap();
+			m.put("debug", "true");
+			m.put("test", "false");
+			assertEquals(m, ents[0].getOptions());
+			assertEquals("LoginModuleControlFlag: optional", ents[0].getControlFlag().toString());
+
+			ents = dc.getAppConfigurationEntry("Login1");
+			assertNotNull(ents);
+			for (int i = 0; i < ents.length; i++) {
+				assertEquals("com.intel.security.auth.module.LoginModule1",
+						ents[i].getLoginModuleName());
+				m.clear();
+				m.put("debug1", "true");
+				m.put("test1", "false");
+				assertEquals(m, ents[i].getOptions());
+				assertEquals("LoginModuleControlFlag: required", ents[i]
+						.getControlFlag().toString());
+			}
+			
+			
+			
+	}
+	/**
+	 * loading a config file specified on the system property
+	 * using -Djava.security.auth.login.config    
+	 */
+	public void testLoadConfigFile_1() throws IOException {
+		
+	    String oldp = System.getProperty(LOGIN_CONFIG);	
+		try {
+		System.setProperty(LOGIN_CONFIG, 
+				new File(otherConfFile).getCanonicalPath());
+		DefaultConfiguration dc = new DefaultConfiguration();
+		assertNotNull(dc);
+		
+		ents = dc.getAppConfigurationEntry("Login2");
+		assertNotNull(ents);
+		ents = dc.getAppConfigurationEntry("other");
+		assertNotNull(ents);
+		ents = dc.getAppConfigurationEntry("Login1");
+		assertNotNull(ents);
+		Map m = new HashMap();
+		for (int i = 0; i < ents.length; i++) {
+			assertEquals("com.intel.security.auth.module.LoginModule1",
+					ents[i].getLoginModuleName());
+			m.clear();
+			m.put("debug1", "true");
+			m.put("test1", "false");
+			assertEquals(m, ents[i].getOptions());
+			assertEquals("LoginModuleControlFlag: required", ents[i]
+					.getControlFlag().toString());
+		}
+		
+		ents = dc.getAppConfigurationEntry("Login7");
+		assertNotNull(ents);
+
+		
+		assertEquals("com.intel.security.auth.module.LoginModule1", ents[0].getLoginModuleName());
+		assertEquals("com.intel.security.auth.module.LoginModule2", ents[1].getLoginModuleName());
+		assertEquals("com.intel.security.auth.module.LoginModule3", ents[2].getLoginModuleName());
+		assertEquals("com.intel.security.auth.module.LoginModule4",  ents[3].getLoginModuleName());
+		
+		assertEquals("LoginModuleControlFlag: required", ents[0].getControlFlag().toString());
+		assertEquals("LoginModuleControlFlag: optional", ents[1].getControlFlag().toString());
+		assertEquals("LoginModuleControlFlag: sufficient", ents[2].getControlFlag().toString());
+		assertEquals("LoginModuleControlFlag: requisite", ents[3].getControlFlag().toString());
+		
+		m.clear();
+		m.put("AAAA", "true");
+		m.put("BBB", "false");
+		assertEquals(m, ents[0].getOptions());
+		m.clear();
+		m.put("debug2", "true");
+		assertEquals(m, ents[1].getOptions());
+		m.clear();
+		m.put("debug2", "false");
+		assertEquals(m, ents[2].getOptions());
+		m.clear();
+		m.put("ticketCache", System.getProperty("user.home")+ File.separator+"tickets");
+		m.put("useTicketCache", "true");
+		assertEquals(m, ents[3].getOptions());
+
+		} finally {
+		    TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
+		}
+	}
+	/**
+	 * test of the refresh method
+	 */
+	public void testRefresh() throws IOException {
+	    
+	    String oldp = System.getProperty(LOGIN_CONFIG);
+		try {
+			System.setProperty(LOGIN_CONFIG, 
+					new File(otherConfFile).getCanonicalPath());
+
+		DefaultConfiguration dc = new DefaultConfiguration();
+		MySecurityManager checker = new MySecurityManager(new AuthPermission(
+				"refreshLoginConfiguration"), true);
+		System.setSecurityManager(checker);
+		dc.refresh();
+		assertTrue(checker.checkAsserted);
+		checker.reset();
+		checker.enableAccess = false;
+		try {
+			dc.refresh();
+			fail("No expected SecurityException");
+		} catch (SecurityException ex) {
+		}
+		} finally {
+		    TestUtils.setSystemProperty(LOGIN_CONFIG, oldp);
+		}
+
+	}
+
+	private static void createConfFile() throws SecurityException, IOException {
+		
+		defaultConfFile = File.createTempFile(".java.login.config", null);
+
+		String newConfFile = "LoginNew {\n com.intel.security.auth.module.LoginModule1 optional"
+			+ " debug=\"true\" test=false;\n};";
+
+		byte[] b = newConfFile.getBytes();
+
+		OutputStream os = new FileOutputStream(defaultConfFile);
+		for (int j = 0; j < b.length; j++) {
+			os.write(b[j]);
+		}
+		os.flush();
+		os.close();
+	}
+
+	/**
+	 * Easy the SecurityManager class
+	 * 
+	 */
+
+	class MySecurityManager extends SecurityManager {
+
+		public boolean enableAccess;
+
+		public Permission checkTarget;
+
+		public boolean checkAsserted;
+
+		public MySecurityManager(Permission target, boolean enable) {
+			checkAsserted = false;
+			checkTarget = target;
+			enableAccess = enable;
+		}
+
+		public void checkPermission(Permission p) {
+			if (p instanceof AuthPermission && checkTarget.equals(p)) {
+				checkAsserted = true;
+				if (!enableAccess) {
+					throw new SecurityException();
+				}
+			}
+		}
+
+		public MySecurityManager reset() {
+			checkAsserted = false;
+			return this;
+		}
+	}
+	
+}

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/DefaultConfigurationTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/login/auth.conf
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/apache/harmony/auth/tests/javax/security/auth/login/CredentialExpiredExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/ChannelBindingTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSExceptionTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSManagerTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/GSSNameTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/MessagePropTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/org/ietf/jgss/OidTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java?view=diff&rev=446480&r1=446479&r2=446480
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java Thu Sep 14 19:43:48 2006
@@ -1,44 +1,44 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *     http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package tests.api.javax.security.auth.x500;
-
-import javax.security.auth.x500.X500Principal;
-
-public class X500PrincipalTest extends junit.framework.TestCase {
-
-	/**
-	 * @tests javax.security.auth.x500.X500Principal#X500Principal(java.lang.String)
-	 */
-	public void test_ConstructorLjava_lang_String() {
-		X500Principal principal = new X500Principal(
-				"CN=Hermione Granger, O=Apache Software Foundation, OU=Harmony, L=Hogwarts, ST=Hants, C=GB");
-		String name = principal.getName();
-		String expectedOuput = "CN=Hermione Granger,O=Apache Software Foundation,OU=Harmony,L=Hogwarts,ST=Hants,C=GB";
-		assertEquals("Output order precedence problem", expectedOuput, name);
-	}
-
-	/**
-	 * @tests javax.security.auth.x500.X500Principal#getName(java.lang.String)
-	 */
-	public void test_getNameLjava_lang_String() {
-		X500Principal principal = new X500Principal(
-				"CN=Dumbledore, OU=Administration, O=Hogwarts School, C=GB");
-		String canonical = principal.getName(X500Principal.CANONICAL);
-		String expected = "cn=dumbledore,ou=administration,o=hogwarts school,c=gb";
-		assertEquals("CANONICAL output differs from expected result", expected,
-				canonical);
-	}
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package tests.api.javax.security.auth.x500;
+
+import javax.security.auth.x500.X500Principal;
+
+public class X500PrincipalTest extends junit.framework.TestCase {
+
+	/**
+	 * @tests javax.security.auth.x500.X500Principal#X500Principal(java.lang.String)
+	 */
+	public void test_ConstructorLjava_lang_String() {
+		X500Principal principal = new X500Principal(
+				"CN=Hermione Granger, O=Apache Software Foundation, OU=Harmony, L=Hogwarts, ST=Hants, C=GB");
+		String name = principal.getName();
+		String expectedOuput = "CN=Hermione Granger,O=Apache Software Foundation,OU=Harmony,L=Hogwarts,ST=Hants,C=GB";
+		assertEquals("Output order precedence problem", expectedOuput, name);
+	}
+
+	/**
+	 * @tests javax.security.auth.x500.X500Principal#getName(java.lang.String)
+	 */
+	public void test_getNameLjava_lang_String() {
+		X500Principal principal = new X500Principal(
+				"CN=Dumbledore, OU=Administration, O=Hogwarts School, C=GB");
+		String canonical = principal.getName(X500Principal.CANONICAL);
+		String expected = "cn=dumbledore,ou=administration,o=hogwarts school,c=gb";
+		assertEquals("CANONICAL output differs from expected result", expected,
+				canonical);
+	}
 }

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/common/tests/api/javax/security/auth/x500/X500PrincipalTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/linux/org/apache/harmony/auth/module/UnixLoginModuleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/harmony/enhanced/classlib/trunk/modules/auth/src/test/java/windows/org/apache/harmony/auth/module/NTLoginModuleTest.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message