Просмотр исходного кода

commit 781d5754c405b63c3228167898454274980da5a0
Author: Jakob Homan <jhoman@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)
+


git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-0.20-security-patches@1077736 13f79535-47bb-0310-9956-ffa450edef68

Owen O'Malley 14 лет назад
Родитель
Сommit
8b7264d06d

+ 6 - 3
src/hdfs/org/apache/hadoop/hdfs/server/datanode/SecureDataNodeStarter.java

@@ -91,12 +91,15 @@ public class SecureDataNodeStarter implements Daemon {
     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);
   }