[Rpm-maint] [PATCH 5/5] Add a generic plugin for use by simple Collections
Steve Lawrence
slawrence at tresys.com
Wed Jun 23 13:10:08 UTC 2010
On Wed, 2010-06-23 at 14:40 +0300, Panu Matilainen wrote:
> On Fri, 18 Jun 2010, Panu Matilainen wrote:
> >
> >> +rpmRC COLLHOOK_POST_ANY_FUNC(rpmts ts, const char * collname, const char *
> >> options)
> >> +{
> >> + int rc = RPMRC_FAIL;
> >> +
> >> + if (rpmChrootSet(rpmtsRootDir(ts)) || rpmChrootIn()) {
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > [snip]
> >> + if (rpmChrootOut() || rpmChrootSet(NULL)) {
> > ^^^^^^^^^^^^^^^^^^^^^
> >
> > These look highly suspect, rpmChrootSet() is done already from rpmtsSetup()
> > and rpmtsFinish(), everything between those shouldn't need anything more than
> > just rpmChrootIn() and rpmChrootOut(). Calling rpmChrootSet(NULL) makes it
> > forget the cwd so further rpmChrootIn/Out calls will fail.
>
> Eek... I just realized why you were needing the rpmChrootSet():
>
> exec_la_SOURCES = collection.h ../lib/rpmchroot.c exec.c
>
> So the plugin is using a private copy of rpmchroot and thus doesn't share
> the librpm internal state. Obviously enough this is because rpmChrootFoo()
> are RPM_GNUC_INTERNAL and so aren't usable for the plugin otherwise...
>
> The chroot interface would logically belong to librpmio but as nothing was
> needing it outside of librpm, I thought to keep it private at least until
> the API has seen enough shakedown to be considered stable.
>
> For now, I'll just drop the RPM_GNUC_INTERNAL from rpmChrootIn() and
> rpmChrootOut() so the plugins are able to use the librpm code instead of
> carrying their private chroot state. Do you think you'll need
> rpmChrootDone() too in the SELinux plugin?
>
Yep, the selinux plugin does need rpmChrootDone().
More information about the Rpm-maint
mailing list