You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mapreduce-dev@hadoop.apache.org by "lujie (Jira)" <ji...@apache.org> on 2022/05/14 07:41:00 UTC

[jira] [Created] (MAPREDUCE-7381) sensitive informa may leak due to crash

lujie created MAPREDUCE-7381:
--------------------------------

             Summary: sensitive informa may leak due to crash
                 Key: MAPREDUCE-7381
                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-7381
             Project: Hadoop Map/Reduce
          Issue Type: Bug
            Reporter: lujie


now we implement mkdir in JobHistoryEventHandler like:

 
{code:java}
// private void mkdir(FileSystem fs, Path path, FsPermission fsp)
      throws IOException {
    if (!fs.exists(path)) {
      try {
        fs.mkdirs(path, fsp);
        FileStatus fsStatus = fs.getFileStatus(path);
        LOG.info("Perms after creating " + fsStatus.getPermission().toShort()
            + ", Expected: " + fsp.toShort());
        if (fsStatus.getPermission().toShort() != fsp.toShort()) {
          LOG.info("Explicitly setting permissions to : " + fsp.toShort()
              + ", " + fsp);
          fs.setPermission(path, fsp);
        }
      } catch (FileAlreadyExistsException e) {
        LOG.info("Directory: [" + path + "] already exists.");
      }
    }
  } {code}
 

 if node crash before setPermission, permission will not be set forever

 

code shuld be like 

 
{code:java}
//   private void mkdir(FileSystem fs, Path path, FsPermission fsp)
      throws IOException {
    if (!fs.exists(path)) {
      try {
        fs.mkdirs(path, fsp);
        FileStatus fsStatus = fs.getFileStatus(path);
        LOG.info("Perms after creating " + fsStatus.getPermission().toShort()
            + ", Expected: " + fsp.toShort());
        
      } catch (FileAlreadyExistsException e) {
        LOG.info("Directory: [" + path + "] already exists.");
      }
    }
 FileStatus fsStatus = fs.getFileStatus(path);
    if (fsStatus.getPermission().toShort() != fsp.toShort()) {              LOG.info("Explicitly setting permissions to : " + fsp.toShort()               + ", " + fsp);           fs.setPermission(path, fsp);         }   } {code}



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

---------------------------------------------------------------------
To unsubscribe, e-mail: mapreduce-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: mapreduce-dev-help@hadoop.apache.org