summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Denemark <jdenemar@redhat.com>2010-04-30 13:35:15 +0200
committerJiri Denemark <jdenemar@redhat.com>2010-04-30 14:27:42 +0200
commitc90a1ad7d01f38598663e08335c4a553546d5291 (patch)
treed15b2ba2a36a4ba9ab0dabf0f435470027a3a2d2
parentPrevent updates while IP address learn thread is running (diff)
downloadlibvirt-c90a1ad7d01f38598663e08335c4a553546d5291.tar.gz
libvirt-c90a1ad7d01f38598663e08335c4a553546d5291.tar.bz2
libvirt-c90a1ad7d01f38598663e08335c4a553546d5291.zip
Report all errors in SELinuxRestoreSecurityFileLabel
-rw-r--r--src/security/security_selinux.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c
index 3e204754d..1aabb20a5 100644
--- a/src/security/security_selinux.c
+++ b/src/security/security_selinux.c
@@ -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);