[LTP] fs/acl: Add ACL_USER_OBJ permission test
linuxtestproject.agent@gmail.com
linuxtestproject.agent@gmail.com
Mon Jun 15 10:33:22 CEST 2026
Hi Sachin,
On Mon, 15 Jun 2026, Sachin Sant wrote:
> fs/acl: Add ACL_USER_OBJ permission test
--- [PATCH 5/8] ---
> +static void test_chown_acl(void)
> +{
> ...
> + if (acl_set_file(TESTFILE, ACL_TYPE_ACCESS, acl) < 0) {
> + acl_free(acl);
> + cleanup_testfile();
> + if (errno == EOPNOTSUPP)
> + tst_brk(TCONF | TERRNO, "ACL not supported");
> + tst_brk(TBROK | TERRNO, "acl_set_file failed");
> + }
The errno check for EOPNOTSUPP happens after acl_free() and
cleanup_testfile(). cleanup_testfile() calls unlink() internally,
and POSIX does not guarantee that errno is preserved after a
successful syscall. If unlink() clobbers errno, the EOPNOTSUPP
check silently fails and the test reports TBROK instead of TCONF.
test_chmod_acl() in the same file checks errno first:
if (acl_set_file(...) < 0) {
if (errno == EOPNOTSUPP) {
acl_free(acl);
cleanup_testfile();
tst_brk(TCONF | TERRNO, ...);
}
acl_free(acl);
cleanup_testfile();
tst_brk(TBROK | TERRNO, ...);
}
Could test_chown_acl() use the same pattern?
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