mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
FTPD: make sure that the passive ip, if provided, is valid
The server will refuse to start if the provided passive ip is not a valid IPv4 address. Fixes #376
This commit is contained in:
@@ -83,6 +83,9 @@ func (s *Server) cleanTLSConnVerification(id uint32) {
|
||||
|
||||
// GetSettings returns FTP server settings
|
||||
func (s *Server) GetSettings() (*ftpserver.Settings, error) {
|
||||
if err := s.binding.checkPassiveIP(); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var portRange *ftpserver.PortRange
|
||||
if s.config.PassivePortRange.Start > 0 && s.config.PassivePortRange.End > s.config.PassivePortRange.Start {
|
||||
portRange = &ftpserver.PortRange{
|
||||
|
||||
Reference in New Issue
Block a user