Re: [LTP] [PATCH v4 0/5] Add fchmodat2 testing suite

From: Petr Vorel
Date: Fri Aug 02 2024 - 03:20:11 EST


Hi all,

...
> @Andrea, I guess we want something like this:

> +++ testcases/kernel/syscalls/fchmodat2/fchmodat2_01.c
> @@ -43,9 +43,10 @@ static void test_symbolic_link(void)
> verify_mode(fd_dir, FNAME, S_IFREG | 0700);
> verify_mode(fd_dir, SNAME, S_IFLNK | 0777);

> - TST_EXP_PASS(fchmodat2(fd_dir, SNAME, 0640, AT_SYMLINK_NOFOLLOW));
> - verify_mode(fd_dir, FNAME, S_IFREG | 0700);
> - verify_mode(fd_dir, SNAME, S_IFLNK | 0640);
> + if (tst_kvercmp(6, 6, 0) >= 0) {
> + TST_EXP_FAIL(tst_syscall(__NR_fchmodat2, fd_dir, SNAME, 0640,
> + AT_SYMLINK_NOFOLLOW), EOPNOTSUPP);
> + }
> }

Actually, this has been backported to all stable/LTS trees (up to 4.19).
Thus there should not be a version check, but instead suggesting a missing
5d1f903f75a8 commit.

.tags = (const struct tst_tag[]) {
{"linux-git", "5d1f903f75a8"},
{}
}

Kind regards,
Petr