summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/glibc/cross-localedef-native_2.30.bb
diff options
context:
space:
mode:
authorJason Wessel <jason.wessel@windriver.com>2019-08-16 14:06:04 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-08-21 15:29:02 +0100
commitfb20d734612d403b3e41a1a781714fd5f63f7e35 (patch)
treeb3e4c200161b65d85798005202aaa1ff62314292 /meta/recipes-core/glibc/cross-localedef-native_2.30.bb
parent10d40f5971fd64810d0256bfbe175b717398ef03 (diff)
downloadopenembedded-core-contrib-fb20d734612d403b3e41a1a781714fd5f63f7e35.tar.gz
cross-localedef-native: Add hardlink resolver from util-linux
The hard link resolver that is built into localedef cannot be run in parallel. It will search sibling directories (which are be processed in parallel) and perform a creation of a .tmp file and remove the original and move the .tmp file in. The problem is that if a probe occurs a hard link can be requested to the file that is being removed. This will lead to a stray copy or potentially, on a loaded system cause race condition which pseudo cannot deal with, where it is left with a hard link request to a file that no longer exists. In this situation psuedo will inherit the permissions of what ever the target inode had to offer. In short, there are two problems: 1) You will be left with stray copies when using the hard link resolution that is built in while running in parallel with localedef. 2) When running under pseudo the possibility exists for uid/gid leakage when the source file is removed before the hard link can be completed. The solution is to call localedef with --no-hard-links and separately process the hardlinks at a later point. To do this requires the inclusion of the hardlink utility found in modern versions of util-linux. Most host systems do not have this, so it will be included with the cross-localedef binary. There are two patches here. The first imports the raw version of hardlink.c and a couple of header files directly from util-linux. The second patch applies the fix-ups to make it compile, along with a change to recipe to package the new binary. [YOCTO #11299] [YOCTO #12434] (From OE-Core rev: 57e2e498ffb675d274aa95b10c14bd81742d2761) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glibc/cross-localedef-native_2.30.bb')
-rw-r--r--meta/recipes-core/glibc/cross-localedef-native_2.30.bb3
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc/cross-localedef-native_2.30.bb b/meta/recipes-core/glibc/cross-localedef-native_2.30.bb
index e4923c73d5..29cd43e89a 100644
--- a/meta/recipes-core/glibc/cross-localedef-native_2.30.bb
+++ b/meta/recipes-core/glibc/cross-localedef-native_2.30.bb
@@ -30,6 +30,8 @@ SRC_URI = "${GLIBC_GIT_URI};branch=${SRCBRANCH};name=glibc \
file://0022-eglibc-Forward-port-cross-locale-generation-support.patch \
file://0023-Define-DUMMY_LOCALE_T-if-not-defined.patch \
file://0024-localedef-add-to-archive-uses-a-hard-coded-locale-pa.patch \
+ file://add-cross-localedef-hardlink.patch \
+ file://allow-compile-separate-from-util-linux-hardlink.patch \
"
# Makes for a rather long rev (22 characters), but...
#
@@ -43,4 +45,5 @@ CFLAGS += "-fgnu89-inline -std=gnu99 -DIS_IN\(x\)='0'"
do_install() {
install -d ${D}${bindir}
install -m 0755 ${B}/localedef ${D}${bindir}/cross-localedef
+ install -m 0755 ${B}/cross-localedef-hardlink ${D}${bindir}/cross-localedef-hardlink
}