Replace security.evm with security.ima in digest list plugin

This commit is contained in:
Roberto Sassu 2020-07-26 15:09:01 +02:00
parent 4423f52830
commit d85b3deb27

View File

@ -1,4 +1,4 @@
From c3b5c61440a40b4a159e050e25f4b3736f7d0343 Mon Sep 17 00:00:00 2001
From 9b592f7c093d1161aad6abdc9ae00e42b72f15ba Mon Sep 17 00:00:00 2001
From: Roberto Sassu <roberto.sassu@huawei.com>
Date: Wed, 26 Feb 2020 15:54:24 +0100
Subject: [PATCH 2/3] Add digest list plugin
@ -6,10 +6,10 @@ Subject: [PATCH 2/3] Add digest list plugin
---
macros.in | 1 +
plugins/Makefile.am | 4 +
plugins/digest_list.c | 495 ++++++++++++++++++++++++++++++++++++++++++
plugins/digest_list.c | 490 ++++++++++++++++++++++++++++++++++++++++++
rpmio/digest.h | 1 +
rpmio/rpmpgp.c | 3 +
5 files changed, 504 insertions(+)
5 files changed, 499 insertions(+)
create mode 100644 plugins/digest_list.c
diff --git a/macros.in b/macros.in
@ -38,10 +38,10 @@ index d4ef039ed..07aa3585b 100644
+plugins_LTLIBRARIES += digest_list.la
diff --git a/plugins/digest_list.c b/plugins/digest_list.c
new file mode 100644
index 000000000..227ce141e
index 000000000..607987947
--- /dev/null
+++ b/plugins/digest_list.c
@@ -0,0 +1,495 @@
@@ -0,0 +1,490 @@
+#include "system.h"
+#include "errno.h"
+
@ -493,17 +493,12 @@ index 000000000..227ce141e
+ upload_digest_list(path, rpmteType(te), digest_list_signed);
+
+ if (rpmteType(te) == TR_REMOVED) {
+ if (!digest_list_signed) {
+ unlink(path);
+ goto out;
+ }
+
+ ret = lremovexattr(path, XATTR_NAME_EVM);
+ ret = lremovexattr(path, XATTR_NAME_IMA);
+ if (ret < 0)
+ rpmlog(RPMLOG_ERR, "digest_list: cannot remove "
+ "security.evm from '%s'\n", path);
+ "security.ima from '%s'\n", path);
+ else
+ rpmlog(RPMLOG_DEBUG, "digest_list: security.evm "
+ rpmlog(RPMLOG_DEBUG, "digest_list: security.ima "
+ "successfully removed from '%s'\n", path);
+ }
+out: