Граф коммитов

66 Коммитов

Автор SHA1 Сообщение Дата
shugo c55200763d Extend timeout for CI.
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/266962

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-21 23:28:15 +00:00
nagachika 6d3f72e5be Fix a command injection vulnerability in Net::FTP.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-14 13:41:30 +00:00
shugo 04594937eb remove unnecessary read_timeout.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-06 23:56:04 +00:00
shugo 65c0f47f7e Remove unnecessary read_timeout.
http://ci.rvm.jp/results/trunk-asserts-nopara@ruby-sky1/219867

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-12-05 00:59:40 +00:00
ko1 a9b001a4eb skip openssl related tests.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-16 04:23:10 +00:00
shugo 7a5ad716d0 Specify the socktype explicitly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 05:05:54 +00:00
shugo 94e8036b85 Use 127.0.0.1 if getaddrinfo fails.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-04 04:53:33 +00:00
shugo 071d3ae301 Use IPv6 if it's preferred.
I hope this fix makes tests faster on Windows.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56973 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-03 15:41:14 +00:00
shugo fa7066f818 Suppress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29 08:44:21 +00:00
shugo c6f58ef198 Ignore SystemCallError in case it is raised by SSLSocket#accept.
Errno::ECONNRESET was raised by test_tls_post_connection_check and
test_tls_unknown_ca on mswin64 CI.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29 08:31:39 +00:00
shugo 7242e6a9b6 net/ftp: add a new option ssl_handshake_timeout to Net::FTP.new.
The TLS handshake timeout can be specified independently, because the TLS
handshake doesn't start just after the underlying connection is established,
but after the AUTH command is completed.  It's also useful for testing
purposes.  However, if ssl_handshake_timeout is not specified, open_timeout
is used instead for convenience.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-29 02:47:11 +00:00
usa f2a1f32f48 hide exceptions in server thread
* test/net/ftp/test_ftp.rb (test_tls_connect_timeout): sleeping to give a chance of complete of accept is a timing issue at all.  therefore, simply ignore the exception.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-28 10:17:03 +00:00
usa 8e7e71d63e Give a chance to complete server.accept
* test/net/ftp/test_ftp.rb (test_tls_connect_timeout): get rid of a test error on Windows.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-28 03:14:07 +00:00
shugo 473d0d3211 net/ftp: support timeout for TLS handshake.
Net::FTP inherits ssl_socket_connect from Net::Protocol to implement timeout.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56898 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-26 09:29:11 +00:00
shugo c0652defae rescue Errno::EPROTOTYPE in FTPTest#test_list_read_timeout_exceeded.
Errno::EPROTOTYPE is sometimes raised on Mac OS X 10.10.
[ruby-core:78066] [Bug #12914]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56882 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-23 05:26:18 +00:00
shugo e50266f299 Add a new optinal argument pathname to FTP#stat.
Based on the patch by soleboxy.
[Fix GH-1478] [ruby-core:78240] [Feature #12965]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-23 00:03:27 +00:00
shugo d59bfb2d06 Add BufferedSSLSocket#send.
SSLSocket#send is not defined, so use #write instead.  flags and dest are
ignored.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56871 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-22 05:17:45 +00:00
shugo 30cc5ce4bd Add new options open_timeout and read_timeout to Net::FTP.new.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-21 10:38:31 +00:00
shugo fb8628ecda remote_address should be called on @bare_sock.
Because @sock.remote_address fails if @sock is an SSLSocket.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56847 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-20 01:49:25 +00:00
shugo 77403c88cd Expand abbreviated option names.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19 07:02:32 +00:00
shugo fc446ac016 Move certificates to test/net/fixtures/.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56836 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19 02:37:39 +00:00
shugo eb8c73adbc Support TLS and hash styles options for Net::FTP.new.
If the :ssl options is specified, the control connection is protected with
TLS in the manner described in RFC 4217.  Data connections are also
protected with TLS unless the :private_data_connection is set to false.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-19 02:29:23 +00:00
shugo af36e316d7 ftp.rb: use Addrinfo interfaces
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-15 08:16:45 +00:00
shugo 34a0e098f7 * lib/net/ftp.rb (putline): raise an ArgumentError when
CR or LF is included in a line.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-07-05 22:14:18 +00:00
nobu 0a19e7f0a3 net/ftp.rb: NullSocket#closed?
* net/ftp.rb: add NullSocket#closed? to fix closing not opened
  connection.  [Fix GH-1232]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-02-12 02:50:09 +00:00
shugo 58af10ecbd * lib/net/ftp.rb (initialize): Connections are in passive mode per
default now.  The default mode can be changed by
  Net::FTP.default_passive=.

* lib/net/ftp.rb (default_passive=, default_passive): new methods.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-11 03:48:45 +00:00
akr 68ebbbfebe * lib/open-uri.rb: Remove indicator for "frozen_string_literal: true".
* lib/pp.rb: Ditto.

* lib/prettyprint.rb: Ditto.

* lib/resolv.rb: Ditto.

* lib/securerandom.rb: Ditto.

* lib/tmpdir.rb: Ditto.

* lib/unicode_normalize/tables.rb: Ditto.

* test/net/ftp/test_buffered_socket.rb: Ditto.

* test/net/ftp/test_mlsx_entry.rb: Ditto.

* test/open-uri/test_open-uri.rb: Ditto.

* test/open-uri/test_ssl.rb: Ditto.

* test/pathname/test_pathname.rb: Ditto.

* test/test_pp.rb: Ditto.

* test/test_prettyprint.rb: Ditto.

* tool/transcode-tblgen.rb: Ditto.

* ext/pathname/lib/pathname.rb: Ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52526 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-10 11:48:14 +00:00
naruse 3f682c2c8a Add binmode for Tempfile to prevent EOF (0x1A)
http://ruby-mswin.cloudapp.net/vc10-x64/ruby-trunk/log/20151023T062322Z.log.html.gz

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-27 07:34:18 +00:00
shugo 3eabc555cb * lib/net/ftp.rb (gettextfile, getbinaryfile): use the safe
navigation operator.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-23 06:23:16 +00:00
shugo 19110fe19a * test/net/ftp/test_ftp.rb: add tests for getbinaryfile and
gettextfile.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-22 02:21:06 +00:00
shugo 3e70f44ae9 * lib/net/ftp.rb (parse257): refactor.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09 08:29:36 +00:00
shugo ae6555aa25 * lib/net/ftp.rb: use frozen_string_literal: true.
* test/net/ftp/test_buffered_socket.rb: ditto.

* test/net/ftp/test_ftp.rb: ditto.

* test/net/ftp/test_mlsx_entry.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-10-09 07:28:10 +00:00
shugo 275b38937e * lib/net/ftp.rb (mtime): use usec instead of fractions to parse
decimal fractions of a second correctly when the number of digits
  is not 6.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 08:43:44 +00:00
shugo 040ae91040 * lib/net/ftp.rb (mtime): parse decimal fractions of a second as
specified in RFC 3659.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-28 07:10:25 +00:00
shugo 5425099a9f * lib/net/ftp.rb (parse_mlsx_entry): parse pathnames including
space correctly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-14 10:27:28 +00:00
shugo 2478c7bc33 * lib/net/ftp.rb (file?, directory?, appendable?, creatable?,
deletable?, enterable?, renamable?, listable?, directory_makable?,
  purgeable?, readable?, writable?): new methods.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51843 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 14:09:45 +00:00
shugo 2ec793ab27 * lib/net/ftp.rb (FACT_PARSERS): support system dependent facts
UNIX.mode, UNIX.owner, UNIX.group, UNIX.ctime, and UNIX.atime.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51842 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 12:29:32 +00:00
shugo 777c719450 * lib/net/ftp.rb (parse_mlsx_entry, mlst) raise an FTPProtoError
when parsing failed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51840 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 09:16:21 +00:00
shugo 8a97ffe094 * lib/net/ftp.rb (mlst, mlsd): support new commands MLST and MLSD
specified in RFC 3659.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-12 08:57:17 +00:00
shugo 782e2148af * lib/net/ftp.rb (size, mdtm, system): parse responses according to
RFC 959 and 3659, where reply codes must be followed by SP.

* lib/net/ftp.rb (system): remove LF from the return value.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51824 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-11 02:23:31 +00:00
shugo 5c09cb9c1e * lib/net/ftp.rb (getmultiline): refactor.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-10 06:16:37 +00:00
shugo d5d6b149df * lib/net/ftp.rb (list): fetch all the lines before yielding a block
to allow other commands in the block.  [Feature #11454]
  Patched by Srikanth Shreenivas.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-08 06:08:20 +00:00
eregon 6cdc55f4a3 * lib/net/ftp.rb (makeport): close the TCPServer
when sending the port fails.
* test/net/ftp/test_ftp.rb: test for above.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-27 10:10:54 +00:00
ngoto ba536e4154 * test/net/ftp/test_ftp.rb (create_ftp_server): set SO_OOBINLINE
for receiving OOB data which is sended with MSG_OOB flag in
  portable way. [Bug #10915] [ruby-dev:48885]
* test/net/ftp/test_ftp.rb (test_abort, test_status): use gets
  for receiving OOB data in portable way.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49800 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-02 03:07:18 +00:00
shugo cd29e5fcef * lib/net/ftp.rb (chdir, delete, gettextfile, mdtm, mkdir, nlst,
putbinaryfile, puttextfile, rename, rmdir, size): support
  Pathname. Patch by Joe Rafaniello. [fix GH-828]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49552 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-10 02:26:06 +00:00
akr 9bf5457481 * test/net/ftp/test_ftp.rb (create_ftp_server): Don't ignore
exceptions on server thread.
  Delete read_timeout method call to fix NoMethodError.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-11-10 14:40:00 +00:00
shugo 6479e0b04f * lib/net/ftp.rb (gets, readline): read lines without LF properly.
[ruby-core:63205] [Bug #9949]

* test/net/ftp/test_buffered_socket.rb: related test.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46457 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-06-17 07:44:53 +00:00
hsbt 72191a0acd * test/net/ftp/test_ftp.rb: remove unused variables.
test/logger/test_logger.rb: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-16 06:05:52 +00:00
naruse 3cbf88d8d4 rescue EPIPE raised from conn.print because of client's timeout
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35757 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-22 12:35:18 +00:00
naruse f6fb038dee * lib/net/ftp.rb (Net::FTP#retrbinary): close only if conn is not nil
because transfercmd may fail and return nil.

* lib/net/ftp.rb (Net::FTP#retrlines): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35750 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-21 12:56:17 +00:00