This is a little test program that will take

Daniel J Walsh dwalsh at redhat.com
Mon Jul 19 19:25:46 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

This program takes three inputs.

The executable that init will exec.
The directory where the executable would create the object. (fifo_file,
sock_file, file ...)
The "type" of the object to be created

In order to test this, you need to tell setsockcon the context to run as.

> runcon system_u:system_r:init_t:s0 ./setsockcon /usr/sbin/avahi-daemon
/var/run/avahi-daemon sock_file
/usr/sbin/avahi-daemon system_u:system_r:avahi_t:s0
system_u:object_r:avahi_var_run_t:s0

> runcon system_u:system_r:init_t:s0 ./setsockcon /usr/sbin/httpd
/var/run file
/usr/sbin/httpd system_u:system_r:httpd_t:s0
system_u:object_r:httpd_var_run_t:s0

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAkxEproACgkQrlYvE4MpobOMMwCeLXC/HaUe5RAOgY2J3x3xo0if
SvEAoKKnea5L8AJjFpewdOGNSDIEkhgs
=x5z6
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: setsockcon.c
Url: http://lists.fedoraproject.org/pipermail/devel/attachments/20100719/c4fd149d/attachment.c 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: setsockcon.c.sig
Type: application/pgp-signature
Size: 72 bytes
Desc: not available
Url : http://lists.fedoraproject.org/pipermail/devel/attachments/20100719/c4fd149d/attachment.bin 


More information about the devel mailing list