diff options
Diffstat (limited to 'meta/classes/image.bbclass')
-rw-r--r-- | meta/classes/image.bbclass | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass index e49468949e..0293d2e358 100644 --- a/meta/classes/image.bbclass +++ b/meta/classes/image.bbclass | |||
@@ -167,6 +167,8 @@ inherit ${IMAGE_CLASSES} | |||
167 | IMAGE_POSTPROCESS_COMMAND ?= "" | 167 | IMAGE_POSTPROCESS_COMMAND ?= "" |
168 | MACHINE_POSTPROCESS_COMMAND ?= "" | 168 | MACHINE_POSTPROCESS_COMMAND ?= "" |
169 | ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; " | 169 | ROOTFS_POSTPROCESS_COMMAND_prepend = "run_intercept_scriptlets; " |
170 | # Allow dropbear/openssh to accept logins from accounts with an empty password string if debug-tweaks is enabled | ||
171 | ROOTFS_POSTPROCESS_COMMAND += '${@base_contains("IMAGE_FEATURES", "debug-tweaks", "ssh_allow_empty_password; ", "",d)}' | ||
170 | 172 | ||
171 | # some default locales | 173 | # some default locales |
172 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" | 174 | IMAGE_LINGUAS ?= "de-de fr-fr en-gb" |
@@ -396,12 +398,22 @@ zap_root_password () { | |||
396 | mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd | 398 | mv ${IMAGE_ROOTFS}/etc/passwd.new ${IMAGE_ROOTFS}/etc/passwd |
397 | } | 399 | } |
398 | 400 | ||
399 | # allow openssh accept login with empty password string | 401 | # allow dropbear/openssh to accept root logins and logins from accounts with an empty password string |
400 | openssh_allow_empty_password () { | 402 | ssh_allow_empty_password () { |
401 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then | 403 | if [ -e ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config ]; then |
402 | sed -i 's#.*PermitRootLogin.*#PermitRootLogin yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config | 404 | sed -i 's#.*PermitRootLogin.*#PermitRootLogin yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config |
403 | sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config | 405 | sed -i 's#.*PermitEmptyPasswords.*#PermitEmptyPasswords yes#' ${IMAGE_ROOTFS}${sysconfdir}/ssh/sshd_config |
404 | fi | 406 | fi |
407 | |||
408 | if [ -e ${IMAGE_ROOTFS}${sbindir}/dropbear ] ; then | ||
409 | if grep -q DROPBEAR_EXTRA_ARGS ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear 2>/dev/null ; then | ||
410 | if ! grep -q "DROPBEAR_EXTRA_ARGS=.*-B" ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear ; then | ||
411 | sed -i 's/^DROPBEAR_EXTRA_ARGS="*\([^"]*\)"*/DROPBEAR_EXTRA_ARGS="\1 -B"/' ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear | ||
412 | fi | ||
413 | else | ||
414 | printf '\nDROPBEAR_EXTRA_ARGS="-B"\n' >> ${IMAGE_ROOTFS}${sysconfdir}/default/dropbear | ||
415 | fi | ||
416 | fi | ||
405 | } | 417 | } |
406 | 418 | ||
407 | # Turn any symbolic /sbin/init link into a file | 419 | # Turn any symbolic /sbin/init link into a file |