]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Add endian conversion to xfs_repair to prevent removal of valid acls.
authorAndrew Gildfind <ajag@sgi.com>
Thu, 29 Mar 2001 06:30:18 +0000 (06:30 +0000)
committerAndrew Gildfind <ajag@sgi.com>
Thu, 29 Mar 2001 06:30:18 +0000 (06:30 +0000)
repair/attr_repair.c

index 3fd25286e473bb186cccf731e615ccb105b57138..727c2ce16bfb97a96be617984029e0b1d262261c 100644 (file)
@@ -884,6 +884,23 @@ process_longform_attr(
 }
 
 
+static void
+xfs_acl_get_endian(struct acl *aclp)
+{
+    struct acl_entry *ace, *end;
+
+    /* do the endian conversion */
+    INT_SET(aclp->acl_cnt, ARCH_CONVERT, aclp->acl_cnt);
+
+    /* loop thru ACEs of ACL */
+    end = &aclp->acl_entry[0]+aclp->acl_cnt;
+    for (ace=&aclp->acl_entry[0]; ace < end; ace++) {
+        INT_SET(ace->ae_tag, ARCH_CONVERT, ace->ae_tag);
+        INT_SET(ace->ae_id, ARCH_CONVERT, ace->ae_id);
+        INT_SET(ace->ae_perm, ARCH_CONVERT, ace->ae_perm);
+    }
+}
+
 /*
  * returns 1 if attributes got cleared
  * and 0 if things are ok. 
@@ -934,6 +951,8 @@ acl_valid (struct acl *aclp)
        if (aclp == NULL)
                goto acl_invalid;
 
+       xfs_acl_get_endian(aclp);
+
        if (aclp->acl_cnt > ACL_MAX_ENTRIES)
                goto acl_invalid;