From cbd2aa532182ed07e1dd9ecbd38889dba8fa0fc9 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Wed, 9 Nov 2016 14:23:31 +1300 Subject: [PATCH] mvo's patch to show a message until a user has a password --- bin/console-conf-ssh-login-only | 2 ++ bin/console-conf-wrapper | 12 ++++++++++++ debian/console-conf.console-conf@.service | 1 - debian/console-conf.install | 1 + 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 bin/console-conf-ssh-login-only diff --git a/bin/console-conf-ssh-login-only b/bin/console-conf-ssh-login-only new file mode 100644 index 00000000..161dec57 --- /dev/null +++ b/bin/console-conf-ssh-login-only @@ -0,0 +1,2 @@ +Please login to this system via ssh. + diff --git a/bin/console-conf-wrapper b/bin/console-conf-wrapper index 0ea28b65..c788712d 100755 --- a/bin/console-conf-wrapper +++ b/bin/console-conf-wrapper @@ -8,6 +8,18 @@ trap true HUP INT QUIT TSTP # happened and need to force it on. Yay UNIX! stty icrnl -echo +# check if we have extrausers that have no password set +if grep -qE '^[-a-z0-9+.-_]+:x:' /var/lib/extrausers/passwd && ! grep -qE '^[-a-z0-9+.-_]+:\$[0-9]+\$.*:' /var/lib/extrausers/shadow; then + cat /usr/share/subiquity/console-conf-ssh-login-only + # FIXME: do something better + read REPLY +fi + +# all done and the user has a password +if [ -e /var/lib/console-conf/complete ]; then + exit 0 +fi + if [ "$(snap managed)" = "true" ]; then touch /var/lib/console-conf/complete exit 0 diff --git a/debian/console-conf.console-conf@.service b/debian/console-conf.console-conf@.service index b2399d9f..162148de 100644 --- a/debian/console-conf.console-conf@.service +++ b/debian/console-conf.console-conf@.service @@ -4,7 +4,6 @@ After=systemd-user-sessions.service plymouth-quit-wait.service After=rc-local.service IgnoreOnIsolate=yes ConditionPathExists=/dev/tty0 -ConditionPathExists=!/var/lib/console-conf/complete [Service] Environment=PYTHONPATH=/usr/share/subiquity diff --git a/debian/console-conf.install b/debian/console-conf.install index fb8829f4..32f5112e 100644 --- a/debian/console-conf.install +++ b/debian/console-conf.install @@ -1,4 +1,5 @@ bin/console-conf-tui usr/share/subiquity bin/console-conf-wait usr/share/subiquity +bin/console-conf-ssh-login-only usr/share/subiquity bin/console-conf-wrapper usr/share/subiquity usr/share/subiquity/console_conf