[PATCH v10 4/5] Implement testing framework for pidns

Dmitry V. Levin ldv at altlinux.org
Thu Aug 20 17:51:10 UTC 2020


On Wed, Aug 19, 2020 at 08:16:36PM +0200, Ákos Uzonyi wrote:
[...]
> +void
> +pidns_test_init(void)
> +{
> +	pidns_translation = true;
> +
> +	check_ns_ioctl();
> +
> +	if (!pidns_fork(-1, false))
> +		return;
> +
> +	/* Unshare user namespace too, so we do not need to be root */
> +	if (unshare(CLONE_NEWUSER | CLONE_NEWPID) < 0) {
> +		if (errno == EPERM)
> +			perror_msg_and_skip("unshare");
> +
> +		perror_msg_and_fail("unshare");
> +	}

This code fails to compile on the following system:
https://build.opensuse.org/package/live_build_log/home:ldv_alt/strace/RedHat_RHEL-5/x86_64

pidns.c: In function 'pidns_test_init':
pidns.c:204: error: 'CLONE_NEWUSER' undeclared (first use in this function)
pidns.c:204: error: (Each undeclared identifier is reported only once
pidns.c:204: error: for each function it appears in.)
pidns.c:204: error: 'CLONE_NEWPID' undeclared (first use in this function)

A similar compilation issue exists in fork--pidns-translation.c, too.


-- 
ldv


More information about the Strace-devel mailing list