Blame SOURCES/0001-Rearrange-lxc-test-to-avoid-use-of-cat.patch

b853a2
From a29d4a5632ff9f60f939e4f0f36ce97ed43c5650 Mon Sep 17 00:00:00 2001
b853a2
From: "Richard W.M. Jones" <rjones@redhat.com>
b853a2
Date: Thu, 22 Dec 2022 10:31:47 +0000
b853a2
Subject: [PATCH] Rearrange lxc test to avoid use of cat
b853a2
b853a2
Thanks: Elias Probst <e.probst@ssc-services.de>
b853a2
---
b853a2
 virt-what.in | 3 ++-
b853a2
 1 file changed, 2 insertions(+), 1 deletion(-)
b853a2
b853a2
diff --git a/virt-what.in b/virt-what.in
b853a2
index d090898e5..170bc24ab 100644
b853a2
--- a/virt-what.in
b853a2
+++ b/virt-what.in
b853a2
@@ -175,7 +175,8 @@ fi
b853a2
 # Added by Marc Fournier
b853a2
 
b853a2
 if [ -e "${root}/proc/1/environ" ] &&
b853a2
-    cat "${root}/proc/1/environ" | tr '\000' '\n' | grep -Eiq '^container=lxc'; then
b853a2
+    tr '\000' '\n' < "${root}/proc/1/environ" |
b853a2
+        grep -Eiq '^container=lxc'; then
b853a2
     echo lxc
b853a2
 fi
b853a2
 
b853a2
-- 
b853a2
2.31.1
b853a2