summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2018-01-15 17:15:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-18 12:50:37 +0000
commit72544a4ca8bb151612bc1f297151bf349c6a2ddc (patch)
tree44407eb461478997b96b27d639a0985947baf9ca /meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch
parentf41020e4f679f974ce4143b138fa9b18cc3e04d0 (diff)
downloadpoky-72544a4ca8bb151612bc1f297151bf349c6a2ddc.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. (From OE-Core rev: f0f92d3d0f42a4a7e521b58dac53e14f9e2572a1) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch')
-rw-r--r--meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch43
1 files changed, 43 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 0000000000..31024bd7e8
--- /dev/null
+++ b/meta/recipes-devtools/rpm/files/0001-Make-configure-cope-with-multiple-users-groups-with-.patch
@@ -0,0 +1,43 @@
1Upstream-Status: Backport [https://github.com/rpm-software-management/rpm/commit/a3652af66fa2a1f272d771323fee019f23d350f5]
2
3From 68a7b60f89419e53a4bd3c412f816f0576ffd8c4 Mon Sep 17 00:00:00 2001
4From: Mike Crowe <mac@mcrowe.com>
5Date: Thu, 4 Jan 2018 14:39:51 +0000
6Subject: [PATCH] Make configure cope with multiple users/groups with ID 0
7
8If /etc/passwd contains multiple users with UID 0 then user_with_uid0 will
9contain a line feed which results in config.h containing:
10
11 #define UID_0_USER "root
12
13(i.e. without a closing quote.)
14
15The same problem occurs with /etc/group.
16
17Let's only emit the first match in each case so that there is only ever a
18single result.
19
20Signed-off-by: Mike Crowe <mac@mcrowe.com>
21
22---
23 configure.ac | 4 ++--
24 1 file changed, 2 insertions(+), 2 deletions(-)
25
26diff --git a/configure.ac b/configure.ac
27index ab8ca4f54..5259ad243 100644
28--- a/configure.ac
29+++ b/configure.ac
30@@ -996,8 +996,8 @@ if test "$with_dmalloc" = yes ; then
31 LIBS="$LIBS -ldmalloc"
32 fi
33
34-user_with_uid0=$(awk -F: '$3==0 {print $1}' /etc/passwd)
35-group_with_gid0=$(awk -F: '$3==0 {print $1}' /etc/group)
36+user_with_uid0=$(awk -F: '$3==0 {print $1;exit}' /etc/passwd)
37+group_with_gid0=$(awk -F: '$3==0 {print $1;exit}' /etc/group)
38 AC_DEFINE_UNQUOTED([UID_0_USER],["$user_with_uid0"],[Get the user name having userid 0])
39 AC_DEFINE_UNQUOTED([GID_0_GROUP],["$group_with_gid0"],[Get the group name having groupid 0])
40
41--
422.11.0
43