diff options
author | Mike Crowe <mac@mcrowe.com> | 2018-01-15 17:15:11 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-01-18 12:49:22 +0000 |
commit | f0f92d3d0f42a4a7e521b58dac53e14f9e2572a1 (patch) | |
tree | edb55cd5f4962045f2c249e264751af25d3386da /meta/recipes-devtools/rpm | |
parent | 287446f5c0f3108efc0429bf84be45413970b7a8 (diff) | |
download | openembedded-core-contrib-f0f92d3d0f42a4a7e521b58dac53e14f9e2572a1.tar.gz |
rpm: backport configure fix for multiple users/groups with ID 0
Backport upstream configure fix for hosts that have multiple users with UID
0 or groups with GID 0.
Signed-off-by: Mike Crowe <mac@mcrowe.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm')
-rw-r--r-- | meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch | 43 | ||||
-rw-r--r-- | meta/recipes-devtools/rpm/rpm_4.14.0.bb | 1 |
2 files changed, 44 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch b/meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch new file mode 100644 index 00000000000..31024bd7e8b --- /dev/null +++ b/meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch @@ -0,0 +1,43 @@ +Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/a3652af66fa2a1f272d771323fee019f23d350f5] + +From 68a7b60f89419e53a4bd3c412f816f0576ffd8c4 Mon Sep 17 00:00:00 2001 +From: Mike Crowe <mac@mcrowe.com> +Date: Thu, 4 Jan 2018 14:39:51 +0000 +Subject: [PATCH] Make configure cope with multiple users/groups with ID 0 + +If /etc/passwd contains multiple users with UID 0 then user_with_uid0 will +contain a line feed which results in config.h containing: + + #define UID_0_USER "root + +(i.e. without a closing quote.) + +The same problem occurs with /etc/group. + +Let's only emit the first match in each case so that there is only ever a +single result. + +Signed-off-by: Mike Crowe <mac@mcrowe.com> + +--- + configure.ac | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/configure.ac b/configure.ac +index ab8ca4f54..5259ad243 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -996,8 +996,8 @@ if test "$with_dmalloc" = yes ; then + LIBS="$LIBS -ldmalloc" + fi + +-user_with_uid0=$(awk -F: '$3==0 {print $1}' /etc/passwd) +-group_with_gid0=$(awk -F: '$3==0 {print $1}' /etc/group) ++user_with_uid0=$(awk -F: '$3==0 {print $1;exit}' /etc/passwd) ++group_with_gid0=$(awk -F: '$3==0 {print $1;exit}' /etc/group) + AC_DEFINE_UNQUOTED([UID_0_USER],["$user_with_uid0"],[Get the user name having userid 0]) + AC_DEFINE_UNQUOTED([GID_0_GROUP],["$group_with_gid0"],[Get the group name having groupid 0]) + +-- +2.11.0 + diff --git a/meta/recipes-devtools/rpm/rpm_4.14.0.bb b/meta/recipes-devtools/rpm/rpm_4.14.0.bb index e4e9c3e6341..aa2579e3bfd 100644 --- a/meta/recipes-devtools/rpm/rpm_4.14.0.bb +++ b/meta/recipes-devtools/rpm/rpm_4.14.0.bb @@ -40,6 +40,7 @@ SRC_URI = "git://github.com/rpm-software-management/rpm;branch=rpm-4.14.x \ file://0003-rpmstrpool.c-make-operations-over-string-pools-threa.patch \ file://0004-build-pack.c-remove-static-local-variables-from-buil.patch \ file://0001-perl-disable-auto-reqs.patch \ + file://0001-Make-configure-cope-with-multiple-users-groups-with-.patch \ " PE = "1" |