-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Mike Sweetser - Adhost wrote: > James, > > The following command set should give you what you want: > > grep '^SELINUXTYPE' /etc/selinux/config | awk '{split($0,a,"="); print > a[2];}' > > When run against my targeted setup on RHEL 5.2, it gave me back > "targeted". > > -------------------------- > Mike Sweetser | Systems Administrator > > Adhost Internet > 140 Fourth Avenue North, Suite 360, Seattle, Washington 98109 USA > P 206.404.9000 T 888.234.6781 (ADHOST-1) F 206.404.9050 > E mikesw@xxxxxxxxxx W adhost.com > > Our brand new Adhost West data center is open - contact us for a tour at > 1-888-234-6781 (ADHOST-1) > > > -----Original Message----- > From: owner-selinux@xxxxxxxxxxxxx [mailto:owner-selinux@xxxxxxxxxxxxx] > On Behalf Of James Morris > Sent: Tuesday, September 23, 2008 4:13 PM > To: selinux@xxxxxxxxxxxxx > Subject: How to find SELinux policy type? > > Is there a programmatic way to determine the type of SELinux policy > configured on a system? (e.g. "targeted") > > I've looked in the SELinux userspace and SETools repositories but not > found a library call to do this. > > > - James selinux_getpolicytype() No Man page. python -c "import selinux; print selinux.selinux_getpolicytype()" [0, 'targeted'] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iEYEARECAAYFAkjaJAQACgkQrlYvE4MpobO+YgCgjCHmaHYdrgeOs0gnrpMPUsU7 3BUAmwdc99Nxbk8r7ZNemgbCIQ93RSG9 =YhtH -----END PGP SIGNATURE----- -- This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with the words "unsubscribe selinux" without quotes as the message.