Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-6415

Missing null check in FSImageSerialization#writePermissionStatus()

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: namenode
    • Labels:
      None
    • Target Version/s:

      Description

          PermissionStatus.write(out, inode.getUserName(), inode.getGroupName(), p);
      

      getUserName() / getGroupName() may return null.
      null check should be added for these two calls.

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        2d 22m 1 Chen He 17/May/14 23:15
        Patch Available Patch Available Resolved Resolved
        43d 20h 13m 1 Kihwal Lee 30/Jun/14 19:29
        Kihwal Lee made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Resolution Won't Fix [ 2 ]
        Hide
        Kihwal Lee added a comment -

        I don't think we want to do anything special here. If it ever happens for some reason, it should fail. I think it already does with NPE.

        Show
        Kihwal Lee added a comment - I don't think we want to do anything special here. If it ever happens for some reason, it should fail. I think it already does with NPE.
        Thomas Graves made changes -
        Target Version/s 0.23.11, 2.5.0 [ 12324661, 12326264 ] 2.5.0 [ 12326264 ]
        Brandon Li made changes -
        Component/s namenode [ 12312926 ]
        Hide
        Brandon Li added a comment -

        How could getUserName() / getGroupName() return null? Maybe I missed something but I couldn't find a case in current code which can make the inode have null user or group names.
        Are we proposing the code change just to prevent future errors (e.g., future code change might introduce a null reference)?

        Show
        Brandon Li added a comment - How could getUserName() / getGroupName() return null? Maybe I missed something but I couldn't find a case in current code which can make the inode have null user or group names. Are we proposing the code change just to prevent future errors (e.g., future code change might introduce a null reference)?
        Hide
        Hadoop QA added a comment -

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

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

        -1 tests included. The patch doesn't appear to include any new or modified tests.
        Please justify why no new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        +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 1.3.9) 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-hdfs-project/hadoop-hdfs.

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

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/6932//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6932//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/12645434/HDFS-6415.patch against trunk revision . +1 @author . The patch does not contain any @author tags. -1 tests included . The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +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 1.3.9) 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-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/6932//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/6932//console This message is automatically generated.
        Chen He made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Target Version/s 0.23.11, 2.5.0 [ 12324661, 12326264 ]
        Hide
        Chen He added a comment -

        I propose to write "nobody" if there is no user and group name.

        Show
        Chen He added a comment - I propose to write "nobody" if there is no user and group name.
        Chen He made changes -
        Attachment HDFS-6415.patch [ 12645434 ]
        Chen He made changes -
        Field Original Value New Value
        Assignee Chen He [ airbots ]
        Ted Yu created issue -

          People

          • Assignee:
            Chen He
            Reporter:
            Ted Yu
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development