Ticket #9819: dropbear-bind.patch

File dropbear-bind.patch, 1.1 KB (added by pharaoh <pharaoh@…>, 7 years ago)
  • /tmp/dropbear

    old new  
    3232        local passauth 
    3333        config_get_bool passauth "${section}" PasswordAuth 1 
    3434        [ "${passauth}" -eq 0 ] && nopasswd=1 
    35         # B) listen port 
     35        # B1) bind address 
     36        local interface 
     37        config_get interface "${section}" Interface 
     38        local bindaddr 
     39        bindaddr=$(uci_get network.${interface}.ipaddr) 
     40        # B2) listen port 
    3641        local port 
    37         config_get port "${section}" Port 
     42        config_get port "${section}" Port 22 
    3843        # C) banner file 
    3944        local bannerfile 
    4045        config_get bannerfile "${section}" BannerFile 
     
    5055        [ "${rootpassauth}" -eq 0 ] && norootpasswd=1 
    5156        # concatenate parameters 
    5257        local args 
    53         args="${nopasswd:+-s }${norootpasswd:+-g }${port:+-p ${port} }${bannerfile:+-b $bannerfile }${gatewayports:+-a }-P /var/run/${NAME}.${PIDCOUNT}.pid" 
     58        args="${nopasswd:+-s }${norootpasswd:+-g }${port:+-p ${bindaddr:+${bindaddr}:}${port} }${bannerfile:+-b $bannerfile }${gatewayports:+-a }-P /var/run/${NAME}.${PIDCOUNT}.pid" 
    5459 
    5560        # execute program and return its exit code 
    5661        [ "${verbosed}" -ne 0 ] && echo "${initscript}: section ${section} starting ${PROG} ${args}"