From: Paul Eggleton Date: Fri, 13 Dec 2013 14:42:46 +0000 (+0000) Subject: shadow: change to use SHA512 password encryption X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~35145 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9e072f9f0da774411e07abf47dd4bd8c6d685d7;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git shadow: change to use SHA512 password encryption The default encryption method for shadow is DES, which limits passwords to 8 characters. Not only is this undesirable, it's also not how busybox works so we had different passwd/login length behaviour depending on whether shadow was installed in the image or not. Change it to SHA512 which is what most Linux distributions seem to be using currently. (SHA512 also matches up with how we are configuring PAM.) Fixes [YOCTO #5656]. Signed-off-by: Paul Eggleton Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-extended/shadow/shadow.inc b/meta/recipes-extended/shadow/shadow.inc index 33ecc7db40c..048709edd2b 100644 --- a/meta/recipes-extended/shadow/shadow.inc +++ b/meta/recipes-extended/shadow/shadow.inc @@ -109,6 +109,9 @@ do_install() { # Disable checking emails. sed -i 's/MAIL_CHECK_ENAB/#MAIL_CHECK_ENAB/g' ${D}${sysconfdir}/login.defs + # Use proper encryption for passwords + sed -i 's/^#ENCRYPT_METHOD.*$/ENCRYPT_METHOD SHA512/' ${D}${sysconfdir}/login.defs + # Now we don't have a mail system. Disable mail creation for now. sed -i 's:/bin/bash:/bin/sh:g' ${D}${sysconfdir}/default/useradd sed -i '/^CREATE_MAIL_SPOOL/ s:^:#:' ${D}${sysconfdir}/default/useradd