hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bra...@apache.org
Subject hadoop git commit: HDFS-10455. Logging the username when deny the setOwner operation. Contributed by Rakesh R.
Date Sun, 30 Oct 2016 19:00:29 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk aa3cab1eb -> e9c7a9708


HDFS-10455. Logging the username when deny the setOwner operation. Contributed by Rakesh R.


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

Branch: refs/heads/trunk
Commit: e9c7a97089dd1234a7f1782f79b1b0b190b98f39
Parents: aa3cab1
Author: Brahma Reddy Battula <brahma@apache.org>
Authored: Mon Oct 31 00:22:51 2016 +0530
Committer: Brahma Reddy Battula <brahma@apache.org>
Committed: Mon Oct 31 00:22:51 2016 +0530

----------------------------------------------------------------------
 .../apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java   |  6 ++++--
 .../java/org/apache/hadoop/security/TestPermission.java   | 10 +++++-----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/e9c7a970/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java
index 417ce01..a3e7f9f 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSDirAttrOp.java
@@ -84,10 +84,12 @@ public class FSDirAttrOp {
       fsd.checkOwner(pc, iip);
       if (!pc.isSuperUser()) {
         if (username != null && !pc.getUser().equals(username)) {
-          throw new AccessControlException("Non-super user cannot change owner");
+          throw new AccessControlException("User " + username
+              + " is not a super user (non-super user cannot change owner).");
         }
         if (group != null && !pc.isMemberOfGroup(group)) {
-          throw new AccessControlException("User does not belong to " + group);
+          throw new AccessControlException(
+              "User " + username + " does not belong to " + group);
         }
       }
       unprotectedSetOwner(fsd, iip, username, group);

http://git-wip-us.apache.org/repos/asf/hadoop/blob/e9c7a970/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestPermission.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestPermission.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestPermission.java
index e505642..813ac5a 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestPermission.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/security/TestPermission.java
@@ -337,7 +337,7 @@ public class TestPermission {
       fail("Expect ACE when a non-super user tries to change a file to a " +
           "group where the user does not belong.");
     } catch (AccessControlException e) {
-      assertThat(e.getMessage(), startsWith("User does not belong to"));
+      assertThat(e.getMessage(), startsWith("User null does not belong to"));
     }
   }
 
@@ -371,8 +371,8 @@ public class TestPermission {
       userfs.setOwner(file, NOUSER, null);
       fail("Expect ACE when a non-super user tries to change owner");
     } catch (AccessControlException e) {
-      assertThat(e.getMessage(), startsWith(
-          "Non-super user cannot change owner"));
+      assertThat(e.getMessage(), startsWith("User " + NOUSER
+          + " is not a super user (non-super user cannot change owner)"));
     }
   }
 
@@ -397,8 +397,8 @@ public class TestPermission {
       fail("Expect ACE or FNFE when a non-super user tries to change owner " +
           "for a non-existent file");
     } catch (AccessControlException e) {
-      assertThat(e.getMessage(), startsWith(
-          "Non-super user cannot change owner"));
+      assertThat(e.getMessage(), startsWith("User " + NOUSER
+          + " is not a super user (non-super user cannot change owner)"));
     } catch (FileNotFoundException e) {
     }
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message