From 342d82096a8d75cc84190f1a5af826261c6b8c13 Mon Sep 17 00:00:00 2001 From: Enrico Jörns Date: Tue, 10 Sep 2024 22:52:26 +0200 Subject: libconfuse: add backported patch to fix search path logic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The fix is required to deal with absolute paths when using genimage in openembedded context. Signed-off-by: Enrico Jörns Signed-off-by: Khem Raj --- ...y-search-path-logic-to-relative-pathnames.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch (limited to 'meta-oe/recipes-support/libconfuse/files') diff --git a/meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch b/meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch new file mode 100644 index 0000000000..aa9fab86e6 --- /dev/null +++ b/meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch @@ -0,0 +1,48 @@ +From b684f4cc25821b6e86a58576f864e4b12dfdfecc Mon Sep 17 00:00:00 2001 +From: Rasmus Villemoes +Date: Sat, 5 Jun 2021 22:57:51 +0200 +Subject: [PATCH] only apply search path logic to relative pathnames + +Adding any directory to the search path via cfg_add_searchpath breaks +lookup of absolute paths. So change the logic in cfg_searchpath() to +ignore the search path when the given filename is absolute, and merely +check that for existence. + +This is technically an ABI change, but the current behaviour is quite +unusual and unexpected. + +Upstream-Status: Backport [https://github.com/libconfuse/libconfuse/pull/155] + +Signed-off-by: Rasmus Villemoes +--- + src/confuse.c | 8 ++++++++ + 1 file changed, 8 insertions(+) + +diff --git a/src/confuse.c b/src/confuse.c +index 2ea0254..19b56e3 100644 +--- a/src/confuse.c ++++ b/src/confuse.c +@@ -1746,12 +1746,20 @@ DLLIMPORT char *cfg_searchpath(cfg_searchpath_t *p, const char *file) + return NULL; + } + ++ if (file[0] == '/') { ++ fullpath = strdup(file); ++ if (!fullpath) ++ return NULL; ++ goto check; ++ } ++ + if ((fullpath = cfg_searchpath(p->next, file)) != NULL) + return fullpath; + + if ((fullpath = cfg_make_fullpath(p->dir, file)) == NULL) + return NULL; + ++check: + #ifdef HAVE_SYS_STAT_H + err = stat((const char *)fullpath, &st); + if ((!err) && S_ISREG(st.st_mode)) +-- +2.31.1 + -- cgit v1.2.3-54-g00ecf