[LTP] [PATCH STAGING v4 06/16] fchroot03: test fchroot() permission checks
Cyril Hrubis
chrubis@suse.cz
Mon Oct 12 12:32:39 CEST 2026
Hi!
> +static void run(unsigned int i)
> +{
> + struct tcase *tc = &tcases[i];
> +
> + if (SAFE_FORK())
> + return;
> +
> + int dfd = SAFE_OPEN(tc->dir, O_PATH | O_DIRECTORY);
> +
> + SAFE_SETRESUID(ltpuser->pw_uid, ltpuser->pw_uid,
> + ltpuser->pw_uid);
> +
> + TST_EXP_FAIL(tst_syscall(__NR_fchroot, dfd, 0),
> + tc->exp_errno, "fchroot() with %s", tc->desc);
> +
> + exit(0);
The test library does exit(0); for any process that has been forked from
the main test process. There is no need for the exit(0) here.
Otherwise:
Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Cyril Hrubis
chrubis@suse.cz
More information about the ltp
mailing list