alexk / rpms / rpm

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