Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-10455

Logging the username when deny the setOwner operation

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.7.2
    • Fix Version/s: 2.8.0, 2.7.4, 3.0.0-alpha2
    • Component/s: namenode
    • Labels:
      None

      Description

      The attached patch appends the user name in the logging when the setOwner operation is denied due to insufficient permissions on this user (based on his/her name).

      The same practice is used in FSPermissionChecker such as checkOwner() and checkSuperuserPrivilege().

      FSDirAttrOp.java
             if (!pc.isSuperUser()) {
               if (username != null && !pc.getUser().equals(username)) {
      -          throw new AccessControlException("Non-super user cannot change owner");
      +          throw new AccessControlException("User " + pc.getUser()
      +              + " is not a super user (non-super user cannot change owner).");
               }
               if (group != null && !pc.containsGroup(group)) {
      -          throw new AccessControlException("User does not belong to " + group);
      +          throw new AccessControlException("User " + pc.getUser()
      +              + " does not belong to " + group);
               }
      
      

        Attachments

        1. HDFS-10455.000.patch
          1 kB
          Tianyin Xu
        2. HDFS-10455.002.patch
          2 kB
          Rakesh R
        3. HDFS-10455-003.patch
          3 kB
          Rakesh R
        4. HDFS-10455-branch-2.000.patch
          2 kB
          Rakesh R

          Issue Links

            Activity

              People

              • Assignee:
                rakeshr Rakesh R
                Reporter:
                tianyin Tianyin Xu
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: