Hadoop Common
  1. Hadoop Common
  2. HADOOP-4368

Superuser privileges required to do "df"

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.18.1
    • Fix Version/s: 0.21.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed
    • Release Note:
      New filesystem shell command -df reports capacity, space used and space free. Any user may execute this command without special privileges.

      Description

      super user privileges are required in DFS in order to get the file system statistics (FSNamesystem.java, getStats method). This means that when HDFS is mounted via fuse-dfs as a non-root user, "df" is going to return 16exabytes total and 0 free instead of the correct amount.

      As far as I can tell, there's no need to require super user privileges to see the file system size (and historically in Unix, this is not required).

      To fix this, simply comment out the privilege check in the getStats method.

      1. fuse_statfs_trunk.patch
        1 kB
        Brian Bockelman
      2. fuse_statfs.patch
        1 kB
        Brian Bockelman
      3. hadoop4368.fsstatus.patch
        7 kB
        Craig Macdonald
      4. hadoop4368.fsstatus.v2.patch
        9 kB
        Craig Macdonald
      5. hadoop4368.fsstatus.v3.patch
        16 kB
        Craig Macdonald
      6. hadoop4368.fsstatus.v4.patch
        19 kB
        Craig Macdonald
      7. hadoop4368.fsstatus.v5.patch
        19 kB
        Craig Macdonald
      8. hadoop4368.fsstatus.v6.patch
        20 kB
        Craig Macdonald
      9. hadoop4368.fsstatus.v7.patch
        24 kB
        Craig Macdonald
      10. Test plan for hadoop fs -df.html
        5 kB
        Ravi Phulari

        Issue Links

          Activity

          Brian Bockelman created issue -
          Brian Bockelman made changes -
          Field Original Value New Value
          Link This issue is related to HADOOP-2659 [ HADOOP-2659 ]
          Brian Bockelman made changes -
          Attachment fuse_statfs.patch [ 12395292 ]
          Brian Bockelman made changes -
          Attachment fuse_statfs_trunk.patch [ 12395293 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.patch [ 12397118 ]
          Doug Cutting made changes -
          Assignee Craig Macdonald [ craigm ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v2.patch [ 12397349 ]
          Craig Macdonald made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v3.patch [ 12398597 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v4.patch [ 12398618 ]
          Craig Macdonald made changes -
          Component/s libhdfs [ 12311345 ]
          Component/s contrib/fuse-dfs [ 12312376 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v5.patch [ 12398684 ]
          Craig Macdonald made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Craig Macdonald made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Craig Macdonald made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v6.patch [ 12399122 ]
          Craig Macdonald made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Craig Macdonald made changes -
          Attachment hadoop4368.fsstatus.v7.patch [ 12399212 ]
          Craig Macdonald made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Craig Macdonald made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Tsz Wo Nicholas Sze made changes -
          Hadoop Flags [Reviewed]
          Issue Type Wish [ 5 ] New Feature [ 2 ]
          Tsz Wo Nicholas Sze made changes -
          Resolution Fixed [ 1 ]
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Fix Version/s 0.21.0 [ 12313563 ]
          Craig Macdonald made changes -
          Release Note Adds API support for unprivileged users to see filesystem statistics (capacity, used, free). Adds a -df option to fs shell utility that allows unprivileged users to see filesystem statistics. Changes libhdfs and namenode jsps to use new filesystem statistics API.
          Owen O'Malley made changes -
          Component/s dfs [ 12310710 ]
          Owen O'Malley made changes -
          Component/s libhdfs [ 12311345 ]
          Robert Chansler made changes -
          Release Note Adds API support for unprivileged users to see filesystem statistics (capacity, used, free). Adds a -df option to fs shell utility that allows unprivileged users to see filesystem statistics. Changes libhdfs and namenode jsps to use new filesystem statistics API. New filesystem shell command -df reports capacity, space used and space free. Any user may execute this command without special privileges.
          Ravi Phulari made changes -
          Attachment Test plan for hadoop fs -df.html [ 12425413 ]
          Tom White made changes -
          Status Resolved [ 5 ] Closed [ 6 ]

            People

            • Assignee:
              Craig Macdonald
              Reporter:
              Brian Bockelman
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 10m
                10m
                Remaining:
                Remaining Estimate - 10m
                10m
                Logged:
                Time Spent - Not Specified
                Not Specified

                  Development