alexk / rpms / rpm

Forked from rpms/rpm 2 years ago
Clone
83a7c7
From 66e0c929b203d684a4f58135f42435fcc29cdd51 Mon Sep 17 00:00:00 2001
83a7c7
Message-Id: <66e0c929b203d684a4f58135f42435fcc29cdd51.1554982695.git.pmatilai@redhat.com>
83a7c7
From: Panu Matilainen <pmatilai@redhat.com>
83a7c7
Date: Wed, 10 Oct 2018 12:00:19 +0300
83a7c7
Subject: [PATCH] Fix testing for wrong variable in selinux plugin debug log
83a7c7
83a7c7
The strerror() case couldn't be reached as we were testing for the
83a7c7
wrong rc, spotted by covscan.
83a7c7
---
83a7c7
 plugins/selinux.c | 2 +-
83a7c7
 1 file changed, 1 insertion(+), 1 deletion(-)
83a7c7
83a7c7
diff --git a/plugins/selinux.c b/plugins/selinux.c
83a7c7
index 3c9d9e4ab..accd47416 100644
83a7c7
--- a/plugins/selinux.c
83a7c7
+++ b/plugins/selinux.c
83a7c7
@@ -169,7 +169,7 @@ static rpmRC selinux_fsm_file_prepare(rpmPlugin plugin, rpmfi fi,
83a7c7
 
83a7c7
 	    if (rpmIsDebug()) {
83a7c7
 		rpmlog(RPMLOG_DEBUG, "lsetfilecon: (%s, %s) %s\n",
83a7c7
-		       path, scon, (rc < 0 ? strerror(errno) : ""));
83a7c7
+		       path, scon, (conrc < 0 ? strerror(errno) : ""));
83a7c7
 	    }
83a7c7
 
83a7c7
 	    if (conrc == 0 || (conrc < 0 && errno == EOPNOTSUPP))
83a7c7
-- 
83a7c7
2.20.1
83a7c7