]> xenbits.xensource.com Git - libvirt.git/commitdiff
Report all errors in SELinuxRestoreSecurityFileLabel
authorJiri Denemark <jdenemar@redhat.com>
Fri, 30 Apr 2010 11:35:15 +0000 (13:35 +0200)
committerJiri Denemark <jdenemar@redhat.com>
Fri, 30 Apr 2010 12:27:42 +0000 (14:27 +0200)
src/security/security_selinux.c

index 3e204754da5c28ac396fea2ef2691ddd61ad4745..1aabb20a5c9f96fd1ca238af5be8350f68a920ea 100644 (file)
@@ -364,12 +364,20 @@ SELinuxRestoreSecurityFileLabel(const char *path)
         goto err;
     }
 
-    if (stat(newpath, &buf) != 0)
+    if (stat(newpath, &buf) != 0) {
+        virReportSystemError(errno,
+                             _("cannot stat %s"), newpath);
         goto err;
+    }
 
     if (matchpathcon(newpath, buf.st_mode, &fcon) == 0)  {
         rc = SELinuxSetFilecon(newpath, fcon);
+    } else {
+        virSecurityReportError(VIR_ERR_INTERNAL_ERROR,
+                               _("cannot restore selinux file label for %s"),
+                               newpath);
     }
+
 err:
     VIR_FREE(fcon);
     VIR_FREE(newpath);