hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s..@apache.org
Subject svn commit: r1065959 - in /hadoop/common/trunk: CHANGES.txt src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java src/java/org/apache/hadoop/security/SaslRpcServer.java
Date Tue, 01 Feb 2011 09:38:31 GMT
Author: shv
Date: Tue Feb  1 09:38:31 2011
New Revision: 1065959

URL: http://svn.apache.org/viewvc?rev=1065959&view=rev
Log:
HADOOP-6642. Fix javac,  javadoc, findbugs warnings related to security work. Contributed
by Chris Douglas, Po Cheung.

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java
    hadoop/common/trunk/src/java/org/apache/hadoop/security/SaslRpcServer.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=1065959&r1=1065958&r2=1065959&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Tue Feb  1 09:38:31 2011
@@ -471,6 +471,9 @@ Release 0.22.0 - Unreleased
     HADOOP-7126. Fix file permission setting for RawLocalFileSystem on Windows.
     (Po Cheung via shv)
 
+    HADOOP-6642. Fix javac, javadoc, findbugs warnings related to security work. 
+    (Chris Douglas, Po Cheung via shv)
+
 Release 0.21.1 - Unreleased
 
   IMPROVEMENTS

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java?rev=1065959&r1=1065958&r2=1065959&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/security/Krb5AndCertsSslSocketConnector.java
Tue Feb  1 09:38:31 2011
@@ -20,6 +20,8 @@ import java.io.IOException;
 import java.net.InetAddress;
 import java.net.ServerSocket;
 import java.security.Principal;
+import java.util.Collections;
+import java.util.List;
 import java.util.Random;
 
 import javax.net.ssl.SSLContext;
@@ -52,10 +54,11 @@ import org.mortbay.jetty.security.SslSoc
  * running with Kerberos support.
  */
 public class Krb5AndCertsSslSocketConnector extends SslSocketConnector {
-  public static final String[] KRB5_CIPHER_SUITES = 
-    new String [] {"TLS_KRB5_WITH_3DES_EDE_CBC_SHA"};
+  public static final List<String> KRB5_CIPHER_SUITES = 
+    Collections.unmodifiableList(Collections.singletonList(
+          "TLS_KRB5_WITH_3DES_EDE_CBC_SHA"));
   static {
-    System.setProperty("https.cipherSuites", KRB5_CIPHER_SUITES[0]);
+    System.setProperty("https.cipherSuites", KRB5_CIPHER_SUITES.get(0));
   }
   
   private static final Log LOG = LogFactory
@@ -136,11 +139,12 @@ public class Krb5AndCertsSslSocketConnec
       String [] combined;
       if(useCerts) { // combine the cipher suites
         String[] certs = ss.getEnabledCipherSuites();
-        combined = new String[certs.length + KRB5_CIPHER_SUITES.length];
+        combined = new String[certs.length + KRB5_CIPHER_SUITES.size()];
         System.arraycopy(certs, 0, combined, 0, certs.length);
-        System.arraycopy(KRB5_CIPHER_SUITES, 0, combined, certs.length, KRB5_CIPHER_SUITES.length);
+        System.arraycopy(KRB5_CIPHER_SUITES.toArray(new String[0]), 0, combined,
+              certs.length, KRB5_CIPHER_SUITES.size());
       } else { // Just enable Kerberos auth
-        combined = KRB5_CIPHER_SUITES;
+        combined = KRB5_CIPHER_SUITES.toArray(new String[0]);
       }
       
       ss.setEnabledCipherSuites(combined);

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/security/SaslRpcServer.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/security/SaslRpcServer.java?rev=1065959&r1=1065958&r2=1065959&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/security/SaslRpcServer.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/security/SaslRpcServer.java Tue Feb  1
09:38:31 2011
@@ -238,8 +238,8 @@ public class SaslRpcServer {
         }
         if (ac.isAuthorized()) {
           if (LOG.isDebugEnabled()) {
-            String username = getIdentifier(authzid, secretManager).getUser()
-            .getUserName().toString();
+            String username =
+              getIdentifier(authzid, secretManager).getUser().getUserName();
             LOG.debug("SASL server DIGEST-MD5 callback: setting "
                 + "canonicalized client ID: " + username);
           }



Mime
View raw message