You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2022/04/12 16:54:08 UTC
[GitHub] [ozone] smengcl commented on a diff in pull request #3298: HDDS-6574. Owner field of a bucket created via S3g should be set to the actual user rather than "s3g"
smengcl commented on code in PR #3298:
URL: https://github.com/apache/ozone/pull/3298#discussion_r848659291
##########
hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java:
##########
@@ -533,8 +533,18 @@ public void createBucket(
verifyCountsQuota(bucketArgs.getQuotaInNamespace());
verifySpaceQuota(bucketArgs.getQuotaInBytes());
- String owner = bucketArgs.getOwner() == null ?
- ugi.getShortUserName() : bucketArgs.getOwner();
+ String owner;
+ // If S3 auth exists, set owner name to the short user name derived from the
+ // accessId. Similar to RpcClient#getDEK
+ if (getThreadLocalS3Auth() != null) {
+ UserGroupInformation s3gUGI = UserGroupInformation.createRemoteUser(
+ getThreadLocalS3Auth().getAccessID());
Review Comment:
Yes. In multi-tenancy branch we will just need to replace `getThreadLocalS3Auth().getAccessID()` with `getThreadLocalS3Auth().getUserPrincipal()` instead.
--
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: issues-unsubscribe@ozone.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@ozone.apache.org
For additional commands, e-mail: issues-help@ozone.apache.org