[ 
https://issues.apache.org/jira/browse/GOBBLIN-1892?focusedWorklogId=879213&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-879213
 ]

ASF GitHub Bot logged work on GOBBLIN-1892:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Aug/23 21:16
            Start Date: 30/Aug/23 21:16
    Worklog Time Spent: 10m 
      Work Description: ZihanLi58 commented on code in PR #3755:
URL: https://github.com/apache/gobblin/pull/3755#discussion_r1310833015


##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/CopyableFile.java:
##########
@@ -441,7 +444,33 @@ public static Map<String, OwnerAndPermission> 
resolveReplicatedAncestorOwnerAndP
 
   private static List<AclEntry> getAclEntries(FileSystem srcFs, Path path) 
throws IOException {
     AclStatus aclStatus = srcFs.getAclStatus(path);
-    return aclStatus.getEntries();
+    return addOthersEntryTypeToAclEntriesIfMissing(aclStatus.getEntries());
+  }
+  /*
+   * When we get AclEntry from org.apache.hadoop.fs.permission.AclStatus, it's 
missing AclEntryType.OTHER.
+   * This causes AclTransformation validation to fail on the list of 
AclEntries. As a result, adding this helper
+   * method to provide DEFAULT scope in cases where AclEntryType.OTHER is 
absent
+   */
+  private static List<AclEntry> 
addOthersEntryTypeToAclEntriesIfMissing(List<AclEntry> aclEntries) {
+    // Check if "others" entry is missing
+    boolean othersAclEntryTypeMissing = true;
+
+    for (AclEntry aclEntry : aclEntries) {
+      if (aclEntry.getType() == AclEntryType.OTHER) {
+        othersAclEntryTypeMissing = false;
+        break;
+      }
+    }
+    // If "others" entry is missing, add it
+    if (othersAclEntryTypeMissing) {

Review Comment:
   Can you help me understand why other can be missed in this case, and what is 
the best default value we should give? Also did we verify that user and group 
will never be missed in the ACL?





Issue Time Tracking
-------------------

    Worklog Id:     (was: 879213)
    Time Spent: 20m  (was: 10m)

> Add others AclEntry type if missing while trying to set and preserve ACLs as 
> part of Distcp
> -------------------------------------------------------------------------------------------
>
>                 Key: GOBBLIN-1892
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1892
>             Project: Apache Gobblin
>          Issue Type: New Feature
>            Reporter: Meeth Gala
>            Priority: Major
>          Time Spent: 20m
>  Remaining Estimate: 0h
>




--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to