security-tool/fix-function-allow-rpm-q.patch
gaoyusong b09350d7e2 fix funtion allow rpm -q
(cherry picked from commit 0c1aa1929a7c20b407259dec3942655351598741)
2022-07-29 16:24:54 +08:00

26 lines
697 B
Diff

From ec749d9a85c709779dd0862fdaf8d938ae76a12f Mon Sep 17 00:00:00 2001
From: zhengxiaoxiao <zhengxiaoxiao2@huawei.com>
Date: Mon, 27 Jun 2022 19:58:34 +0800
Subject: [PATCH] fix function allow rpm-q
---
security-tool.sh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security-tool.sh b/security-tool.sh
index e8619f5..0877081 100644
--- a/security-tool.sh
+++ b/security-tool.sh
@@ -687,7 +687,7 @@ function fn_handle_allow()
local prename=$2
local ret=0
- rpm -q "$rpmname"
+ chroot $ROOTFS rpm -q "$rpmname"
if [ $? -eq 0 ]; then
local denyfile="$ROOTFS/etc/$prename.deny"
local allowfile="$ROOTFS/etc/$prename.allow"
--
1.8.3.1