From b24f5e8252a2b3f176f03e19fef1d2cda28ef77c Mon Sep 17 00:00:00 2001 From: Jonathan Liu Date: Thu, 10 Apr 2014 18:24:19 +1000 Subject: image.bbclass: improve sed expressions for ssh_allow_empty_password() The sed expression was also replacing documentation text containing PermitRootLogin in the line so "PermitRootLogin yes" was specified twice. (From OE-Core rev: 0572196158d9505a624bdee71760978f284728b0) Signed-off-by: Jonathan Liu Signed-off-by: Richard Purdie --- meta/classes/image.bbclass | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'meta/classes/image.bbclass') diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index 32df01d..79de5a2 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass @@ -285,8 +285,8 @@ zap_empty_root_password () { # allow dropbear/openssh to accept root logins and logins from accounts with an empty password string ssh_allow_empty_password () { if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then - sed -i 's#.*PermitRootLogin.*#PermitRootLogin yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config - sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config + sed -i 's/^[#[:space:]]*PermitRootLogin.*/PermitRootLogin yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config + sed -i 's/^[#[:space:]]*PermitEmptyPasswords.*/PermitEmptyPasswords yes/' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config fi if [ -e ${IMAGE_ROOTFS}${sbindir}/dropbear ] ; then -- cgit v1.1