diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-11-06 10:50:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-12-12 17:00:10 +0000 |
commit | 5d6fdbde7b7f962911245acf45d249f728956fda (patch) | |
tree | 3d9fc9270007c9707819e91c57901f1aafb1fdc9 /meta/classes | |
parent | bd80aac5255fa91d2429c3ba9d4d27180493c8e0 (diff) | |
download | poky-5d6fdbde7b7f962911245acf45d249f728956fda.tar.gz |
extrausers.bbclass: avoid infinite loop
Avoid infinite loop if the last record in EXTRA_USRES_PARAMS doesn't
end with a semicolon.
It's possible the the users will write configurations like below.
INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "useradd tester; useradd developer"
In such situation, the do_rootfs task will enter an infinite loop.
An infinite loop is never acceptable.
This patch fixes the above problem.
(From OE-Core master rev: bf4fb345a9db306fa4c7211b7e6795334a649dd5)
(From OE-Core rev: 05f9c15abb0705cd9f8aa28bfb3016485730b643)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/extrausers.bbclass | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/extrausers.bbclass b/meta/classes/extrausers.bbclass index 8670a2a85a..faf57b108e 100644 --- a/meta/classes/extrausers.bbclass +++ b/meta/classes/extrausers.bbclass | |||
@@ -54,6 +54,10 @@ set_user_group () { | |||
54 | bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd" | 54 | bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd" |
55 | ;; | 55 | ;; |
56 | esac | 56 | esac |
57 | # Avoid infinite loop if the last parameter doesn't end with ';' | ||
58 | if [ "$setting" = "$remaining" ]; then | ||
59 | break | ||
60 | fi | ||
57 | # iterate to the next setting | 61 | # iterate to the next setting |
58 | setting=`echo $remaining | cut -d ';' -f1` | 62 | setting=`echo $remaining | cut -d ';' -f1` |
59 | remaining=`echo $remaining | cut -d ';' -f2-` | 63 | remaining=`echo $remaining | cut -d ';' -f2-` |