[oe-commits] Chen Qi : extrausers.bbclass: avoid infinite loop
git at git.openembedded.org
git at git.openembedded.org
Wed Nov 6 11:02:41 UTC 2013
Module: openembedded-core.git
Branch: master
Commit: bf4fb345a9db306fa4c7211b7e6795334a649dd5
URL: http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=bf4fb345a9db306fa4c7211b7e6795334a649dd5
Author: Chen Qi <Qi.Chen at windriver.com>
Date: Wed Nov 6 10:50:43 2013 +0800
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 at windriver.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
meta/classes/extrausers.bbclass | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/meta/classes/extrausers.bbclass b/meta/classes/extrausers.bbclass
index 8670a2a..faf57b1 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-`
More information about the Openembedded-commits
mailing list