From: Andrew Gildfind Date: Thu, 29 Mar 2001 06:30:18 +0000 (+0000) Subject: Add endian conversion to xfs_repair to prevent removal of valid acls. X-Git-Tag: v1.2.0~4 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=061313d47a914c16d16b8245c6f767d1678a1031;p=thirdparty%2Fxfsprogs-dev.git Add endian conversion to xfs_repair to prevent removal of valid acls. --- diff --git a/repair/attr_repair.c b/repair/attr_repair.c index 3fd25286e..727c2ce16 100644 --- a/repair/attr_repair.c +++ b/repair/attr_repair.c @@ -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;