hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From z..@apache.org
Subject [10/18] hadoop git commit: HDFS-7563. NFS gateway parseStaticMap NumberFormatException. Contributed by Yongjun Zhang
Date Mon, 05 Jan 2015 22:50:02 GMT
HDFS-7563. NFS gateway parseStaticMap NumberFormatException. Contributed by Yongjun Zhang


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/de378cb5
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/de378cb5
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/de378cb5

Branch: refs/heads/HDFS-EC
Commit: de378cb59f00234839009b66eebc5b3b0040c30f
Parents: 1e28fa6
Author: Brandon Li <brandonli@apache.org>
Authored: Fri Jan 2 10:49:50 2015 -0800
Committer: Zhe Zhang <zhz@apache.org>
Committed: Mon Jan 5 14:48:37 2015 -0800

----------------------------------------------------------------------
 .../java/org/apache/hadoop/security/ShellBasedIdMapping.java | 4 ++--
 .../org/apache/hadoop/security/TestShellBasedIdMapping.java  | 8 +++++++-
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt                  | 3 +++
 3 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/de378cb5/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
index e995cb6..428e835 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/ShellBasedIdMapping.java
@@ -578,8 +578,8 @@ public class ShellBasedIdMapping implements IdMappingServiceProvider {
         // We know the line is fine to parse without error checking like this
         // since it matched the regex above.
         String firstComponent = lineMatcher.group(1);
-        int remoteId = Integer.parseInt(lineMatcher.group(2));
-        int localId = Integer.parseInt(lineMatcher.group(3));
+        int remoteId = parseId(lineMatcher.group(2));
+        int localId = parseId(lineMatcher.group(3));
         if (firstComponent.equals("uid")) {
           uidMapping.put(localId, remoteId);
         } else {

http://git-wip-us.apache.org/repos/asf/hadoop/blob/de378cb5/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedIdMapping.java
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedIdMapping.java
b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedIdMapping.java
index ec8ac1d..857c706 100644
--- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedIdMapping.java
+++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/security/TestShellBasedIdMapping.java
@@ -55,7 +55,9 @@ public class TestShellBasedIdMapping {
         "uid 13 302\n" +
         "gid\t11\t201\n" + // Tabs instead of spaces.
         "\n" + // Entirely empty line.
-        "gid 12 202";
+        "gid 12 202\n" +
+        "uid 4294967294 123\n" +
+        "gid 4294967295 321";
     OutputStream out = new FileOutputStream(tempStaticMapFile);
     out.write(staticMapFileContents.getBytes());
     out.close();
@@ -71,6 +73,10 @@ public class TestShellBasedIdMapping {
     assertEquals(10000, (int)parsedMap.uidMapping.get(10001));
     // Ensure pass-through of unmapped IDs works.
     assertEquals(1000, (int)parsedMap.uidMapping.get(1000));
+    
+    assertEquals(-2, (int)parsedMap.uidMapping.get(123));
+    assertEquals(-1, (int)parsedMap.gidMapping.get(321));
+    
   }
   
   @Test

http://git-wip-us.apache.org/repos/asf/hadoop/blob/de378cb5/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 8525402..8117383 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -636,6 +636,9 @@ Release 2.7.0 - UNRELEASED
     HDFS-7456. De-duplicate AclFeature instances with same AclEntries do reduce
     memory footprint of NameNode (vinayakumarb)
 
+    HDFS-7563. NFS gateway parseStaticMap NumberFormatException 
+    (Yongjun Zhang via brandonli)
+
 Release 2.6.1 - UNRELEASED
 
   INCOMPATIBLE CHANGES


Mime
View raw message