HDFS-16868. Fix audit log duplicate issue when an ACE occurs in FSNamesystem. (#5206). Contributed by Beibei Zhao.
Signed-off-by: Chris Nauroth <cnauroth@apache.org> Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
parent
a71aaef9a9
commit
fdcbc8b072
|
@ -3621,10 +3621,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
final String operationName = getQuotaCommand(nsQuota, ssQuota);
|
||||
final FSPermissionChecker pc = getPermissionChecker();
|
||||
FSPermissionChecker.setOperationType(operationName);
|
||||
try {
|
||||
if(!allowOwnerSetQuota) {
|
||||
checkSuperuserPrivilege(operationName, src);
|
||||
}
|
||||
try {
|
||||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
|
@ -7761,8 +7761,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
checkOperation(OperationCategory.WRITE);
|
||||
String poolInfoStr = null;
|
||||
String poolName = req == null ? null : req.getPoolName();
|
||||
try {
|
||||
checkSuperuserPrivilege(operationName, poolName);
|
||||
try {
|
||||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
|
@ -7788,8 +7788,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
checkOperation(OperationCategory.WRITE);
|
||||
String poolNameStr = "{poolName: " +
|
||||
(req == null ? null : req.getPoolName()) + "}";
|
||||
try {
|
||||
checkSuperuserPrivilege(operationName, poolNameStr);
|
||||
try {
|
||||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
|
@ -7815,8 +7815,8 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
final String operationName = "removeCachePool";
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
String poolNameStr = "{poolName: " + cachePoolName + "}";
|
||||
try {
|
||||
checkSuperuserPrivilege(operationName, poolNameStr);
|
||||
try {
|
||||
writeLock();
|
||||
try {
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
|
@ -8017,11 +8017,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
SafeModeException, AccessControlException {
|
||||
final String operationName = "createEncryptionZone";
|
||||
FileStatus resultingStat = null;
|
||||
checkSuperuserPrivilege(operationName, src);
|
||||
try {
|
||||
Metadata metadata = FSDirEncryptionZoneOp.ensureKeyIsInitialized(dir,
|
||||
keyName, src);
|
||||
final FSPermissionChecker pc = getPermissionChecker();
|
||||
checkSuperuserPrivilege(operationName, src);
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
writeLock();
|
||||
try {
|
||||
|
@ -8100,11 +8100,11 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|||
final boolean logRetryCache) throws IOException {
|
||||
final String operationName = "reencryptEncryptionZone";
|
||||
boolean success = false;
|
||||
checkSuperuserPrivilege(operationName, zone);
|
||||
try {
|
||||
Preconditions.checkNotNull(zone, "zone is null.");
|
||||
checkOperation(OperationCategory.WRITE);
|
||||
final FSPermissionChecker pc = dir.getPermissionChecker();
|
||||
checkSuperuserPrivilege(operationName, zone);
|
||||
checkNameNodeSafeMode("NameNode in safemode, cannot " + action
|
||||
+ " re-encryption on zone " + zone);
|
||||
reencryptEncryptionZoneInt(pc, zone, action, logRetryCache);
|
||||
|
|
Loading…
Reference in New Issue