Sha256: 8d752d4e9c517d0963a8a350c46e40dfae3be54db244810848726dd1cbea00d9

Contents?: true

Size: 722 Bytes

Versions: 11

Compression:

Stored size: 722 Bytes

Contents

require_relative 'command_handler'

module Ftpd

  class CmdEpsv < CommandHandler

    def cmd_epsv(argument)
      ensure_logged_in
      if data_server
        reply "200 Already in passive mode"
      else
        if argument == 'ALL'
          self.epsv_all = true
          reply "220 EPSV now required for port setup"
        else
          protocol_code = argument && argument.to_i
          if protocol_code
            ensure_protocol_supported protocol_code
          end
          interface = socket.addr[3]
          self.data_server = TCPServer.new(interface, 0)
          port = data_server.addr[1]
          reply "229 Entering extended passive mode (|||#{port}|)"
        end
      end
    end

  end

end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
ftpd-1.1.1 lib/ftpd/cmd_epsv.rb
ftpd-1.1.0 lib/ftpd/cmd_epsv.rb
investtools-ftpd-1.0.1 lib/ftpd/cmd_epsv.rb
ftpd-1.0.1 lib/ftpd/cmd_epsv.rb
ftpd-1.0.0 lib/ftpd/cmd_epsv.rb
ftpd-0.17.0 lib/ftpd/cmd_epsv.rb
ftpd-0.16.0 lib/ftpd/cmd_epsv.rb
ftpd-0.15.0 lib/ftpd/cmd_epsv.rb
ftpd-0.14.0 lib/ftpd/cmd_epsv.rb
ftpd-0.13.0 lib/ftpd/cmd_epsv.rb
ftpd-0.12.0 lib/ftpd/cmd_epsv.rb