diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2013-11-06 10:50:43 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-11-06 11:01:18 +0000 |
commit | bf4fb345a9db306fa4c7211b7e6795334a649dd5 (patch) | |
tree | 2b4efb0685e325b92bbdfb5bacdff0b264748b34 /meta/classes/extrausers.bbclass | |
parent | d62882794890eeee8e8d5c9ba4837ec77a58d787 (diff) | |
download | openembedded-core-bf4fb345a9db306fa4c7211b7e6795334a649dd5.tar.gz openembedded-core-bf4fb345a9db306fa4c7211b7e6795334a649dd5.tar.bz2 openembedded-core-bf4fb345a9db306fa4c7211b7e6795334a649dd5.zip |
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.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/extrausers.bbclass')
-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 () { bbfatal "Invalid command in EXTRA_USERS_PARAMS: $cmd" ;; esac + # Avoid infinite loop if the last parameter doesn't end with ';' + if [ "$setting" = "$remaining" ]; then + break + fi # iterate to the next setting setting=`echo $remaining | cut -d ';' -f1` remaining=`echo $remaining | cut -d ';' -f2-` |