Use selabel interfaces instead of matchpathcon
authorSteve Lawrence <slawrence@tresys.com>
Mon, 30 Aug 2010 20:32:30 +0000 (16:32 -0400)
committerPanu Matilainen <pmatilai@redhat.com>
Wed, 1 Sep 2010 06:30:51 +0000 (09:30 +0300)
commit34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd
treee58f17ba0e83e9a17c88f6ba77380ff30e48c0cc
parent383e27564853fd4c387ca1d4a69f223140a0daca
Use selabel interfaces instead of matchpathcon

This replaces the old matchpathcon interfaces with the new selabel
interfaces for relabeling files, storing an selabel handle in the
transaction set.

With this change, also comes an added distinction between --nocontexts
being specified and a failure to read the load file contexts.
Previously, there was no distinction, and both cases used the
RPMTRANS_FLAG_NOCONTEXTS flag.

However, with the new policy plugin, it is necessary to make such a
distinction. This is because matchpathcon_init (now selabel interfaces)
can fail at the beginning of the transaction, but succeed later after
new policy is installed. Because of this, we may need to enable/disable
RPMTRANS_FLAG_NOCONTEXTS multiple times. However, because this flag
could also mean --nocontexts, we cannot do that. By storing the selabel
handle in the rpmts, we can easily keep track if the handle has been
successfully created, rather than overloading RPMTRANS_FLAG_NOCONTEXTS
with two meanings.
configure.ac
lib/fsm.c
lib/rpmts.c
lib/rpmts.h
lib/rpmts_internal.h
lib/transaction.c
system.h