[LTP] fs/acl: Add ACL_USER_OBJ permission test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Mon Jun 15 08:32:08 CEST 2026
Hi Sachin,
On Mon, 15 Jun 2026, Sachin Sant wrote:
> fs/acl: Add ACL_USER_OBJ permission test
--- [PATCH 2/8] ---
> +static void test_acl_user_with_mask(void)
> ...
> +static void test_acl_group_with_mask(void)
> ...
> +static void test_acl_group_obj_with_mask(void)
> ...
> +static void run(unsigned int n)
> +{
> + switch (n) {
> + case 0:
> + test_acl_user_with_mask();
> + break;
> + case 1:
> + test_acl_group_with_mask();
> + break;
> + case 2:
> + test_acl_group_obj_with_mask();
> + break;
> + }
> +}
The three test functions share the same algorithmic structure:
set up ACL with full permissions for an entry type, verify
access is granted with mask=rwx, clear the mask, verify
access is denied. They differ only in the ACL entry type
(ACL_USER / ACL_GROUP / ACL_GROUP_OBJ) and the UID/GID
used.
Could these be collapsed into a single parametrized test
function driven by a struct tcase array? Something along
the lines of:
struct tcase {
uint16_t tag;
uid_t uid;
gid_t gid;
uid_t owner_uid;
gid_t owner_gid;
const char *desc;
} tcases[] = {
{ACL_USER, USER3_UID, USER3_GID,
TEST_UID, TEST_GID, "ACL_USER with mask"},
{ACL_GROUP, USER2_UID, USER2_GID,
TEST_UID, TEST_GID, "ACL_GROUP with mask"},
{ACL_GROUP_OBJ, USER2_UID, USER2_GID,
TEST_UID, USER2_GID, "ACL_GROUP_OBJ with mask"},
};
That would remove roughly 130 lines of duplicated logic and
make the data-driven pattern explicit.
Verdict - Needs revision
---
Note:
The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.
Regards,
LTP AI Reviewer
More information about the ltp
mailing list