directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1752418 - /directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java
Date Wed, 13 Jul 2016 13:06:34 GMT
Author: elecharny
Date: Wed Jul 13 13:06:34 2016
New Revision: 1752418

URL: http://svn.apache.org/viewvc?rev=1752418&view=rev
Log:
Applied patch for DIRKRB-595

Modified:
    directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java

Modified: directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java?rev=1752418&r1=1752417&r2=1752418&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java
(original)
+++ directory/apacheds/trunk/kerberos-codec/src/main/java/org/apache/directory/shared/kerberos/codec/principalName/actions/StoreNameString.java
Wed Jul 13 13:06:34 2016
@@ -46,6 +46,18 @@ public class StoreNameString extends Gra
     /** Speedup for logs */
     private static final boolean IS_DEBUG = LOG.isDebugEnabled();
 
+    /** A flag used to allow UTF-8 chars in the name. THanks Microsoft for, once again, blowing
a specification */
+    private static boolean ALLOW_UTF8_NAMES = false;
+
+    static 
+    {
+        String allowUTF8Names = System.getProperty( "sun.security.krb5.msinterop.kstring"
);
+
+        if ( "true".equalsIgnoreCase( Strings.trim( allowUTF8Names ) ) )
+        {
+            ALLOW_UTF8_NAMES = true;
+        }
+    }
 
     /**
      * Instantiates a new PrincipalNameInit action.
@@ -78,7 +90,7 @@ public class StoreNameString extends Gra
         BerValue value = tlv.getValue();
 
         // The PrincipalName must be pure ASCII witout any control character
-        if ( KerberosUtils.isKerberosString( value.getData() ) )
+        if ( ALLOW_UTF8_NAMES || KerberosUtils.isKerberosString( value.getData() ) )
         {
             String nameString = Strings.utf8ToString( value.getData() );
 



Mime
View raw message