jojochuang commented on code in PR #4254:
URL: https://github.com/apache/ozone/pull/4254#discussion_r1101729609
##########
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java:
##########
@@ -2592,8 +2592,13 @@ public List<OmVolumeArgs> listVolumeByUser(String
userName, String prefix,
metrics.incNumVolumeLists();
if (isAclEnabled) {
String remoteUserName = remoteUserUgi.getShortUserName();
+ // Convert userName to short username
+ final UserGroupInformation ugiUserParam =
+ UserGroupInformation.createRemoteUser(userName);
Review Comment:
This can work but IMO not ideal, because it creates a big UGI object for
doing a simple task.
Why not just use new HadoopKerberosName(name).getShortName()? This is in
fact how UGI.getShortName() is generated.
It will ensure Kerberos prinicpal name is translated into Hadoop user name
properly. It will ensure those principal names whose realm does not have a
auth_to_local rule mapped don't get translated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]