* [PATCH 0/1] extrausers.bbclass: avoid infinite loop
@ 2013-11-06 2:50 Qi.Chen
2013-11-06 2:50 ` [PATCH 1/1] " Qi.Chen
0 siblings, 1 reply; 2+ messages in thread
From: Qi.Chen @ 2013-11-06 2:50 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
The following changes since commit 3e6b57fcfea93fbefd746ba056410409b35c5523:
mdadm: Disable the RUN_DIR check (2013-11-05 22:24:46 +0000)
are available in the git repository at:
git://git.pokylinux.org/poky-contrib ChenQi/extrausers-loop
http://git.pokylinux.org/cgit.cgi/poky-contrib/log/?h=ChenQi/extrausers-loop
Chen Qi (1):
extrausers.bbclass: avoid infinite loop
meta/classes/extrausers.bbclass | 4 ++++
1 file changed, 4 insertions(+)
--
1.7.9.5
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] extrausers.bbclass: avoid infinite loop
2013-11-06 2:50 [PATCH 0/1] extrausers.bbclass: avoid infinite loop Qi.Chen
@ 2013-11-06 2:50 ` Qi.Chen
0 siblings, 0 replies; 2+ messages in thread
From: Qi.Chen @ 2013-11-06 2:50 UTC (permalink / raw)
To: openembedded-core
From: Chen Qi <Qi.Chen@windriver.com>
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>
---
| 4 ++++
1 file changed, 4 insertions(+)
--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-`
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-11-06 2:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-06 2:50 [PATCH 0/1] extrausers.bbclass: avoid infinite loop Qi.Chen
2013-11-06 2:50 ` [PATCH 1/1] " Qi.Chen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox