<br><tt><font size=2>Stefan Berger <stefanb@linux.vnet.ibm.com> wrote
on 09/21/2016 02:04:08 PM:<br><br>> From: Stefan Berger <stefanb@linux.vnet.ibm.com></font></tt><br><tt><font size=2>> To: rpm-maint@lists.rpm.org</font></tt><br><tt><font size=2>> Cc: fionnuala.gunter@gmail.com, stefanb@linux.vnet.ibm.com,
<br>> zohar@linux.vnet.ibm.com, Stefan Berger/Watson/IBM@IBMUS</font></tt><br><tt><font size=2>> Date: 09/21/2016 02:04 PM</font></tt><br><tt><font size=2>> Subject: [PATCH 3/3] plugins: Pass rpmte to scriptlet_pre
and call <br>> IMA plugin in this hook</font></tt><br><tt><font size=2>> <br>> The IMA plugin needs to also be called before the post installation<br>> scriptlet is run. The reason for this is that some post installation<br>> scriptlets invoke the tools that were just installed. The invocatin<br>> fails, if the signatures have not been applied, yet. Therefore, we<br>> invoke the IMA plugin with the scriptlet_pre hook.<br>> <br>> To be able to do the work in the scriptlet_pre hook, we also need
to<br>> pass the tpmte parameter all the way through.<br>> <br>> An example for an RPM that invokes its own programs is coreutils,<br>> which will invoke /bin/mv in the post installation script.<br>> <br>> Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com><br>> ---<br>>  lib/rpmplugin.h   |  3 ++-<br>>  lib/rpmplugins.c  |  5 +++--<br>>  lib/rpmplugins.h  |  3 ++-<br>>  lib/rpmscript.c   |  5 +++--<br>>  lib/rpmscript.h   |  3 ++-<br>>  lib/transaction.c |  2 +-<br>>  plugins/ima.c     | 10 ++++++++++<br>>  7 files changed, 23 insertions(+), 8 deletions(-)<br>> <br>> diff --git a/lib/rpmplugin.h b/lib/rpmplugin.h<br>> index fd81aec..98205db 100644<br>> --- a/lib/rpmplugin.h<br>> +++ b/lib/rpmplugin.h<br>> @@ -44,7 +44,8 @@ typedef rpmRC (*plugin_tsm_post_func)(rpmPlugin
<br>> plugin, rpmts ts, int res);<br>>  typedef rpmRC (*plugin_psm_pre_func)(rpmPlugin plugin, rpmte
te);<br>>  typedef rpmRC (*plugin_psm_post_func)(rpmPlugin plugin, rpmte
te, int res);<br>>  typedef rpmRC (*plugin_scriptlet_pre_func)(rpmPlugin plugin,<br>> -                  const
char *s_name, int type);<br>> +                  const
char *s_name, int type,<br>> +                  rpmte
te);</font></tt><br><br><br><tt><font size=2>I am obviously modifying a public interface here.
This modification does no harm to other plugins living in the rpm git tree
since none of them is called in this callback hook. Are there any plugins
that live outside the tree that would now not compile anymore? Another
solution would be to introduce a plugin_scriptlet_pre_te_func.</font></tt><br><br><tt><font size=2>   Stefan</font></tt><br><BR>