Uploaded image for project: 'Sentry (Retired)'
  1. Sentry (Retired)
  2. SENTRY-1312

HDFS_PERMISSION_DEFAULT does not parse correctly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.8.0
    • 1.8.0
    • Hdfs Plugin
    • None

    Description

      HDFS_PERMISSION_DEFAULT set to 771, but it is 1403(r------wt) in fact.

      permission = FsPermission.createImmutable(
                (short) newConf.getLong(SentryAuthorizationConstants.HDFS_PERMISSION_KEY,
                    SentryAuthorizationConstants.HDFS_PERMISSION_DEFAULT)
      

      FsPermission.createImmutable parse short by bit.

        public void fromShort(short n) {
          FsAction[] v = FSACTION_VALUES;
          set(v[(n >>> 6) & 7], v[(n >>> 3) & 7], v[n & 7], (((n >>> 9) & 1) == 1) );
        }
        // 771 => 0011 0000 0011 => 001 100 000 011 => 1403 
      

      Attachments

        1. SENTRY-1312-v2.patch
          2 kB
          Zephyr Guo
        2. SENTRY-1312-v1.patch
          2 kB
          Zephyr Guo

        Issue Links

          Activity

            People

              gzh1992n Zephyr Guo
              gzh1992n Zephyr Guo
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: