* [PATCH] image.bbclass: improve sed expressions for ssh_allow_empty_password()
@ 2014-04-10 8:24 Jonathan Liu
0 siblings, 0 replies; only message in thread
From: Jonathan Liu @ 2014-04-10 8:24 UTC (permalink / raw)
To: openembedded-core
The sed expression was also replacing documentation text containing
PermitRootLogin in the line so "PermitRootLogin yes" was specified
twice.
Signed-off-by: Jonathan Liu <net147@gmail.com>
---
meta/classes/image.bbclass | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-04-10 8:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-10 8:24 [PATCH] image.bbclass: improve sed expressions for ssh_allow_empty_password() Jonathan Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox