summaryrefslogtreecommitdiffstats
path: root/meta/classes/useradd.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-23 10:32:23 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-05-23 10:33:45 +0100
commitc7e614c438706fb3ed7520b4990ebb3973366942 (patch)
tree2325a634b85fe9b5ecd31e0d6e47f9f588283b41 /meta/classes/useradd.bbclass
parent32bbf685709d2c6c0d8938e18ef21130d1ea8eef (diff)
downloadpoky-c7e614c438706fb3ed7520b4990ebb3973366942.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) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/useradd.bbclass')
-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}