Hi Panu, 

 

After a  while break I am back with new problems J with regards to the
plugins. The use case now is like this: 

 

Security plugin has a policy file (generalizing to any plugin, some
configuration file), which is complex enough that can be created/hardcoded
in plugin itself (even in some default values).

This file might come with the plugin or from some special package (plugin
configuration package): reason to keep it a separate package in our case is
that policy can be very different and it is easier to manage it separately
from the actual plugin.

Currently plugin has hardcoded path to where find the policy when it starts
(it checks in the INIT hook) and if policy is missing, it stops the
installation because it is meaningless to proceed without it. 

I never liked the hardcoded policy path at the first place, but now it bring
even bigger problem when you run rpm with "--root" option on the clean dir.
Rpm itself would recover from this quite nicely by creating a clean rpmdb
and proceeding fine, but plugin obviously runs into troubles. 

 

Solving this would seem to have two parts from my understanding: 

 

-          Plugin able to detect when we are in this specific state (run
with -root option, database needs to be created)

-          Plugin able to obtain the correct path of policy file outside of
-root and then nicely set it (I suppose by simply copying to the -root dir).
And here I would like to be able not to hardcode any path, but have it
configurable (that there is a possibility to use other policy that main
policy outside of the -root with hardcoded path)

 

For the first part, I guess the most correct solution like many people
advised is to add a new hook inside rpmtsInitDB() that would indicate to a
plugin the moment it needs to do smth about its policy file. 

Do you see any problems if we add such hook? The place can be just after we
initialized rpm db itself after this line:  rc = rpmdbInit(ts->rootDir,
dbmode);

 

One thing that I can see if that this new hook would be called after plugin
INIT hook and in the INIT hook I can't longer simply check that my policy is
missing and abort, I have to still return ok and then maybe hoping that it
is the initDB hook that would be called and create missing policy. And if it
doesn't, then I have to keep checking for missing policy and do its
initialization in pre_tsm hook for example. So, kind of not that clean
anymore compare to having it all in one INIT hook. 

 

The second part is more troublesome. What do you think should be a proper
way of passing the info to a plugin about where its policy file is? Should
it be done via macro configuration?

 

Best Regards,
Elena.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to