[LTP] [PATCH STAGING v2 04/16] fchroot01: test fchroot() with a directory fd

Cyril Hrubis chrubis@suse.cz
Thu Aug 20 16:13:40 CEST 2026


Hi!
> +/*\
> + * Test that :manpage:`fchroot(2)` with a regular directory fd moves the
> + * process root to the directory referenced by the fd.
> + *
> + * This is the fd-based counterpart of :manpage:`chroot(2)`, introduced in
> + * Linux v7.3. Root is required because :manpage:`fchroot(2)` with a regular
> + * directory fd requires ``CAP_SYS_CHROOT``.
> + *
> + * The syscall runs in a forked child so that the root of the parent
> + * process, which the test framework needs for its cleanup, is left
> + * untouched.

I do not think that we need this. The process that runs the run()
function is forked from the library process in order for the test to be
isolated from the library.

As long as we do not have a custom cleanup() function that needs to run
outside of the jail we do not have to fork in the run().

-- 
Cyril Hrubis
chrubis@suse.cz


More information about the ltp mailing list