]> code.ossystems Code Review - openembedded-core.git/commit
cross-localedef-native: Add hardlink resolver from util-linux
authorJason Wessel <jason.wessel@windriver.com>
Fri, 16 Aug 2019 21:06:04 +0000 (14:06 -0700)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Wed, 21 Aug 2019 12:21:46 +0000 (13:21 +0100)
commit57e2e498ffb675d274aa95b10c14bd81742d2761
tree44d7b204aabbda36a6fac690dbb9635249f1eb2c
parent66492f40c23778a5644bc4e7f4acf7e4ef16bf36
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]

Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/recipes-core/glibc/cross-localedef-native_2.30.bb
meta/recipes-core/glibc/glibc/add-cross-localedef-hardlink.patch [new file with mode: 0644]
meta/recipes-core/glibc/glibc/allow-compile-separate-from-util-linux-hardlink.patch [new file with mode: 0644]