Bump version and update ChangeLog for release.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
selinux_init_load_policy: setenforce(0) if security_disable() fails

If you run selinux_init_load_policy() after a chroot/switch-root, it's
possible that your *previous* root loaded policy, but your *new* root
wants SELinux disabled.

We can't disable SELinux in this case, but we *do* need to make sure
it's permissive. Otherwise we may continue to enforce the old policy.

So, if seconfig = -1, but security_disable() fails, we set *enforce=0,
and then let the existing code handle the security_{get,set}enforce
stuff.

Once that's handled, exit with failure via "goto noload", as before.
Update XDG_RUNTIME_DIR directory
Remove handling of cgroups from sandbox

It never worked correctly and this should be handled with an
API to systemd going forward.
seunshare: Try to use setcurrent before setexec

If seunshare uses PR_SET_NO_NEW_PRIVS, which certain versions of
libcap-ng set, setexeccon will cause execve to fail.  This also
makes setting selinux context the very last action taken by
seunshare prior to exec, as it may otherwise cause things to fail.

Note that this won't work without adjusting the system policy to
allow this use of setcurrent.  This rule appears to work:

    allow unconfined_t sandbox_t:process dyntransition;

although a better rule would probably relax the unconfined_t
restriction.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
libselinux: fix typo in man page
libsemanage: fix src/pywrap-test.py -v -F

Running "libsemanage/src/pywrap-test.py -v -F" gives following error:

    Traceback (most recent call last):
      File "pywrap-test.py", line 1139, in <module>
        sys.exit(main())
      File "pywrap-test.py", line 1121, in main
        tests.run(sh)
      File "pywrap-test.py", line 107, in run
        self.test_writefcontext(handle)
      File "pywrap-test.py", line 622, in test_writefcontext
        if self.verbose: print "SEFContext type set: ", semanage.semanage_fcontext_get_type_str(fcon)
    TypeError: in method 'semanage_fcontext_get_type_str', argument 1 of type 'int'

The argument of semanage_fcontext_get_type_str is the type recorded in
fcon and not fcon itself.  This type can be retrieved with
semanage_fcontext_get_type.
libsemanage: use semanage_bool_get_value to print a boolean

... and not semanage_bool_set_value.

This fixes "python2 pywrap-test.py -v -B -C"
Add db_exception and db_datatype support to label_db backend

Hi,

in https://github.com/TresysTechnology/refpolicy/pull/1 db_exception
and db_datatype were added to reference policy. This small patch
extends ability of label_db backend to work with these objects.

Regards.
Log an error on unknown classes and permissions.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
libsemanage: fix typo in tests makefile -o -> -O

Fixed typo in the tests Makefile where '-o' should have been '-O'.

Signed-off-by: Chad Sellers <csellers@tresys.com>
libsemanage: only try to compile file contexts if they exist

It is not a requirement that all file context files exists (e.g.
file_contexts.local is not mandatory). However, sefcontext_compile is
executed for all file contexts files regardless of existance, which
results in an error when they do not exist and causes policy load to
fail. This modifies libsemanage so that sefcontext_compile is only
executed on file contexts that do exist.

Signed-off-by: Steve Lawrence <slawrence@tresys.com>
libsemanage: fix memory leak when setting a custom store_path

A strdup was setting store_path without freeing the original
value in the semanage conf.

Signed-off-by: Yuli Khodorkovskiy <ykhodorkovskiy@tresys.com>
Revert "libsemanage: Cleanup/fix enable/disable/remove module."

This reverts commit c9b09be4244f3c90cee19d9e3feca324f0e0e636.
Revert "libsemanage: Use default semanage.conf as a fallback"

This reverts commit 4120df1c6ea85aa56ed602e46a4030d9e4e45ee6.
Revert "libsemanage: Alternate path for semanage.conf"

This reverts commit 66dd98b83a519840a26be7fa5644c982524f3bf7.
Revert "libsemanage: change module disabled from rename to symlink"

This reverts commit 60c780ffb6e7a48a2121e871ad20471a8fe0337d.
Revert "fixes to commit 847d27b8385ce77ac71df8aa58a2d298b33d1ea4"

This reverts commit c1323f22c7ad93b975eb8b6a251b893bc88f240f.
Revert "Last attempt at upstreaming semodule_disable patch."

This reverts commit 654dcb897e49908a958dae55cf29793412c4b390.

Conflicts:

	policycoreutils/semodule/semodule.c
Revert "policycoreutils: semodule: support for alternative root paths"

This reverts commit 5e096d9ceb637a785d4537555799602a3de2b3dc.

Conflicts:

	policycoreutils/semodule/semodule.c