961b04
From c99f396a5d456520b34c60f43c589ca39a301955 Mon Sep 17 00:00:00 2001
961b04
From: =?UTF-8?q?Renaud=20M=C3=A9trich?= <rmetrich@redhat.com>
961b04
Date: Wed, 14 Nov 2018 13:19:27 +0100
961b04
Subject: [PATCH] fips: removed false-positive 'FATAL: Module xxx not found'
961b04
 error message when kernel provides a generic algo for module
961b04
961b04
Resolves: rhbz#1996019
961b04
---
961b04
 modules.d/01fips/fips.sh | 4 ++--
961b04
 1 file changed, 2 insertions(+), 2 deletions(-)
961b04
961b04
diff --git a/modules.d/01fips/fips.sh b/modules.d/01fips/fips.sh
961b04
index 03da6861..1d57a889 100755
961b04
--- a/modules.d/01fips/fips.sh
961b04
+++ b/modules.d/01fips/fips.sh
961b04
@@ -77,7 +77,7 @@ fips_load_crypto()
961b04
     mv /etc/modprobe.d/fips.conf /etc/modprobe.d/fips.conf.bak
961b04
     for _module in $FIPSMODULES; do
961b04
         if [ "$_module" != "tcrypt" ]; then
961b04
-            if ! modprobe "${_module}"; then
961b04
+            if ! modprobe "${_module}" 2>/tmp/fips.modprobe_err; then
961b04
                 # check if kernel provides generic algo
961b04
                 _found=0
961b04
                 while read _k _s _v || [ -n "$_k" ]; do
961b04
@@ -86,7 +86,7 @@ fips_load_crypto()
961b04
                     _found=1
961b04
                     break
961b04
                 done 
961b04
-                [ "$_found" = "0" ] && return 1
961b04
+                [ "$_found" = "0" ] && cat /tmp/fips.modprobe_err >&2 && return 1
961b04
             fi
961b04
         fi
961b04
     done
961b04