From SELinux Wiki
This section contains example source code and policy modules that may be useful for experimenting with.
There is an experiment that uses different x_contexts file entries to see what effect they have when using X-selections. This is split into two sections:
- Tests based on the way the Reference Policy manages labeling.
- Tests that make use of the polyinstantiation features of the X object manager/XACE services.
There is also a simple test program that can be used to call the 23 XSELinux functions that are built into the X-Windows object manager.
The samples code etc. can be found at: