diff mbox series

[OpenWrt-Devel,v3] dropbear: move failsafe code out of base-files

Message ID mailman.12647.1574189453.2486.openwrt-devel@lists.openwrt.org
State Accepted
Delegated to: John Crispin
Headers show
Series [OpenWrt-Devel,v3] dropbear: move failsafe code out of base-files | expand

Commit Message

hurrhnn--- via openwrt-devel Nov. 19, 2019, 6:50 p.m. UTC
The sender domain has a DMARC Reject/Quarantine policy which disallows
sending mailing list messages using the original "From" header.

To mitigate this problem, the original message has been wrapped
automatically by the mailing list software.
Failsafe code of dropbear should be in the dropbear package not the
base-files package.

Signed-off-by: Kyle Copperfield <kmcopper@danwin1210.me>
---
 package/base-files/Makefile                               | 2 +-
 package/base-files/files/lib/preinit/99_10_failsafe_login | 6 ------
 package/network/services/dropbear/Makefile                | 3 ++-
 package/network/services/dropbear/files/dropbear.failsafe | 8 ++++++++
 4 files changed, 11 insertions(+), 8 deletions(-)
 create mode 100755 package/network/services/dropbear/files/dropbear.failsafe

Comments

John Crispin Jan. 15, 2020, 7:03 p.m. UTC | #1
Merged, thanks !
diff mbox series

Patch

diff --git a/package/base-files/Makefile b/package/base-files/Makefile
index 0ca4d739f3..cf5166772d 100644
--- a/package/base-files/Makefile
+++ b/package/base-files/Makefile
@@ -12,7 +12,7 @@  include $(INCLUDE_DIR)/version.mk
 include $(INCLUDE_DIR)/feeds.mk
 
 PKG_NAME:=base-files
-PKG_RELEASE:=209
+PKG_RELEASE:=210
 PKG_FLAGS:=nonshared
 
 PKG_FILE_DEPENDS:=$(PLATFORM_DIR)/ $(GENERIC_PLATFORM_DIR)/base-files/
diff --git a/package/base-files/files/lib/preinit/99_10_failsafe_login b/package/base-files/files/lib/preinit/99_10_failsafe_login
index 728c63b2e8..16ad84f4ba 100644
--- a/package/base-files/files/lib/preinit/99_10_failsafe_login
+++ b/package/base-files/files/lib/preinit/99_10_failsafe_login
@@ -2,11 +2,6 @@ 
 # Copyright (C) 2006-2015 OpenWrt.org
 # Copyright (C) 2010 Vertical Communications
 
-failsafe_netlogin () {
-	dropbearkey -t rsa -s 1024 -f /tmp/dropbear_failsafe_host_key
-	dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
-}
-
 failsafe_shell() {
 	local console="$(sed -e 's/ /\n/g' /proc/cmdline | grep '^console=' | head -1 | sed -e 's/^console=//' -e 's/,.*//')"
 	[ -n "$console" ] || console=console
@@ -17,5 +12,4 @@  failsafe_shell() {
 	done &
 }
 
-boot_hook_add failsafe failsafe_netlogin
 boot_hook_add failsafe failsafe_shell
diff --git a/package/network/services/dropbear/Makefile b/package/network/services/dropbear/Makefile
index 75a3264ebb..ec4b355268 100644
--- a/package/network/services/dropbear/Makefile
+++ b/package/network/services/dropbear/Makefile
@@ -9,7 +9,7 @@  include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
 PKG_VERSION:=2019.78
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
@@ -156,6 +156,7 @@  define Package/dropbear/install
 	$(INSTALL_BIN) ./files/dropbear.init $(1)/etc/init.d/dropbear
 	$(INSTALL_DIR) $(1)/usr/lib/opkg/info
 	$(INSTALL_DIR) $(1)/etc/dropbear
+	$(INSTALL_DIR) ./files/dropbear.failsafe $(1)/lib/preinit/99_10_failsafe_dropbear
 	$(if $(CONFIG_DROPBEAR_ECC),touch $(1)/etc/dropbear/dropbear_ecdsa_host_key)
 	touch $(1)/etc/dropbear/dropbear_rsa_host_key
 endef
diff --git a/package/network/services/dropbear/files/dropbear.failsafe b/package/network/services/dropbear/files/dropbear.failsafe
new file mode 100755
index 0000000000..a98ede459a
--- /dev/null
+++ b/package/network/services/dropbear/files/dropbear.failsafe
@@ -0,0 +1,8 @@ 
+#!/bin/sh
+
+failsafe_dropbear () {
+	dropbearkey -t rsa -s 1024 -f /tmp/dropbear_failsafe_host_key
+	dropbear -r /tmp/dropbear_failsafe_host_key <> /dev/null 2>&1
+}
+
+boot_hook_add failsafe failsafe_dropbear