Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11453

Invalid mapping can be inserted to nfs's id-name map

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • None
    • None
    • nfs
    • None

    Description

      See pasted code below from ShellBasedIdMapping#updateMapInternal, LineA could return null value when the entry is not in the static mapping. Since map allows null key, so it's possible that lineB would add entry <null, value> to the map. This is not the desired behavior.

              final Integer key = staticMapping.get(parseId(nameId[1])); <====lineA
              final String value = nameId[0];
              if (map.containsKey(key)) {
                final String prevValue = map.get(key);
                if (value.equals(prevValue)) {
                  // silently ignore equivalent entries
                  continue;
                }
                reportDuplicateEntry(
                    "Got multiple names associated with the same id: ",
                    key, value, key, prevValue);           
                continue;
              }
              if (map.containsValue(value)) {
                final Integer prevKey = map.inverse().get(value);
                reportDuplicateEntry(
                    "Got multiple ids associated with the same name: ",
                    key, value, prevKey, value);
                continue;
              }
              map.put(key, value);  <==== lineB
      

      Attachments

        Activity

          People

            yzhangal Yongjun Zhang
            yzhangal Yongjun Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: