Move restorecon and restorecon_recursive code to libselinux.

This requires telling libselinux to use the sehandle already
obtained by init rather than re-acquiring it internally.  init
retains ownership of the sehandle because it performs the
initial load, uses the sehandle for other purposes (e.g. labeling
of directories created via mkdir and labeling of socket files),
and handles the policy reload property trigger.

Unify the restorecon code previously duplicated between init and libselinux.

Change-Id: I4a380caab7f8481c33eb64fcdb16b6cabe918ebd
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2 files changed
tree: 14a63dac889fb7d6d66e3049d0d43bd982e3d4a7
  1. include/
  2. src/
  3. Android.mk
  4. NOTICE