summaryrefslogtreecommitdiff
path: root/dont-remove-ima-xattr-of-parser-when-upgrading.patch
blob: b2e04248ba7fa0d4fc7267bc1ccffbf8d71987db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From 2c27c71952ce3ac61afeabd3ef4e1d182574e905 Mon Sep 17 00:00:00 2001
From: luhuaxin <luhuaxin1@huawei.com>
Date: Tue, 15 Mar 2022 20:54:06 +0800
Subject: [PATCH] dont remove ima xattr of parser when upgrading

Signed-off-by: luhuaxin <luhuaxin1@huawei.com>
---
 plugins/digest_list.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/plugins/digest_list.c b/plugins/digest_list.c
index 0692b5b..1d7ef92 100644
--- a/plugins/digest_list.c
+++ b/plugins/digest_list.c
@@ -576,9 +576,16 @@ static rpmRC digest_list_file_common(rpmPlugin plugin, rpmfi fi,
 	if (!pre && --digest_list_counter)
 		return RPMRC_OK;
 
+	rpmlog(RPMLOG_DEBUG, "process ima digest, pre: %d, action: %d, teType: %d\n",
+		pre, action, rpmteType(cur_te));
 	process_digest_list(cur_te, 0, pre);
-	if (!strcmp(rpmteN(cur_te), "digest-list-tools"))
+	if (!strcmp(rpmteN(cur_te), "digest-list-tools")) {
+		if (pre && rpmteType(cur_te) == TR_REMOVED)
+			return RPMRC_OK;
+
+		rpmlog(RPMLOG_DEBUG, "process parser digest\n");
 		process_digest_list(cur_te, 1, pre);
+	}
 
 	return RPMRC_OK;
 }
-- 
2.33.0