From: Michal Privoznik Date: Wed, 11 Jun 2025 11:19:12 +0000 (+0200) Subject: virt-aa-helper: Use virFileCanonicalizePath() X-Git-Tag: v11.6.0-rc1~188 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=96f286ef1d129da0af5c10e37d8b9069daaf3d1a;p=thirdparty%2Flibvirt.git virt-aa-helper: Use virFileCanonicalizePath() 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 Reviewed-by: Ján Tomko --- 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;