diff options
author | Enrico Jörns <ejo@pengutronix.de> | 2024-09-10 22:52:26 +0200 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-09-12 14:16:20 -0700 |
commit | 342d82096a8d75cc84190f1a5af826261c6b8c13 (patch) | |
tree | 0b666a8907dad41cc677e7448ab460558b0d87f6 | |
parent | 5c87230ad035373cd97f7a869d6ada7ebf14e4f6 (diff) | |
download | meta-openembedded-342d82096a8d75cc84190f1a5af826261c6b8c13.tar.gz |
libconfuse: add backported patch to fix search path logic
The fix is required to deal with absolute paths when using genimage in
openembedded context.
Signed-off-by: Enrico Jörns <ejo@pengutronix.de>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r-- | meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch | 48 | ||||
-rw-r--r-- | meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb | 2 |
2 files changed, 50 insertions, 0 deletions
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 000000000..aa9fab86e --- /dev/null +++ b/meta-oe/recipes-support/libconfuse/files/0001-only-apply-search-path-logic-to-relative-pathnames.patch | |||
@@ -0,0 +1,48 @@ | |||
1 | From b684f4cc25821b6e86a58576f864e4b12dfdfecc Mon Sep 17 00:00:00 2001 | ||
2 | From: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
3 | Date: Sat, 5 Jun 2021 22:57:51 +0200 | ||
4 | Subject: [PATCH] only apply search path logic to relative pathnames | ||
5 | |||
6 | Adding any directory to the search path via cfg_add_searchpath breaks | ||
7 | lookup of absolute paths. So change the logic in cfg_searchpath() to | ||
8 | ignore the search path when the given filename is absolute, and merely | ||
9 | check that for existence. | ||
10 | |||
11 | This is technically an ABI change, but the current behaviour is quite | ||
12 | unusual and unexpected. | ||
13 | |||
14 | Upstream-Status: Backport [https://github.com/libconfuse/libconfuse/pull/155] | ||
15 | |||
16 | Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> | ||
17 | --- | ||
18 | src/confuse.c | 8 ++++++++ | ||
19 | 1 file changed, 8 insertions(+) | ||
20 | |||
21 | diff --git a/src/confuse.c b/src/confuse.c | ||
22 | index 2ea0254..19b56e3 100644 | ||
23 | --- a/src/confuse.c | ||
24 | +++ b/src/confuse.c | ||
25 | @@ -1746,12 +1746,20 @@ DLLIMPORT char *cfg_searchpath(cfg_searchpath_t *p, const char *file) | ||
26 | return NULL; | ||
27 | } | ||
28 | |||
29 | + if (file[0] == '/') { | ||
30 | + fullpath = strdup(file); | ||
31 | + if (!fullpath) | ||
32 | + return NULL; | ||
33 | + goto check; | ||
34 | + } | ||
35 | + | ||
36 | if ((fullpath = cfg_searchpath(p->next, file)) != NULL) | ||
37 | return fullpath; | ||
38 | |||
39 | if ((fullpath = cfg_make_fullpath(p->dir, file)) == NULL) | ||
40 | return NULL; | ||
41 | |||
42 | +check: | ||
43 | #ifdef HAVE_SYS_STAT_H | ||
44 | err = stat((const char *)fullpath, &st); | ||
45 | if ((!err) && S_ISREG(st.st_mode)) | ||
46 | -- | ||
47 | 2.31.1 | ||
48 | |||
diff --git a/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb b/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb index ec6d6c7c8..e6f28c7b6 100644 --- a/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb +++ b/meta-oe/recipes-support/libconfuse/libconfuse_3.3.bb | |||
@@ -5,6 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=42fa47330d4051cd219f7d99d023de3a" | |||
5 | SRC_URI = "https://github.com/libconfuse/libconfuse/releases/download/v${PV}/confuse-${PV}.tar.gz" | 5 | SRC_URI = "https://github.com/libconfuse/libconfuse/releases/download/v${PV}/confuse-${PV}.tar.gz" |
6 | SRC_URI[sha256sum] = "3a59ded20bc652eaa8e6261ab46f7e483bc13dad79263c15af42ecbb329707b8" | 6 | SRC_URI[sha256sum] = "3a59ded20bc652eaa8e6261ab46f7e483bc13dad79263c15af42ecbb329707b8" |
7 | 7 | ||
8 | SRC_URI += "file://0001-only-apply-search-path-logic-to-relative-pathnames.patch" | ||
9 | |||
8 | inherit autotools-brokensep pkgconfig gettext | 10 | inherit autotools-brokensep pkgconfig gettext |
9 | 11 | ||
10 | S = "${WORKDIR}/confuse-${PV}" | 12 | S = "${WORKDIR}/confuse-${PV}" |