diff options
author | Steve Lawrence <slawrence@tresys.com> | 2010-08-30 16:32:30 -0400 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-01 09:30:51 +0300 |
commit | 34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd (patch) | |
tree | e58f17ba0e83e9a17c88f6ba77380ff30e48c0cc /system.h | |
parent | 383e27564853fd4c387ca1d4a69f223140a0daca (diff) | |
download | librpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.tar.gz librpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.tar.bz2 librpm-tizen-34b5d67c2d3d68a48f0975dc6111a8c184d1c2dd.zip |
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.
Diffstat (limited to 'system.h')
-rw-r--r-- | system.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -78,6 +78,7 @@ char * stpncpy(char * dest, const char * src, size_t n); #if WITH_SELINUX #include <selinux/selinux.h> +#include <selinux/label.h> #else typedef char * security_context_t; @@ -92,6 +93,10 @@ typedef char * security_context_t; #define matchpathcon_fini() (0) #define matchpathcon(_fn, _fm, _c) (-1) +#define selabel_lookup_raw(_hnd, _scon, _key,_type) (-1) + +#define selinux_file_context_path() (0) + #define rpm_execcon(_v, _fn, _av, _envp) (0) #endif |