Remove old rpm digest list

This commit is contained in:
Roberto Sassu 2020-07-28 23:53:47 +02:00
parent 4c6fa874b6
commit 4b81801d7e

View File

@ -1,4 +1,4 @@
From 7b446e502dc35d02ede0cde4499878e43ec498d9 Mon Sep 17 00:00:00 2001
From e49074a4e4bd0699d2c4a5bb3a0dc5ca45e19e12 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 | 493 ++++++++++++++++++++++++++++++++++++++++++
plugins/digest_list.c | 498 ++++++++++++++++++++++++++++++++++++++++++
rpmio/digest.h | 1 +
rpmio/rpmpgp.c | 3 +
5 files changed, 502 insertions(+)
5 files changed, 507 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..465f95997
index 000000000..beb397309
--- /dev/null
+++ b/plugins/digest_list.c
@@ -0,0 +1,493 @@
@@ -0,0 +1,498 @@
+#include "system.h"
+#include "errno.h"
+
@ -496,6 +496,11 @@ index 000000000..465f95997
+ 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_IMA);
+ if (ret < 0)
+ rpmlog(RPMLOG_ERR, "digest_list: cannot remove "