You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by om...@apache.org on 2011/03/04 05:49:55 UTC

svn commit: r1077736 - /hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java

Author: omalley
Date: Fri Mar  4 04:49:55 2011
New Revision: 1077736

URL: http://svn.apache.org/viewvc?rev=1077736&view=rev
Log:
commit 781d5754c405b63c3228167898454274980da5a0
Author: Jakob Homan <jh...@yahoo-inc.com>
Date:   Thu Oct 7 14:18:44 2010 -0700

     Bail rather than just warn when starting a secure datanode
    with non-privileged ports.
    
    +++ b/YAHOO-CHANGES.txt
    +     Secure datanodes will shut down rather than warn,
    +    if started on non-privileged ports. (jghoman)
    +

Modified:
    hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java

Modified: hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java?rev=1077736&r1=1077735&r2=1077736&view=diff
==============================================================================
--- hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java (original)
+++ hadoop/common/branches/branch-0.20-security-patches/src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java Fri Mar  4 04:49:55 2011
@@ -91,12 +91,15 @@ public class SecureDataNodeStarter imple
     if(listener.getPort() != infoSocAddr.getPort())
       throw new RuntimeException("Unable to bind on specified info port in secure " +
           "context. Needed " + socAddr.getPort() + ", got " + ss.getLocalPort());
+   
+    if(ss.getLocalPort() >= 1023 || listener.getPort() >= 1023)
+      throw new RuntimeException("Cannot start secure datanode on non-privileged "
+         +" ports. (streaming port = " + ss + " ) (http listener port = " + 
+         listener.getConnection() + "). Exiting.");
+ 
     System.err.println("Successfully obtained privileged resources (streaming port = "
         + ss + " ) (http listener port = " + listener.getConnection() +")");
     
-    if(ss.getLocalPort() >= 1023 || listener.getPort() >= 1023)
-      System.err.println("Warning: Starting secure datanode with unprivileged ports");
-    
     resources = new SecureResources(ss, listener);
   }