Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6456

NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.6.0
    • Component/s: nfs
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      Pass invalid entry in dfs.nfs.exports.allowed.hosts. Use - as separator between hostname and access permission

      <property><name>dfs.nfs.exports.allowed.hosts</name><value>host1-rw</value></property>
      

      This misconfiguration is not detected by NFS server. It does not print any error message. The host passed in this configuration is also not able to mount nfs. In conclusion, no node can mount the nfs with this value. A format check is required for this property. If the value of this property does not follow the format, an error should be thrown.

      1. HDFS-6456.patch
        3 kB
        Abhiraj Butala

        Issue Links

          Activity

          Hide
          Brandon Li added a comment - - edited

          We should log the error to indicate there is invalid export table entry. Real user can do "showmount" command to find the valid export.

          Even with no valid export, shutdown may not be desirable given we may want to introduce a new feature in the future to refresh export table without restarting NFS gateway (HDFS-6459).

          Show
          Brandon Li added a comment - - edited We should log the error to indicate there is invalid export table entry. Real user can do "showmount" command to find the valid export. Even with no valid export, shutdown may not be desirable given we may want to introduce a new feature in the future to refresh export table without restarting NFS gateway ( HDFS-6459 ).
          Hide
          Abhiraj Butala added a comment -

          I am not sure if this is a valid issue. 'host1-rw' itself is treated as the hostname. Since the hostname and the permissions are not separated by white spaces, it is treated as if permissions are not provided for this hostname. By default, read-only permission is assumed in this case.

          Following are relevant comments from NfsExports.java:

          /**
             * Loading a matcher from a string. The default access privilege is read-only.
             * The string contains 1 or 2 parts, separated by whitespace characters, where
             * the first part specifies the client hosts, and the second part (if
             * existent) specifies the access privilege of the client hosts. I.e.,
             *
             * "client-hosts [access-privilege]"
             */
          

          The fix for HDFS-6455 shall log an error for invalid exports, like invalid separators.

          Show
          Abhiraj Butala added a comment - I am not sure if this is a valid issue. 'host1-rw' itself is treated as the hostname. Since the hostname and the permissions are not separated by white spaces, it is treated as if permissions are not provided for this hostname. By default, read-only permission is assumed in this case. Following are relevant comments from NfsExports.java: /** * Loading a matcher from a string. The default access privilege is read-only. * The string contains 1 or 2 parts, separated by whitespace characters, where * the first part specifies the client hosts, and the second part ( if * existent) specifies the access privilege of the client hosts. I.e., * * "client-hosts [access-privilege]" */ The fix for HDFS-6455 shall log an error for invalid exports, like invalid separators.
          Hide
          Yesha Vora added a comment -

          NFS server also fail to parse valid host name string in dfs.nfs.exports.allowed.hosts property.

          <property><name>dfs.nfs.exports.allowed.hosts</name><value>101.101.101.01#rw</value></property>
          

          Here, # is used as separator. Hostname must not have # in it. NFS server should be able to validate host name correctly. It needs to parse for "<Valid hostname> <ro/rw>"

          Show
          Yesha Vora added a comment - NFS server also fail to parse valid host name string in dfs.nfs.exports.allowed.hosts property. <property><name>dfs.nfs.exports.allowed.hosts</name><value>101.101.101.01#rw</value></property> Here, # is used as separator. Hostname must not have # in it. NFS server should be able to validate host name correctly. It needs to parse for "<Valid hostname> <ro/rw>"
          Hide
          Brandon Li added a comment -

          Both comments from Abhiraj Butala and Yesha Vora make sense.

          So, basically, the actually problem is "NFS should print error when there is no valid export" regardless the cause (e.g., invalid hostname string, empty value, ...).

          Show
          Brandon Li added a comment - Both comments from Abhiraj Butala and Yesha Vora make sense. So, basically, the actually problem is "NFS should print error when there is no valid export" regardless the cause (e.g., invalid hostname string, empty value, ...).
          Hide
          Abhiraj Butala added a comment -

          Ok got it. Thanks for the feedback Brandon Li and Yesha Vora, I shall work on the fix shortly.

          Show
          Abhiraj Butala added a comment - Ok got it. Thanks for the feedback Brandon Li and Yesha Vora , I shall work on the fix shortly.
          Hide
          Hadoop QA added a comment -

          +1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12655441/HDFS-6456.patch
          against trunk revision .

          +1 @author. The patch does not contain any @author tags.

          +1 tests included. The patch appears to include 1 new or modified test files.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 javadoc. There were no new javadoc warning messages.

          +1 eclipse:eclipse. The patch built with eclipse:eclipse.

          +1 findbugs. The patch does not introduce any new Findbugs (version 2.0.3) warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          +1 core tests. The patch passed unit tests in hadoop-common-project/hadoop-nfs.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/7332//testReport/
          Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/7332//console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12655441/HDFS-6456.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . There were no new javadoc warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any new Findbugs (version 2.0.3) warnings. +1 release audit . The applied patch does not increase the total number of release audit warnings. +1 core tests . The patch passed unit tests in hadoop-common-project/hadoop-nfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/7332//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/7332//console This message is automatically generated.
          Hide
          Brandon Li added a comment -

          +1. Patch looks good to me.

          Show
          Brandon Li added a comment - +1. Patch looks good to me.
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-trunk-Commit #5886 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5886/)
          HDFS-6456. NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java
          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #5886 (See https://builds.apache.org/job/Hadoop-trunk-Commit/5886/ ) HDFS-6456 . NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840 ) /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-Yarn-trunk #614 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/614/)
          HDFS-6456. NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java
          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk #614 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/614/ ) HDFS-6456 . NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840 ) /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-Mapreduce-trunk #1833 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1833/)
          HDFS-6456. NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java
          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #1833 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1833/ ) HDFS-6456 . NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840 ) /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Hide
          Hudson added a comment -

          FAILURE: Integrated in Hadoop-Hdfs-trunk #1806 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1806/)
          HDFS-6456. NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840)

          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java
          • /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java
          • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
          Show
          Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk #1806 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1806/ ) HDFS-6456 . NFS should throw error for invalid entry in dfs.nfs.exports.allowed.hosts. Contributed by Abhiraj Butala (brandonli: http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1610840 ) /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/main/java/org/apache/hadoop/nfs/NfsExports.java /hadoop/common/trunk/hadoop-common-project/hadoop-nfs/src/test/java/org/apache/hadoop/nfs/TestNfsExports.java /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

            People

            • Assignee:
              Abhiraj Butala
              Reporter:
              Yesha Vora
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development