From: Michal Privoznik <mprivozn(a)redhat.com>
While use of realpath() is not forbidden, our some of our mocks
already have a test friendly reimplementation of
virFileCanonicalizePath(). Use the latter.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/security/virt-aa-helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/security/virt-aa-helper.c b/src/security/virt-aa-helper.c
index e3802c18be..d4358ebf9c 100644
--- a/src/security/virt-aa-helper.c
+++ b/src/security/virt-aa-helper.c
@@ -712,7 +712,7 @@ vah_add_path(virBuffer *buf, const char *path, const char *perms, bool
recursive
tmp = g_strdup(path);
} else {
pathtmp = g_strdup(path + strlen(pathdir));
- if ((pathreal = realpath(pathdir, NULL)) == NULL) {
+ if (!(pathreal = virFileCanonicalizePath(pathdir))) {
vah_error(NULL, 0, pathdir);
vah_error(NULL, 0, _("could not find realpath"));
return rc;
--
2.49.0