[Rpm-maint] [PATCH v2 4/4] IMA: Move the IMA plugin to the fsm_post hook
Stefan Berger
stefanb at linux.vnet.ibm.com
Thu Sep 22 17:30:58 UTC 2016
Move the IMA plugin to the fsm_post hook. Check whether the given
return code indicates and error, and do nothing in case it does
show an error. There is nothing to clean up, so we can do that.
Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
---
plugins/ima.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/plugins/ima.c b/plugins/ima.c
index 4a419b0..8dfc04d 100644
--- a/plugins/ima.c
+++ b/plugins/ima.c
@@ -35,7 +35,7 @@ static int check_zero_hdr(const unsigned char *fsig, size_t siglen)
return (memcmp(fsig, &zero_hdr, sizeof(zero_hdr)) == 0);
}
-static rpmRC ima_psm_post(rpmPlugin plugin, rpmte te, int res)
+static rpmRC ima_fsm_post(rpmPlugin plugin, rpmte te, int res)
{
rpmfi fi = rpmteFI(te);
const char *fpath;
@@ -44,7 +44,7 @@ static rpmRC ima_psm_post(rpmPlugin plugin, rpmte te, int res)
int rc = 0, n;
struct stat statbuf;
- if (rpmteType(te) != TR_ADDED)
+ if (res || rpmteType(te) != TR_ADDED)
return 0;
if (fi == NULL) {
@@ -75,5 +75,5 @@ exit:
}
struct rpmPluginHooks_s ima_hooks = {
- .psm_post = ima_psm_post,
+ .fsm_post = ima_fsm_post,
};
--
2.5.5
More information about the Rpm-maint
mailing list