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