#21 Use absolute path in reflink plugin
Merged 12 days ago by dcavalca. Opened 12 days ago by teknoraver.
rpms/ teknoraver/rpm c9s-sig-hyperscale  into  c9s-sig-hyperscale

file added
+41
@@ -0,0 +1,41 @@ 

+ From 4a17a8f52732cf508a35d2686591b0b7df9c000b Mon Sep 17 00:00:00 2001

+ From: Matteo Croce <teknoraver@meta.com>

+ Date: Thu, 5 Dec 2024 23:12:19 +0100

+ Subject: [PATCH] absoute path

+ 

+ Adapt rpmpluginsCallFsmFileInstall to use absolute path

+ 

+ ---

+  lib/rpmplugins.c | 4 +++-

+  1 file changed, 3 insertions(+), 1 deletion(-)

+ 

+ diff --git a/lib/rpmplugins.c b/lib/rpmplugins.c

+ index 4b86320..1418aed 100644

+ --- a/lib/rpmplugins.c

+ +++ b/lib/rpmplugins.c

+ @@ -444,12 +444,13 @@ rpmRC rpmpluginsCallFsmFileInstall(rpmPlugins plugins, rpmfi fi,

+      int i;

+      rpmRC rc = RPMRC_OK;

+      rpmRC hook_rc;

+ +    char *apath = abspath(fi, path);

+  

+      for (i = 0; i < plugins->count; i++) {

+  	rpmPlugin plugin = plugins->plugins[i];

+  	RPMPLUGINS_SET_HOOK_FUNC(fsm_file_install);

+  	if (hookFunc) {

+ -	    hook_rc = hookFunc(plugin, fi, path, file_mode, op);

+ +	    hook_rc = hookFunc(plugin, fi, apath, file_mode, op);

+  	    if (hook_rc == RPMRC_FAIL) {

+  		rpmlog(RPMLOG_ERR, "Plugin %s: hook fsm_file_install failed\n", plugin->name);

+  		rc = RPMRC_FAIL;

+ @@ -467,6 +468,7 @@ rpmRC rpmpluginsCallFsmFileInstall(rpmPlugins plugins, rpmfi fi,

+  	    }

+  	}

+      }

+ +    free(apath);

+  

+      return rc;

+  }

+ -- 

+ 2.47.1

+ 

file modified
+5 -1
@@ -32,7 +32,7 @@ 

  

  %global rpmver 4.16.1.3

  #global snapver rc1

- %global rel 34.3

+ %global rel 34.4

  %global sover 9

  

  %global srcver %{rpmver}%{?snapver:-%{snapver}}
@@ -150,6 +150,7 @@ 

  # Copy-on-Write

  Patch9901: 0001-RPM-with-Copy-on-Write.patch

  Patch9902: 0002-plugin-absolute-path.patch

+ Patch9903: 0003-apath.patch

  Provides: rpm(pr1470)

  Provides: rpm(pr1470_1)

  
@@ -728,6 +729,9 @@ 

  %doc doc/librpm/html/*

  

  %changelog

+ * Thu Dec 5 2024 Matteo Croce <teknoraver@meta.com> - 4.16.1.3-34.4

+ - Fix absolute path reflink plugin

+ 

  * Fri Nov 22 2024 Matteo Croce <teknoraver@meta.com> - 4.16.1.3-34.3

  - Squash all CoW patches

  - Fix a path issue with plugins

Use always absolute path in plugin

Pull-Request has been merged by dcavalca

12 days ago
Metadata