From f8d6e274edcbc4ee109d90cc8e5880081a7ddd40 Mon Sep 17 00:00:00 2001 From: Zoltan Fridrich Date: Wed, 15 Dec 2021 14:13:56 +0100 Subject: [PATCH] Expand libc detection Resolves: rhbz#2015307 --- fapolicyd-detect-sharedlib.patch | 11 +++++++++++ fapolicyd.spec | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 fapolicyd-detect-sharedlib.patch diff --git a/fapolicyd-detect-sharedlib.patch b/fapolicyd-detect-sharedlib.patch new file mode 100644 index 0000000..9ac38a8 --- /dev/null +++ b/fapolicyd-detect-sharedlib.patch @@ -0,0 +1,11 @@ +diff --color -ru a/src/library/file.c b/src/library/file.c +--- a/src/library/file.c 2021-11-12 20:21:54.000000000 +0100 ++++ b/src/library/file.c 2021-12-15 12:40:05.088564218 +0100 +@@ -295,6 +295,7 @@ + if (!strncmp(p, "64", 2)) + p += 2; + if (!strncmp(p, "/libc-2", 7) || ++ !strncmp(p, "/libc.so", 8) || + !strncmp(p, "/libpthread-2", 13)) + ptr = "application/x-sharedlib"; + } diff --git a/fapolicyd.spec b/fapolicyd.spec index 7969e47..4d77892 100644 --- a/fapolicyd.spec +++ b/fapolicyd.spec @@ -5,7 +5,7 @@ Summary: Application Whitelisting Daemon Name: fapolicyd Version: 1.0.4 -Release: 100%{?dist} +Release: 101%{?dist} License: GPLv3+ URL: http://people.redhat.com/sgrubb/fapolicyd Source0: https://people.redhat.com/sgrubb/fapolicyd/%{name}-%{version}.tar.gz @@ -36,6 +36,7 @@ Patch3: fapolicyd-do-manage-files.patch Patch4: fapolicyd-documentation.patch Patch5: fapolicyd-fix-escaping.patch Patch6: fapolicyd-trust-file-append.patch +Patch7: fapolicyd-detect-sharedlib.patch %description Fapolicyd (File Access Policy Daemon) implements application whitelisting @@ -86,6 +87,7 @@ Don't use dnf and rpm plugin together. %patch4 -p1 -b .documentation %patch5 -p1 -b .fix-escaping %patch6 -p1 -b .trust-file-append +%patch7 -p1 -b .detect-sharedlib sed -i "s/%python2_path%/`readlink -f %{__python2} | sed 's/\//\\\\\//g'`/g" init/%{name}.rules.* sed -i "s/%python3_path%/`readlink -f %{__python3} | sed 's/\//\\\\\//g'`/g" init/%{name}.rules.* @@ -214,7 +216,7 @@ fi %changelog -* Tue Dec 14 2021 Zoltan Fridrich - 1.0.4-100 +* Tue Dec 14 2021 Zoltan Fridrich - 1.0.4-101 RHEL 9.0.0 ERRATUM - rebase to 1.0.4 - added rpm_sha256_only option