[systemd-devel] Systemd is causing mislabeled devices to be created and then attempting to read them.

Lennart Poettering lennart at poettering.net
Wed Aug 4 02:54:33 PDT 2010


On Wed, 28.07.10 09:39, Daniel J Walsh (dwalsh at redhat.com) wrote:

> Here is the updated patch with a fix for the labeling of /dev/autofs

Patch applied and in v5.

I have rearranged some things a little bit, and made one change which I
think is kinda important:

> +
> +#if HAVE_SELINUX
> +	if (use_selinux()) {
> +		label_hnd = selabel_open(SELABEL_CTX_FILE, NULL, 0);
> +		if (label_hnd != 0) {

I turned this around, i.e. "if (!label_hnd)". 

> +			log_error("Failed to initialize SELinux Context ");
> +			r = (security_getenforce() == 1) ? -errno: 0;
> +		}
> +	}
> +#endif

Hope that change makes sense?

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list