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

Logging the username when deny the setOwner operation

VotersStop watchingWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.7.2
    • 2.8.0, 2.7.4, 3.0.0-alpha2
    • namenode
    • 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 Radhakrishnan
        3. HDFS-10455-003.patch
          3 kB
          Rakesh Radhakrishnan
        4. HDFS-10455-branch-2.000.patch
          2 kB
          Rakesh Radhakrishnan

        Issue Links

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            rakeshr Rakesh Radhakrishnan
            tianyin Tianyin Xu
            Votes:
            0 Vote for this issue
            Watchers:
            7 Stop watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment