|
@@ -3621,10 +3621,10 @@ public class FSNamesystem implements Namesystem, FSNamesystemMBean,
|
|
|
final String operationName = getQuotaCommand(nsQuota, ssQuota);
|
|
|
final FSPermissionChecker pc = getPermissionChecker();
|
|
|
FSPermissionChecker.setOperationType(operationName);
|
|
|
+ if(!allowOwnerSetQuota) {
|
|
|
+ checkSuperuserPrivilege(operationName, src);
|
|
|
+ }
|
|
|
try {
|
|
|
- if(!allowOwnerSetQuota) {
|
|
|
- checkSuperuserPrivilege(operationName, src);
|
|
|
- }
|
|
|
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();
|
|
|
+ checkSuperuserPrivilege(operationName, poolName);
|
|
|
try {
|
|
|
- checkSuperuserPrivilege(operationName, poolName);
|
|
|
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()) + "}";
|
|
|
+ checkSuperuserPrivilege(operationName, poolNameStr);
|
|
|
try {
|
|
|
- checkSuperuserPrivilege(operationName, poolNameStr);
|
|
|
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 + "}";
|
|
|
+ checkSuperuserPrivilege(operationName, poolNameStr);
|
|
|
try {
|
|
|
- checkSuperuserPrivilege(operationName, poolNameStr);
|
|
|
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);
|