teknoraver / rpms / rpm

Forked from rpms/rpm 4 months ago
Clone
4bef34
From 4a17a8f52732cf508a35d2686591b0b7df9c000b Mon Sep 17 00:00:00 2001
4bef34
From: Matteo Croce <teknoraver@meta.com>
4bef34
Date: Thu, 5 Dec 2024 23:12:19 +0100
4bef34
Subject: [PATCH] absoute path
4bef34
4bef34
Adapt rpmpluginsCallFsmFileInstall to use absolute path
4bef34
4bef34
---
4bef34
 lib/rpmplugins.c | 4 +++-
4bef34
 1 file changed, 3 insertions(+), 1 deletion(-)
4bef34
4bef34
diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c
4bef34
index 4b86320..1418aed 100644
4bef34
--- a/lib/rpmplugins.c
4bef34
+++ b/lib/rpmplugins.c
4bef34
@@ -444,12 +444,13 @@ rpmRC rpmpluginsCallFsmFileInstall(rpmPlugins plugins, rpmfi fi,
4bef34
     int i;
4bef34
     rpmRC rc = RPMRC_OK;
4bef34
     rpmRC hook_rc;
4bef34
+    char *apath = abspath(fi, path);
4bef34
 
4bef34
     for (i = 0; i < plugins->count; i++) {
4bef34
 	rpmPlugin plugin = plugins->plugins[i];
4bef34
 	RPMPLUGINS_SET_HOOK_FUNC(fsm_file_install);
4bef34
 	if (hookFunc) {
4bef34
-	    hook_rc = hookFunc(plugin, fi, path, file_mode, op);
4bef34
+	    hook_rc = hookFunc(plugin, fi, apath, file_mode, op);
4bef34
 	    if (hook_rc == RPMRC_FAIL) {
4bef34
 		rpmlog(RPMLOG_ERR, "Plugin %s: hook fsm_file_install failed\n", plugin->name);
4bef34
 		rc = RPMRC_FAIL;
4bef34
@@ -467,6 +468,7 @@ rpmRC rpmpluginsCallFsmFileInstall(rpmPlugins plugins, rpmfi fi,
4bef34
 	    }
4bef34
 	}
4bef34
     }
4bef34
+    free(apath);
4bef34
 
4bef34
     return rc;
4bef34
 }
4bef34
-- 
4bef34
2.47.1
4bef34