[PATCH 1/1] Checking the value returned by the function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The virSecuritySELinuxSetFilecon function (by definition) always returns values 0 or -1.
The result of this function is written to 'ret'.
The code compares the value of the variable 'ret' with 1.

Signed-off-by: Sergey Mironov <mironov@xxxxxxxxxx>
---
 src/security/security_selinux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 7914aba84d..7bff780ddf 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -1988,7 +1988,7 @@ virSecuritySELinuxSetImageLabelInternal(virSecurityManager *mgr,
         ret = virSecuritySELinuxSetFilecon(mgr, path, use_label, remember);
     }
 
-    if (ret == 1 && !disk_seclabel) {
+    if (ret == -1 && !disk_seclabel) {
         /* If we failed to set a label, but virt_use_nfs let us
          * proceed anyway, then we don't need to relabel later.  */
         disk_seclabel = virSecurityDeviceLabelDefNew(SECURITY_SELINUX_NAME);
-- 
2.31.1





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux