[Bug] Fixed bug that caused export and backup to fail when principal keytab file was created failed (#6404)

Co-authored-by: Geoffrey <gaofeng01@rd.netease.com>
This commit is contained in:
GeoffreyStark
2021-08-11 16:39:01 +08:00
committed by GitHub
parent 3fa3dfbeda
commit f6bcabe0d1

View File

@ -271,7 +271,11 @@ public class FileSystemManager {
Random random = new Random(currentTime);
int randNumber = random.nextInt(10000);
// different kerberos account has different file
tmpFilePath = "/tmp/." + principal + "_" + Long.toString(currentTime) + "_" + Integer.toString(randNumber);
tmpFilePath ="/tmp/." +
principal.replace('/', '_') +
"_" + Long.toString(currentTime) +
"_" + Integer.toString(randNumber);
logger.info("create kerberos tmp file" + tmpFilePath);
FileOutputStream fileOutputStream = new FileOutputStream(tmpFilePath);
fileOutputStream.write(base64decodedBytes);
fileOutputStream.close();