void enter_network_namespace(pid_t pid) {
	ProcessHandle sandbox = pin_sandbox_process(pid);

	// check network namespace
	char *name;
	if (asprintf(&name, "/run/firejail/network/%d-netmap", pid) == -1)
		errExit("asprintf");
	struct stat s;
	if (stat(name, &s) == -1) {
		fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n");
		exit(1);
	}

	// join the namespace
	EUID_ROOT();
	if (process_join_namespace(sandbox, "net")) {
		fprintf(stderr, "Error: cannot join the network namespace\n");
		exit(1);
	}
	unpin_process(sandbox);
}
void enter_network_namespace(pid_t pid) {
	ProcessHandle sandbox = pin_sandbox_process(pid);

	 
	char *name;
	if (asprintf(&name, "/run/firejail/network/%d-netmap", pid) == -1)
		errExit("asprintf");
	struct stat s;
	if (stat(name, &s) == -1) {
		fprintf(stderr, "Error: the sandbox doesn't use a new network namespace\n");
		exit(1);
	}

	 
	EUID_ROOT();
	if (process_join_namespace(sandbox, "net")) {
		fprintf(stderr, "Error: cannot join the network namespace\n");
		exit(1);
	}
	unpin_process(sandbox);
}