Skip to contentSkip to conversation

image.bbclass: Make zap_root_password to disable root's password not the user root itself.

PATCH In review Khem Raj 2 participants 2 messages May 26, 2010

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 image.bbclass: Make zap_root_password to disable root's password not the user root itself.

* With shadow now running pwconv after commit 7c5f81b2139e55622ca2f23ff6b63438d4825d87 It converts :*: passwd entry into equivalent /etc/shadow entry :*:
which in shadow means disable the account as per
http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/shadow-file-formats.html
As a result root can not login unless one boots into shell and then resets the password.

---
 classes/image.bbclass |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
classes/image.bbclass +1 -1
index f695d3c..2105195 100644
@@ -205,7 +205,7 @@ log_check() {
 # can decide if they want it or not
 
 zap_root_password () {
-	sed 's%^root:[^:]*:%root:*:%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new
+	sed 's%^root:[^:]*:%root::%' < ${IMAGE_ROOTFS}/etc/passwd >${IMAGE_ROOTFS}/etc/passwd.new
 	mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd
 } 
 
Signature · 1 line
1.7.0.4
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Khem Raj

* With shadow now running pwconv after commit 7c5f81b2139e55622ca2f23ff6b63438d4825d87
It converts :*: passwd entry into equivalent /etc/shadow entry :*:
which in shadow means disable the account as per

http://tldp.org/LDP/lame/LAME/linux-admin-made-easy/shadow-file-formats.html
As a result root can not login unless one boots into shell and then resets the password.

Seems reasonable.

Signature · 5 lines
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics