hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bor...@apache.org
Subject svn commit: r948528 - in /hadoop/common/trunk: ./ src/java/org/apache/hadoop/security/ src/java/org/apache/hadoop/security/authorize/ src/java/org/apache/hadoop/util/ src/test/core/org/apache/hadoop/fs/
Date Wed, 26 May 2010 18:35:50 GMT
Author: boryas
Date: Wed May 26 18:35:50 2010
New Revision: 948528

URL: http://svn.apache.org/viewvc?rev=948528&view=rev
Log:
HADOOP-6644. util.Shell getGROUPS_FOR_USER_COMMAND method name - should use common naming
convention

Modified:
    hadoop/common/trunk/CHANGES.txt
    hadoop/common/trunk/src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java
    hadoop/common/trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java
    hadoop/common/trunk/src/java/org/apache/hadoop/util/Shell.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/FileContextPermissionBase.java
    hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java

Modified: hadoop/common/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/CHANGES.txt?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/CHANGES.txt (original)
+++ hadoop/common/trunk/CHANGES.txt Wed May 26 18:35:50 2010
@@ -3,6 +3,9 @@ Hadoop Change Log
 Trunk (unreleased changes)
 
   IMPROVEMENTS
+    HADOOP-6644. util.Shell getGROUPS_FOR_USER_COMMAND method name 
+    - should use common naming convention (boryas)
+
     HADOOP-6778. add isRunning() method to 
     AbstractDelegationTokenSecretManager (for HDFS-1044) (boryas)
 

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/security/ShellBasedUnixGroupsMapping.java
Wed May 26 18:35:50 2010
@@ -60,7 +60,7 @@ public class ShellBasedUnixGroupsMapping
   private static List<String> getUnixGroups(final String user) throws IOException {
     String result = "";
     try {
-      result = Shell.execCommand(Shell.getGROUPS_FOR_USER_COMMAND(user));
+      result = Shell.execCommand(Shell.getGroupsForUserCommand(user));
     } catch (ExitCodeException e) {
       // if we didn't get the group - just return empty list;
       LOG.warn("got exception trying to get groups for user " + user, e);

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java
(original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/security/authorize/ServiceAuthorizationManager.java
Wed May 26 18:35:50 2010
@@ -48,7 +48,7 @@ public class ServiceAuthorizationManager
   public static final String SERVICE_AUTHORIZATION_CONFIG = 
     "hadoop.security.authorization";
   
-  public static final Log auditLOG =
+  public static final Log AUDITLOG =
     LogFactory.getLog("SecurityLogger."+ServiceAuthorizationManager.class.getName());
 
   private static final String AUTHZ_SUCCESSFULL_FOR = "Authorization successfull for ";
@@ -83,12 +83,12 @@ public class ServiceAuthorizationManager
     }
     if((clientPrincipal != null && !clientPrincipal.equals(user.getUserName())) ||

         !acl.isUserAllowed(user)) {
-      auditLOG.warn(AUTHZ_FAILED_FOR + user + " for protocol="+protocol);
+      AUDITLOG.warn(AUTHZ_FAILED_FOR + user + " for protocol="+protocol);
       throw new AuthorizationException("User " + user + 
           " is not authorized for protocol " + 
           protocol);
     }
-    auditLOG.info(AUTHZ_SUCCESSFULL_FOR + user + " for protocol="+protocol);
+    AUDITLOG.info(AUTHZ_SUCCESSFULL_FOR + user + " for protocol="+protocol);
   }
 
   public static synchronized void refresh(Configuration conf,

Modified: hadoop/common/trunk/src/java/org/apache/hadoop/util/Shell.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/java/org/apache/hadoop/util/Shell.java?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/src/java/org/apache/hadoop/util/Shell.java (original)
+++ hadoop/common/trunk/src/java/org/apache/hadoop/util/Shell.java Wed May 26 18:35:50 2010
@@ -44,11 +44,11 @@ abstract public class Shell {
   /** a Unix command to get the current user's name */
   public final static String USER_NAME_COMMAND = "whoami";
   /** a Unix command to get the current user's groups list */
-  public static String[] getGROUPS_COMMAND() {
+  public static String[] getGroupsCommand() {
     return new String[]{"bash", "-c", "groups"};
   }
   /** a Unix command to get a given user's groups list */
-  public static String[] getGROUPS_FOR_USER_COMMAND(final String user) {
+  public static String[] getGroupsForUserCommand(final String user) {
     //'groups username' command return is non-consistent across different unixes
     return new String [] {"bash", "-c", "id -Gn " + user};
   }

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/FileContextPermissionBase.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/FileContextPermissionBase.java?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/FileContextPermissionBase.java
(original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/FileContextPermissionBase.java
Wed May 26 18:35:50 2010
@@ -165,7 +165,7 @@ public abstract class FileContextPermiss
 
   static List<String> getGroups() throws IOException {
     List<String> a = new ArrayList<String>();
-    String s = Shell.execCommand(Shell.getGROUPS_COMMAND());
+    String s = Shell.execCommand(Shell.getGroupsCommand());
     for(StringTokenizer t = new StringTokenizer(s); t.hasMoreTokens(); ) {
       a.add(t.nextToken());
     }

Modified: hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
URL: http://svn.apache.org/viewvc/hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java?rev=948528&r1=948527&r2=948528&view=diff
==============================================================================
--- hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
(original)
+++ hadoop/common/trunk/src/test/core/org/apache/hadoop/fs/TestLocalFileSystemPermission.java
Wed May 26 18:35:50 2010
@@ -144,7 +144,7 @@ public class TestLocalFileSystemPermissi
 
   static List<String> getGroups() throws IOException {
     List<String> a = new ArrayList<String>();
-    String s = Shell.execCommand(Shell.getGROUPS_COMMAND());
+    String s = Shell.execCommand(Shell.getGroupsCommand());
     for(StringTokenizer t = new StringTokenizer(s); t.hasMoreTokens(); ) {
       a.add(t.nextToken());
     }



Mime
View raw message