[Rpm-maint] [PATCH 4/6] Use selabel interfaces instead of matchpathcon

Panu Matilainen pmatilai at laiskiainen.org
Wed Sep 1 06:02:11 UTC 2010


On Mon, 30 Aug 2010, Steve Lawrence wrote:
> index 50fdd01..d450f45 100644
> --- a/lib/rpmts.h
> +++ b/lib/rpmts.h
> @@ -390,6 +390,27 @@ FD_t rpmtsScriptFd(rpmts ts);
> void rpmtsSetScriptFd(rpmts ts, FD_t scriptFd);
>
> /** \ingroup rpmts
> + * Get the selabel handle from the transaction set
> + * @param ts		transaction set
> + * @return		rpm selabel handle, or NULL if it hasn't been initialized yet
> + */
> +rpm_sehandle_t rpmtsSELabelHandle(rpmts ts);
> +
> diff --git a/system.h b/system.h
> index e34f6d6..94c5253 100644
> --- a/system.h
> +++ b/system.h
> @@ -78,7 +78,10 @@ char * stpncpy(char * dest, const char * src, size_t n);
>
> #if WITH_SELINUX
> #include <selinux/selinux.h>
> +#include <selinux/label.h>
> +typedef struct selable_handle * rpm_sehandle_t;
> #else
> +typedef	void * rpm_sehandle_t;

Mmmh.. okay, I'm officially full of s*** :) The previous version, which I 
complained about, didn't actually have any problems: C is perfectly happy 
with "struct unknown_type *" pointers, but with this typedef in system.h 
rpmts.h is unusable outside of rpm source tree. Maybe I can blame the rpm 
style of typedef'ing struct pointers for my braindamage...

Anyway, I'll apply the non-broken earlier version, apologies for asking 
you to fix what wasn't broken.

 	- Panu -


More information about the Rpm-maint mailing list