diff options
author | toni <matzeton@googlemail.com> | 2016-11-07 22:52:08 +0100 |
---|---|---|
committer | toni <matzeton@googlemail.com> | 2016-11-07 22:52:08 +0100 |
commit | 11b6c945957a4e098a75c9c4ba585258d602bdbc (patch) | |
tree | d3b0bdd985fe154ffdf78f5dbbf067e16896b1d2 | |
parent | 4e338a981b229e6a87a2561806f0690d37c53145 (diff) |
multiarch support, shutdown if maxtries
-rwxr-xr-x | debian/naskpass.postinst | 2 | ||||
-rwxr-xr-x | scripts/naskpass.inithook | 14 | ||||
-rwxr-xr-x | scripts/naskpass.initscript | 3 |
3 files changed, 9 insertions, 10 deletions
diff --git a/debian/naskpass.postinst b/debian/naskpass.postinst index 981f62b..c61fe1c 100755 --- a/debian/naskpass.postinst +++ b/debian/naskpass.postinst @@ -27,7 +27,7 @@ case "$1" in if [ -x /usr/bin/ssh-keygen ]; then [ -r /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key ] || /usr/bin/ssh-keygen -t rsa -N '' -b 4096 -f /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key [ -r /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key ] || /usr/bin/ssh-keygen -t dsa -N '' -b 1024 -f /etc/initramfs-tools/etc/ssh/ssh_host_dsa_key - [ -r /etc/initramfs-tools/etc/ssh/authorized_keys ] || touch /etc/initramfs-tools/etc/ssh/authorized_keys + [ -r /etc/initramfs-tools/etc/ssh/authorized_keys ] || cat /etc/initramfs-tools/etc/ssh/ssh_host_rsa_key.pub >/etc/initramfs-tools/etc/ssh/authorized_keys fi update-initramfs -u ;; diff --git a/scripts/naskpass.inithook b/scripts/naskpass.inithook index 0e3d427..aaf6e7b 100755 --- a/scripts/naskpass.inithook +++ b/scripts/naskpass.inithook @@ -1,7 +1,5 @@ #!/bin/sh -set -e - PREREQ="cryptroot" prereqs () { @@ -29,18 +27,16 @@ copy_exec /usr/share/naskpass/naskpass.initconf /etc/naskpass.conf copy_exec /usr/sbin/sshd /sbin/sshd cp -R /etc/initramfs-tools/etc/ssh "${DESTDIR}/etc/" -copy_exec /usr/lib/i386-linux-gnu/libnss_compat.so /usr/lib/i386-linux-gnu/ +copy_exec /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/libnss_compat.so /usr/lib/$(dpkg-architecture -q DEB_HOST_MULTIARCH)/ if [ -r "${DESTDIR}/etc/nsswitch.conf" ]; then -echo << EOF >"${DESTDIR}/etc/nsswitch.conf" -passwd: compat -group: compat -shadow: compat -EOF +echo "passwd: compat" > "${DESTDIR}/etc/nsswitch.conf" +echo "group: compat" >>"${DESTDIR}/etc/nsswitch.conf" +echo "shadow: compat" >>"${DESTDIR}/etc/nsswitch.conf" fi [ -r "${DESTDIR}/etc/passwd" ] || echo 'root:x:0:0:root:/root:/bin/naskshell' >"${DESTDIR}/etc/passwd" [ -r "${DESTDIR}/etc/group" ] || echo 'root:x:0:' >"${DESTDIR}/etc/group" -[ -r "${DESTDIR}/etc/shadow" ] || echo 'root:*:16777:0:99999:7:::' >"${DESTDIR}/etc/shadow" +[ -r "${DESTDIR}/etc/shadow" ] || echo 'root:*:15446:0:99999:7:::' >"${DESTDIR}/etc/shadow" mkdir -p ${DESTDIR}/lib/terminfo/l cp /lib/terminfo/l/linux ${DESTDIR}/lib/terminfo/l/ diff --git a/scripts/naskpass.initscript b/scripts/naskpass.initscript index 4158aba..a3c5438 100755 --- a/scripts/naskpass.initscript +++ b/scripts/naskpass.initscript @@ -374,6 +374,9 @@ setup_mapping() if [ $crypttries -gt 0 ] && [ $count -gt $crypttries ]; then message "cryptsetup: maximum number of tries exceeded for $crypttarget" + message "shutdown in 3 seconds" + sleep 3 + echo "o" > /proc/sys/kernel/sysrq return 1 fi |