Skip to content

Commit c1f7440

Browse files
HDDS-1885. Fix bug in checkAcls in OzoneManager. (#1199)
1 parent b008072 commit c1f7440

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1801,17 +1801,16 @@ public void checkAcls(ResourceType resType, StoreType storeType,
18011801
.setVolumeName(vol)
18021802
.setBucketName(bucket)
18031803
.setKeyName(key).build();
1804-
UserGroupInformation user = ProtobufRpcEngine.Server.getRemoteUser();
18051804
RequestContext context = RequestContext.newBuilder()
1806-
.setClientUgi(user)
1807-
.setIp(ProtobufRpcEngine.Server.getRemoteIp())
1805+
.setClientUgi(ugi)
1806+
.setIp(remoteAddress)
18081807
.setAclType(ACLIdentityType.USER)
18091808
.setAclRights(aclType)
18101809
.build();
18111810
if (!accessAuthorizer.checkAccess(obj, context)) {
18121811
LOG.warn("User {} doesn't have {} permission to access {}",
1813-
user.getUserName(), aclType, resType);
1814-
throw new OMException("User " + user.getUserName() + " doesn't " +
1812+
ugi.getUserName(), aclType, resType);
1813+
throw new OMException("User " + ugi.getUserName() + " doesn't " +
18151814
"have " + aclType + " permission to access " + resType,
18161815
ResultCodes.PERMISSION_DENIED);
18171816
}

0 commit comments

Comments
 (0)