dropbear: add option to set max auth tries
authorStijn Tintel <stijn@linux-ipv6.be>
Tue, 27 Jun 2017 20:30:01 +0000 (22:30 +0200)
committerStijn Tintel <stijn@linux-ipv6.be>
Wed, 28 Jun 2017 00:18:20 +0000 (02:18 +0200)
Add a uci option to set the new max auth tries paramater in dropbear.
Set the default to 3, as 10 seems excessive.

Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
package/network/services/dropbear/Makefile
package/network/services/dropbear/files/dropbear.init

index 05df1bc6ac9665dca2321ce2bd92b7e8f60402a0..7302db273c9db4768c9eeaf8f4b631e4bd74446c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=dropbear
 PKG_VERSION:=2017.75
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:= \
index 2d23ebd04568cff2d98ff9f6cae6c800d50c8152..3d8cb2ca5e372121e3f1c29fa5aca3d49e6c5a10 100755 (executable)
@@ -41,6 +41,7 @@ validate_section_dropbear()
                'Port:list(port):22' \
                'SSHKeepAlive:uinteger:300' \
                'IdleTimeout:uinteger:0' \
+               'MaxAuthTries:uinteger:3' \
                'mdns:bool:1'
 }
 
@@ -49,7 +50,7 @@ dropbear_instance()
        local PasswordAuth enable Interface GatewayPorts \
                RootPasswordAuth RootLogin rsakeyfile \
                BannerFile Port SSHKeepAlive IdleTimeout \
-               mdns ipaddrs
+               MaxAuthTries mdns ipaddrs
 
        validate_section_dropbear "${1}" || {
                echo "validation failed"
@@ -78,6 +79,7 @@ dropbear_instance()
        append_ports "${ipaddrs}" "${Port}"
        [ "${IdleTimeout}" -ne 0 ] && procd_append_param command -I "${IdleTimeout}"
        [ "${SSHKeepAlive}" -ne 0 ] && procd_append_param command -K "${SSHKeepAlive}"
+       [ "${MaxAuthTries}" -ne 0 ] && procd_append_param command -T "${MaxAuthTries}"
        [ "${mdns}" -ne 0 ] && procd_add_mdns "ssh" "tcp" "$Port" "daemon=dropbear"
        procd_set_param respawn
        procd_close_instance