summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/rpm
diff options
context:
space:
mode:
authorMing Liu <ming.liu@windriver.com>2014-10-21 19:10:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-10-24 17:36:16 +0100
commit9f33c2858c4192ade4d80091448b1513467196d6 (patch)
tree411531eb94abcf107d6f2bd42a7e98199e7f6df2 /meta/recipes-devtools/rpm/rpm
parent4c222d3a67bae265ff42b448ef4a643b0131e578 (diff)
downloadast2050-yocto-poky-9f33c2858c4192ade4d80091448b1513467196d6.zip
ast2050-yocto-poky-9f33c2858c4192ade4d80091448b1513467196d6.tar.gz
rpm: realpath is required before expanding _dbpath in chroot
A regression is introduced by commit 66573093: [ rpm: Fix rpm relocation macro usage ] _usr turned out to be a relative path to support dyanmic config after that, but it's being used somewhere as a indicator to locate substrings, so we must get the real path of it in advance. (From OE-Core rev: 1247955a907f51aac7efd305d26856e263c11a65) Signed-off-by: Ming Liu <ming.liu@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm/rpm')
-rw-r--r--meta/recipes-devtools/rpm/rpm/rpm-realpath.patch24
1 files changed, 24 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
new file mode 100644
index 0000000..d2d9b09
--- /dev/null
+++ b/meta/recipes-devtools/rpm/rpm/rpm-realpath.patch
@@ -0,0 +1,24 @@
+chroot: realpath is required before expanding _dbpath
+
+_usr turned out to be a relative path to support dyanmic config, but it's
+being used somewhere as a indicator to locate substrings, so we must get
+the real path of it in advance.
+
+Upstream-Status: Inapproriate (OpenEmbedded specific)
+
+Signed-off-by: Ming Liu <ming.liu@windriver.com>
+
+diff -urpN a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
+--- a/rpmio/rpmrpc.c
++++ b/rpmio/rpmrpc.c
+@@ -257,7 +257,9 @@ int Open(const char * path, int flags, m
+ /* XXX if the open(2) fails, try to strip a possible chroot(2) prefix. */
+ if (fdno < 0 && errno == ENOENT) {
+ const char *dbpath = rpmExpand("%{?_dbpath}/", NULL);
+- const char * fn = strstr(path + 1, dbpath);
++ char resolved_dbpath[PATH_MAX];
++ realpath(dbpath, resolved_dbpath);
++ const char * fn = strstr(path + 1, resolved_dbpath);
+ if (fn)
+ fdno = open(fn, flags, mode);
+ dbpath = _free(dbpath);
OpenPOWER on IntegriCloud