For seclabel remembering we need to have XATTRs and a special
namespace that is accessibly to CAP_SYS_ADMIN only (we don't want
regular users to trick us into restoring to a different label).
And what qemusecuritytest does is it checks whether we have not
left any path behind with XATTRs or not restored to original
seclabel after setAll + restoreAll round trip. But it can hardly
do so if ran on a platform where there's no XATTR namespace we
can use.
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Roman Bolshakov <r.bolshakov@yadro.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
virSecurityManagerVerify;
+# security/security_util.h
+virSecurityXATTRNamespaceDefined;
+
+
# util/glibcompat.h
vir_g_canonicalize_filename;
vir_g_fsync;
#endif /* !XATTR_NAMESPACE */
+bool
+virSecurityXATTRNamespaceDefined(void)
+{
+#ifdef XATTR_NAMESPACE
+ return true;
+#else
+ return false;
+#endif
+}
+
+
static char *
virSecurityGetTimestamp(void)
{
virSecurityMoveRememberedLabel(const char *name,
const char *src,
const char *dst);
+
+bool
+virSecurityXATTRNamespaceDefined(void);
#include "testutils.h"
#include "testutilsqemu.h"
#include "security/security_manager.h"
+#include "security/security_util.h"
#include "conf/domain_conf.h"
#include "qemu/qemu_domain.h"
#include "qemu/qemu_security.h"
qemuTestDriverInit(&driver) < 0)
return -1;
+ if (!virSecurityXATTRNamespaceDefined()) {
+ ret = EXIT_AM_SKIP;
+ goto cleanup;
+ }
+
/* Now fix the secdriver */
virObjectUnref(driver.securityManager);