useradd: Fix infinite build loop
PATCH 1/1 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.
meta/classes/useradd.bbclass +6 -6
@@ -55,14 +55,14 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`" != "x"; then # Invoke multiple instances of groupadd for parameter lists # separated by ';' opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` while test "x$opts" != "x"; do perform_groupadd "$SYSROOT" "$OPT $opts" if test "x$opts" = "x$remaining"; then break fi opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` done fi
@@ -71,14 +71,14 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`" != "x"; then # Invoke multiple instances of useradd for parameter lists # separated by ';' opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` while test "x$opts" != "x"; do perform_useradd "$SYSROOT" "$OPT $opts" if test "x$opts" = "x$remaining"; then break fi opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` done fi
@@ -87,14 +87,14 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`" != "x"; then # Invoke multiple instances of groupmems for parameter lists # separated by ';' opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` while test "x$opts" != "x"; do perform_groupmems "$SYSROOT" "$OPT $opts" if test "x$opts" = "x$remaining"; then break fi opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[ \t]*$##'` - remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e 's#[ \t]*$##'` done fi }
Thanks Richard
Quoted 87 lines · Richard Purdie
http://git.openembedded.org/openembedded-core-contrib/commit/?id=642c6cf0b6a0371de476513162bd0cefa9c438b3
introduces a problem if theUSERADD_PARAMvariable has trailing whitespace as the code infinitely loops causing build hangs.Add a similar sed expression to $remaining to avoid this.
Signed-off-by Richard Purdie <[email protected]>meta/classes/useradd.bbclass +0
-0@@ -55,14 +55,14 @@ if test "x`echo $GROUPADD_PARAM | tr -d '[:space:]'`"!= "x"; then
# Invoke multiple instances of groupadd for parameter lists # separated by ';'
opts=`echo "$GROUPADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$GROUPADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[\t]*$##'`
while test "x$opts" != "x"; do
perform_groupadd"$SYSROOT" "$OPT $opts"
if test "x$opts" = "x$remaining"; then
break
fi
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e's#[ \t]*$##'`
done
fimeta/classes/useradd.bbclass +0
-0@@ -71,14 +71,14 @@ if test "x`echo $USERADD_PARAM | tr -d '[:space:]'`"!= "x"; then
# Invoke multiple instances of useradd for parameter lists # separated by ';'
opts=`echo "$USERADD_PARAM" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$USERADD_PARAM" | cut -d ';' -f 2- | sed -e 's#[\t]*$##'`
while test "x$opts" != "x"; do
perform_useradd"$SYSROOT" "$OPT $opts"
if test "x$opts" = "x$remaining"; then
break
fi
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e's#[ \t]*$##'`
done
fimeta/classes/useradd.bbclass +0
-0@@ -87,14 +87,14 @@ if test "x`echo $GROUPMEMS_PARAM | tr -d '[:space:]'`"!= "x"; then
# Invoke multiple instances of groupmems for parameter lists # separated by ';'
opts=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2-` + remaining=`echo "$GROUPMEMS_PARAM" | cut -d ';' -f 2- | sed -e's#[ \t]*$##'`
while test "x$opts" != "x"; do
perform_groupmems"$SYSROOT" "$OPT $opts"
if test "x$opts" = "x$remaining"; then
break
fi
opts=`echo "$remaining" | cut -d ';' -f 1 | sed -e 's#[
\t]*$##'`meta/classes/useradd.bbclass +1
-1- remaining=`echo "$remaining" | cut -d ';' -f 2-` + remaining=`echo "$remaining" | cut -d ';' -f 2- | sed -e's#[ \t]*$##'`
done
fi
}--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core