Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5575

PutHDFS does not use fs.permissions.umask-mode from hdfs-site.xml

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.0, 1.7.1
    • Fix Version/s: 1.9.0
    • Component/s: Extensions
    • Labels:
      None

      Description

      PutHDFS does not use the value of "fs.permissions.umask-mode" in hdfs-site.xml.  If the user does not provide a umask in the "Permissions umask" property, PutHDFS will use FsPermissions.DEFAULT_UMASK and set that in the config, which will overwrite the value from hdfs-site.xml.

      The code below shows that without the "Permissions umask" property being set, it will force a umask of '18', the value of FsPermission.DEFAULT_MASK.

      Instead, PutHDFS should first check the Configuration instance to see if "fs.permissions.umask-mode" is set and use that value. FsPermission.DEFAULT_MASK should be used only in the case when "fs.permissions.umask-mode" is not set.

          protected void preProcessConfiguration(final Configuration config, final ProcessContext context) {
              // Set umask once, to avoid thread safety issues doing it in onTrigger
              final PropertyValue umaskProp = context.getProperty(UMASK);
              final short dfsUmask;
              if (umaskProp.isSet()) {
                  dfsUmask = Short.parseShort(umaskProp.getValue(), 8);
              } else {
                  dfsUmask = FsPermission.DEFAULT_UMASK;
              }
      
              FsPermission.setUMask(config, new FsPermission(dfsUmask));
          }
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                kei_miyauchi Kei Miyauchi
                Reporter:
                jtstorck Jeff Storck
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 1h 50m
                  1h 50m