Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-11351

HdfsResource does not account for sticky bit

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.1.0
    • 2.1.0
    • contrib
    • Linux

    Description

      Specifying a mode of 01777 will result in an exception like:

      Exception in thread "main" java.lang.IllegalArgumentException: 1777
      at org.apache.hadoop.fs.permission.PermissionParser.<init>(PermissionParser.java:60)
      at org.apache.hadoop.fs.permission.UmaskParser.<init>(UmaskParser.java:42)
      at org.apache.hadoop.fs.permission.FsPermission.<init>(FsPermission.java:106)
      at org.apache.ambari.fast_hdfs_resource.Resource.setMode(Resource.java:217)
      at org.apache.ambari.fast_hdfs_resource.Runner.main(Runner.java:78)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)

      In fast_hdfs_resource, setMode is used to set the permissions on the Resource object using the specified mode. Passing in the mode as a string for FsPermission is what results in the problem because the constructor that is used with string as argument uses the UmaskParser. Umask values are slightly different from standard modes as they cannot specify t (sticky bit) or X.

      Passing in the argument as a short is probably what is needed here to enable using the FsPermission code that accounts for the sticky bit.

      Attachments

        Issue Links

        Activity

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

          People

            antndk Shantanu Mundkur
            antndk Shantanu Mundkur
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment