summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-28 21:27:35 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-09-29 11:00:51 +0100
commited4ed5313bce5f4e0c5b3c6f342171472553ab59 (patch)
tree2c04e42d51f3897cacbb10b34526b227bd6d79e4
parentde056577cef465d92b4f9be0bc67694228d4d5ca (diff)
downloadpoky-ed4ed5313bce5f4e0c5b3c6f342171472553ab59.tar.gz
useradd: Fix infinite build loop
http://git.openembedded.org/openembedded-core-contrib/commit/?id=642c6cf0b6a0371de476513162bd0cefa9c438b3 introduces a problem if the USERADD_PARAM variable has trailing whitespace as the code infinitely loops causing build hangs. Add a similar sed expression to $remaining to avoid this. (From OE-Core rev: d6241e4c94a0a72acfc57e96a59918c0b2146d65) (From OE-Core rev: 0900fed3fb6eec62e9e25f6d03af934f9776d105) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/useradd.bbclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/useradd.bbclass b/meta/classes/useradd.bbclass
index 67dae880b7..28dd341bf7 100644
--- a/meta/classes/useradd.bbclass
+++ b/meta/classes/useradd.bbclass
@@ -55,14 +55,14 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then
55 # Invoke multiple instances of groupadd for parameter lists 55 # Invoke multiple instances of groupadd for parameter lists
56 # separated by ';' 56 # separated by ';'
57 opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 57 opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
58 remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-` 58 remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
59 while test "x$opts" != "x"; do 59 while test "x$opts" != "x"; do
60 perform_groupadd "$SYSROOT" "$OPT $opts" 60 perform_groupadd "$SYSROOT" "$OPT $opts"
61 if test "x$opts" = "x$remaining"; then 61 if test "x$opts" = "x$remaining"; then
62 break 62 break
63 fi 63 fi
64 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 64 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
65 remaining=`echo "$remaining" | cut -d ';' -f 2-` 65 remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
66 done 66 done
67fi 67fi
68 68
@@ -71,14 +71,14 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then
71 # Invoke multiple instances of useradd for parameter lists 71 # Invoke multiple instances of useradd for parameter lists
72 # separated by ';' 72 # separated by ';'
73 opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 73 opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
74 remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-` 74 remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
75 while test "x$opts" != "x"; do 75 while test "x$opts" != "x"; do
76 perform_useradd "$SYSROOT" "$OPT $opts" 76 perform_useradd "$SYSROOT" "$OPT $opts"
77 if test "x$opts" = "x$remaining"; then 77 if test "x$opts" = "x$remaining"; then
78 break 78 break
79 fi 79 fi
80 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 80 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
81 remaining=`echo "$remaining" | cut -d ';' -f 2-` 81 remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
82 done 82 done
83fi 83fi
84 84
@@ -87,14 +87,14 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then
87 # Invoke multiple instances of groupmems for parameter lists 87 # Invoke multiple instances of groupmems for parameter lists
88 # separated by ';' 88 # separated by ';'
89 opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 89 opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
90 remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-` 90 remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
91 while test "x$opts" != "x"; do 91 while test "x$opts" != "x"; do
92 perform_groupmems "$SYSROOT" "$OPT $opts" 92 perform_groupmems "$SYSROOT" "$OPT $opts"
93 if test "x$opts" = "x$remaining"; then 93 if test "x$opts" = "x$remaining"; then
94 break 94 break
95 fi 95 fi
96 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` 96 opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'`
97 remaining=`echo "$remaining" | cut -d ';' -f 2-` 97 remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'`
98 done 98 done
99fi 99fi
100} 100}