From: Jiri Denemark Date: Fri, 30 Apr 2010 11:35:15 +0000 (+0200) Subject: Report all errors in SELinuxRestoreSecurityFileLabel X-Git-Tag: v0.8.1~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c90a1ad7d01f38598663e08335c4a553546d5291;p=thirdparty%2Flibvirt.git Report all errors in SELinuxRestoreSecurityFileLabel --- diff --git a/src/security/security_selinux.c b/src/security/security_selinux.c index 3e204754da..1aabb20a5c 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);