[
https://issues.apache.org/jira/browse/YARN-11151?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
lujie updated YARN-11151:
-------------------------
Description:
we init LevelDBCacheTimelineStore, RollingLevelDBTimelineStore,
EntityGroupFSTimelineStore and LeveldbTimelineStore like:
{code:java}
try {
localFS = FileSystem.getLocal(conf);
if (!localFS.exists(dbPath)) {
if (!localFS.mkdirs(dbPath)) {
throw new IOException("Couldn't create directory for leveldb " +
"timeline store " + dbPath);
}
localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
}
} finally {
IOUtils.cleanupWithLogger(LOG, localFS);
} {code}
if node crash before setPermisson, then the permisison will be 755 forever
code should be like :
{code:java}
try {
localFS = FileSystem.getLocal(conf);
if (!localFS.exists(dbPath)) {
if (!localFS.mkdirs(dbPath)) {
throw new IOException("Couldn't create directory for leveldb " +
"timeline store " + dbPath);
}
}
if(!localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
}
finally {
IOUtils.cleanupWithLogger(LOG, localFS);
} {code}
was:
we init LevelDBCacheTimelineStore, RollingLevelDBTimelineStore and
LeveldbTimelineStore like:
{code:java}
try {
localFS = FileSystem.getLocal(conf);
if (!localFS.exists(dbPath)) {
if (!localFS.mkdirs(dbPath)) {
throw new IOException("Couldn't create directory for leveldb " +
"timeline store " + dbPath);
}
localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
}
} finally {
IOUtils.cleanupWithLogger(LOG, localFS);
} {code}
if node crash before setPermisson, then the permisison will be 755 forever
code should be like :
{code:java}
try {
localFS = FileSystem.getLocal(conf);
if (!localFS.exists(dbPath)) {
if (!localFS.mkdirs(dbPath)) {
throw new IOException("Couldn't create directory for leveldb " +
"timeline store " + dbPath);
}
}
if(!localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
}
finally {
IOUtils.cleanupWithLogger(LOG, localFS);
} {code}
> sensitive infor may leak due to crash
> -------------------------------------
>
> Key: YARN-11151
> URL: https://issues.apache.org/jira/browse/YARN-11151
> Project: Hadoop YARN
> Issue Type: Bug
> Reporter: lujie
> Priority: Major
>
> we init LevelDBCacheTimelineStore, RollingLevelDBTimelineStore,
> EntityGroupFSTimelineStore and LeveldbTimelineStore like:
>
> {code:java}
> try {
> localFS = FileSystem.getLocal(conf);
> if (!localFS.exists(dbPath)) {
> if (!localFS.mkdirs(dbPath)) {
> throw new IOException("Couldn't create directory for leveldb " +
> "timeline store " + dbPath);
> }
> localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
> }
> } finally {
> IOUtils.cleanupWithLogger(LOG, localFS);
> } {code}
>
> if node crash before setPermisson, then the permisison will be 755 forever
>
> code should be like :
> {code:java}
> try {
> localFS = FileSystem.getLocal(conf);
> if (!localFS.exists(dbPath)) {
> if (!localFS.mkdirs(dbPath)) {
> throw new IOException("Couldn't create directory for leveldb " +
> "timeline store " + dbPath);
> }
>
> }
>
> if(!localFS.getStatus(dbPath).getPermmision().equlas(LeveldbUtils.LEVELDB_DIR_UMASK))){
> localFS.setPermission(dbPath, LeveldbUtils.LEVELDB_DIR_UMASK);
> }
> finally {
> IOUtils.cleanupWithLogger(LOG, localFS);
> } {code}
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]