1*2d543d20SAndroid Build Coastguard Worker# Contributing to SELinux 2*2d543d20SAndroid Build Coastguard Worker 3*2d543d20SAndroid Build Coastguard WorkerContributing to the SELinux userspace project is a similar process to 4*2d543d20SAndroid Build Coastguard Workerother open source projects. Bug reports, new features to the existing 5*2d543d20SAndroid Build Coastguard Workercode, additional tools, or updated documentation are all welcome. 6*2d543d20SAndroid Build Coastguard Worker 7*2d543d20SAndroid Build Coastguard WorkerYou can find a list of open issues where you might contribute to the SELinux kernel code at 8*2d543d20SAndroid Build Coastguard Workerhttps://github.com/SELinuxProject/selinux-kernel/issues or to the SELinux userspace code at 9*2d543d20SAndroid Build Coastguard Workerhttps://github.com/SELinuxProject/selinux/issues. 10*2d543d20SAndroid Build Coastguard Worker 11*2d543d20SAndroid Build Coastguard WorkerSee the selinuxproject.org [user resources 12*2d543d20SAndroid Build Coastguard Workerpage](http://selinuxproject.org/page/User_Resources) for more 13*2d543d20SAndroid Build Coastguard Workerinformation on mailing lists, documentation, and other resources. 14*2d543d20SAndroid Build Coastguard Worker 15*2d543d20SAndroid Build Coastguard Worker## Reporting Bugs 16*2d543d20SAndroid Build Coastguard Worker 17*2d543d20SAndroid Build Coastguard WorkerAll bugs and patches should be submitted to the [SELinux mailing 18*2d543d20SAndroid Build Coastguard Workerlist](https://lore.kernel.org/selinux) at [email protected]. 19*2d543d20SAndroid Build Coastguard Worker 20*2d543d20SAndroid Build Coastguard WorkerWhen reporting bugs please include versions of SELinux related libraries and 21*2d543d20SAndroid Build Coastguard Workertools (libsepol, libselinux, libsemanage, checkpolicy). If you are 22*2d543d20SAndroid Build Coastguard Workerusing a custom policy please include it as well. 23*2d543d20SAndroid Build Coastguard Worker 24*2d543d20SAndroid Build Coastguard Worker## Compiling 25*2d543d20SAndroid Build Coastguard Worker 26*2d543d20SAndroid Build Coastguard WorkerThere are a number of dependencies required to build the userspace 27*2d543d20SAndroid Build Coastguard Workertools/libraries. On a Fedora system you can install them with yum: 28*2d543d20SAndroid Build Coastguard Worker 29*2d543d20SAndroid Build Coastguard Worker # yum install audit-libs-devel bison bzip2-devel dbus-devel dbus-glib-devel flex flex-devel flex-static glib2-devel libcap-devel libcap-ng-devel pam-devel pcre2-devel python-devel setools-devel swig ustr-devel 30*2d543d20SAndroid Build Coastguard Worker 31*2d543d20SAndroid Build Coastguard WorkerThe tools and libraries can be built and installed under a private directory from the top level with make, e.g. 32*2d543d20SAndroid Build Coastguard Worker 33*2d543d20SAndroid Build Coastguard Worker $ make DESTDIR=~/obj install install-pywrap 34*2d543d20SAndroid Build Coastguard Worker 35*2d543d20SAndroid Build Coastguard Worker## Contributing Code 36*2d543d20SAndroid Build Coastguard Worker 37*2d543d20SAndroid Build Coastguard WorkerAfter obtaining the code of the repository (see below), create a patch 38*2d543d20SAndroid Build Coastguard Workeragainst the repository, and post that patch to the [SELinux mailing 39*2d543d20SAndroid Build Coastguard Workerlist](https://lore.kernel.org/selinux) at [email protected]. When preparing 40*2d543d20SAndroid Build Coastguard Workerpatches, please follow these guidelines: 41*2d543d20SAndroid Build Coastguard Worker 42*2d543d20SAndroid Build Coastguard Worker- Patches should apply with -p1 43*2d543d20SAndroid Build Coastguard Worker- Must apply against HEAD of the master branch 44*2d543d20SAndroid Build Coastguard Worker- Separate large patches into logical patches 45*2d543d20SAndroid Build Coastguard Worker- Patch descriptions must end with your "Signed-off-by" line. This means your 46*2d543d20SAndroid Build Coastguard Worker code meets the Developer's certificate of origin, see below. 47*2d543d20SAndroid Build Coastguard Worker 48*2d543d20SAndroid Build Coastguard WorkerWhen adding new, large features or tools it is best to discuss the 49*2d543d20SAndroid Build Coastguard Workerdesign on the mailing list prior to submitting the patch. 50*2d543d20SAndroid Build Coastguard Worker 51*2d543d20SAndroid Build Coastguard Worker## Development Repository 52*2d543d20SAndroid Build Coastguard Worker 53*2d543d20SAndroid Build Coastguard WorkerGit is a modern source code management system. For more information 54*2d543d20SAndroid Build Coastguard Workerabout Git please see the Git website. 55*2d543d20SAndroid Build Coastguard Worker 56*2d543d20SAndroid Build Coastguard WorkerTo get an anonymous checkout of the SELinux userland repository you can 57*2d543d20SAndroid Build Coastguard Workerrun: 58*2d543d20SAndroid Build Coastguard Worker 59*2d543d20SAndroid Build Coastguard Worker $ git clone https://github.com/SELinuxProject/selinux.git 60*2d543d20SAndroid Build Coastguard Worker 61*2d543d20SAndroid Build Coastguard Worker# Developer Certificate of Origin 62*2d543d20SAndroid Build Coastguard Worker 63*2d543d20SAndroid Build Coastguard Worker Developer's Certificate of Origin 1.1 64*2d543d20SAndroid Build Coastguard Worker 65*2d543d20SAndroid Build Coastguard Worker By making a contribution to this project, I certify that: 66*2d543d20SAndroid Build Coastguard Worker 67*2d543d20SAndroid Build Coastguard Worker (a) The contribution was created in whole or in part by me and I 68*2d543d20SAndroid Build Coastguard Worker have the right to submit it under the open source license 69*2d543d20SAndroid Build Coastguard Worker indicated in the file; or 70*2d543d20SAndroid Build Coastguard Worker 71*2d543d20SAndroid Build Coastguard Worker (b) The contribution is based upon previous work that, to the best 72*2d543d20SAndroid Build Coastguard Worker of my knowledge, is covered under an appropriate open source 73*2d543d20SAndroid Build Coastguard Worker license and I have the right under that license to submit that 74*2d543d20SAndroid Build Coastguard Worker work with modifications, whether created in whole or in part 75*2d543d20SAndroid Build Coastguard Worker by me, under the same open source license (unless I am 76*2d543d20SAndroid Build Coastguard Worker permitted to submit under a different license), as indicated 77*2d543d20SAndroid Build Coastguard Worker in the file; or 78*2d543d20SAndroid Build Coastguard Worker 79*2d543d20SAndroid Build Coastguard Worker (c) The contribution was provided directly to me by some other 80*2d543d20SAndroid Build Coastguard Worker person who certified (a), (b) or (c) and I have not modified 81*2d543d20SAndroid Build Coastguard Worker it. 82*2d543d20SAndroid Build Coastguard Worker 83*2d543d20SAndroid Build Coastguard Worker (d) I understand and agree that this project and the contribution 84*2d543d20SAndroid Build Coastguard Worker are public and that a record of the contribution (including all 85*2d543d20SAndroid Build Coastguard Worker personal information I submit with it, including my sign-off) is 86*2d543d20SAndroid Build Coastguard Worker maintained indefinitely and may be redistributed consistent with 87*2d543d20SAndroid Build Coastguard Worker this project or the open source license(s) involved. 88