ftpd 0.17.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/Changelog.md +7 -0
- data/Gemfile +9 -8
- data/Gemfile.lock +66 -55
- data/README.md +4 -2
- data/VERSION +1 -1
- data/features/ftp_server/step_definitions/logging.rb +6 -6
- data/features/step_definitions/client_and_server_files.rb +2 -2
- data/features/step_definitions/client_files.rb +4 -4
- data/features/step_definitions/connect.rb +2 -2
- data/features/step_definitions/directory_navigation.rb +2 -2
- data/features/step_definitions/error_replies.rb +2 -2
- data/features/step_definitions/features.rb +2 -2
- data/features/step_definitions/help.rb +4 -4
- data/features/step_definitions/list.rb +9 -9
- data/features/step_definitions/login.rb +3 -3
- data/features/step_definitions/mtime.rb +1 -1
- data/features/step_definitions/server_files.rb +11 -11
- data/features/step_definitions/server_title.rb +2 -2
- data/features/step_definitions/size.rb +1 -1
- data/features/step_definitions/success_replies.rb +1 -1
- data/features/step_definitions/timing.rb +2 -2
- data/ftpd.gemspec +30 -27
- data/spec/connection_throttle_spec.rb +14 -11
- data/spec/connection_tracker_spec.rb +23 -17
- data/spec/disk_file_system_spec.rb +15 -15
- data/spec/exception_translator_spec.rb +1 -0
- data/spec/file_info_spec.rb +4 -4
- data/spec/list_format/eplf_spec.rb +3 -4
- data/spec/list_format/ls_spec.rb +3 -3
- data/spec/null_logger_spec.rb +1 -1
- data/spec/protocols_spec.rb +8 -8
- data/spec/spec_helper.rb +1 -0
- metadata +54 -40
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
OTg1ZTM5MTJmZWZjYTBkOTE5NzI2MDc3NDc3ODhhOGUyZDk3YWZlNA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YzI4ZThmY2NmZDA1NDA3OWE4ZmYxNzkzMjg3NmFkNjhiNjdhODAyNQ==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ODlkZTk5MDQ3ZGJmMGYwNTkyNDNlYjhjMzdlZjE4YTY1ODQzZmJjODczMmQx
|
10
|
+
ZmE2M2JlYmRkM2E4NDBmMzg3NmI1NTU4NDM0ZTZkYmJmOGNmOGRlZjUzNThl
|
11
|
+
Nzk0MmQ0NDdjNzMyMDE0MGZlNWI3N2M3NWIwMDEyNDM1Y2IzMjM=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTVlOWVhMWQ1OWM3YTFmMTc5ZjFjOTkzNzk0Y2MyY2Q0ZTBlOTJlMmU0YTEz
|
14
|
+
YmE4ZTI4Yzg1NjE5MjE2ZjI5M2RhNjVlZTViOGM4N2Q1MGE2OTNhZjUxMGQx
|
15
|
+
Y2FlOTU1MDNiMTZhYWJhNTBjYzFkZjhlMTg0YTVlMjI3NjhkMDE=
|
data/Changelog.md
CHANGED
@@ -2,6 +2,13 @@ This is the change log for the main branch of ftpd, which supports
|
|
2
2
|
Ruby 1.9 and greater. For ruby 1.8.7, please use the latest version
|
3
3
|
before 0.8.0.
|
4
4
|
|
5
|
+
### 1.0.0
|
6
|
+
|
7
|
+
Administration
|
8
|
+
|
9
|
+
* Update gem versions
|
10
|
+
* Declare stability (v. 1.0.0)
|
11
|
+
|
5
12
|
### 0.17.0
|
6
13
|
|
7
14
|
This release is brought to you by Mike Ragalie. Thanks, Mike!
|
data/Gemfile
CHANGED
@@ -3,12 +3,13 @@ source 'http://rubygems.org'
|
|
3
3
|
gem 'memoizer', '~> 1.0'
|
4
4
|
|
5
5
|
group :development do
|
6
|
-
gem 'cucumber'
|
7
|
-
gem 'double-bag-ftps'
|
8
|
-
gem 'jeweler'
|
9
|
-
gem 'rake'
|
10
|
-
gem 'redcarpet'
|
11
|
-
gem 'rspec'
|
12
|
-
gem '
|
13
|
-
gem '
|
6
|
+
gem 'cucumber', '~> 1.3.16'
|
7
|
+
gem 'double-bag-ftps', '~> 0.1.2'
|
8
|
+
gem 'jeweler', '~> 2.0.1'
|
9
|
+
gem 'rake', '~> 10.3.2'
|
10
|
+
gem 'redcarpet', '~> 3.1.2'
|
11
|
+
gem 'rspec', '~> 3.1.0'
|
12
|
+
gem 'rspec-its', '~> 1.0.1'
|
13
|
+
gem 'timecop', '~> 0.7.1'
|
14
|
+
gem 'yard', '~> 0.8.7.4'
|
14
15
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,82 +1,93 @@
|
|
1
1
|
GEM
|
2
2
|
remote: http://rubygems.org/
|
3
3
|
specs:
|
4
|
-
addressable (2.3.
|
4
|
+
addressable (2.3.6)
|
5
5
|
builder (3.2.2)
|
6
|
-
cucumber (1.3.
|
6
|
+
cucumber (1.3.16)
|
7
7
|
builder (>= 2.1.2)
|
8
8
|
diff-lcs (>= 1.1.3)
|
9
|
-
gherkin (~> 2.12
|
9
|
+
gherkin (~> 2.12)
|
10
10
|
multi_json (>= 1.7.5, < 2.0)
|
11
|
-
multi_test (>= 0.
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
11
|
+
multi_test (>= 0.1.1)
|
12
|
+
descendants_tracker (0.0.4)
|
13
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
14
|
+
diff-lcs (1.2.5)
|
15
|
+
double-bag-ftps (0.1.2)
|
16
|
+
faraday (0.9.0)
|
17
|
+
multipart-post (>= 1.2, < 3)
|
18
|
+
gherkin (2.12.2)
|
17
19
|
multi_json (~> 1.3)
|
18
|
-
git (1.2.
|
19
|
-
github_api (0.
|
20
|
-
addressable
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
git (1.2.8)
|
21
|
+
github_api (0.12.1)
|
22
|
+
addressable (~> 2.3)
|
23
|
+
descendants_tracker (~> 0.0.4)
|
24
|
+
faraday (~> 0.8, < 0.10)
|
25
|
+
hashie (>= 3.2)
|
26
|
+
multi_json (>= 1.7.5, < 2.0)
|
27
|
+
nokogiri (~> 1.6.3)
|
25
28
|
oauth2
|
26
|
-
hashie (
|
27
|
-
highline (1.6.
|
28
|
-
|
29
|
-
jeweler (1.8.8)
|
29
|
+
hashie (3.3.1)
|
30
|
+
highline (1.6.21)
|
31
|
+
jeweler (2.0.1)
|
30
32
|
builder
|
31
|
-
bundler (
|
33
|
+
bundler (>= 1.0)
|
32
34
|
git (>= 1.2.5)
|
33
|
-
github_api
|
35
|
+
github_api
|
34
36
|
highline (>= 1.6.15)
|
35
|
-
nokogiri (
|
37
|
+
nokogiri (>= 1.5.10)
|
36
38
|
rake
|
37
39
|
rdoc
|
38
40
|
json (1.8.1)
|
39
|
-
jwt (0.
|
40
|
-
multi_json (>= 1.5)
|
41
|
+
jwt (1.0.0)
|
41
42
|
memoizer (1.0.1)
|
42
|
-
|
43
|
-
|
43
|
+
mini_portile (0.6.0)
|
44
|
+
multi_json (1.10.1)
|
45
|
+
multi_test (0.1.1)
|
44
46
|
multi_xml (0.5.5)
|
45
|
-
multipart-post (
|
46
|
-
nokogiri (1.
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
jwt (~>
|
51
|
-
multi_json (~> 1.
|
47
|
+
multipart-post (2.0.0)
|
48
|
+
nokogiri (1.6.3.1)
|
49
|
+
mini_portile (= 0.6.0)
|
50
|
+
oauth2 (1.0.0)
|
51
|
+
faraday (>= 0.8, < 0.10)
|
52
|
+
jwt (~> 1.0)
|
53
|
+
multi_json (~> 1.3)
|
52
54
|
multi_xml (~> 0.5)
|
53
55
|
rack (~> 1.2)
|
54
56
|
rack (1.5.2)
|
55
|
-
rake (10.
|
56
|
-
rdoc (4.
|
57
|
+
rake (10.3.2)
|
58
|
+
rdoc (4.1.1)
|
57
59
|
json (~> 1.4)
|
58
|
-
redcarpet (3.
|
59
|
-
rspec (
|
60
|
-
rspec-core (~>
|
61
|
-
rspec-expectations (~>
|
62
|
-
rspec-mocks (~>
|
63
|
-
rspec-core (
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
60
|
+
redcarpet (3.1.2)
|
61
|
+
rspec (3.1.0)
|
62
|
+
rspec-core (~> 3.1.0)
|
63
|
+
rspec-expectations (~> 3.1.0)
|
64
|
+
rspec-mocks (~> 3.1.0)
|
65
|
+
rspec-core (3.1.0)
|
66
|
+
rspec-support (~> 3.1.0)
|
67
|
+
rspec-expectations (3.1.0)
|
68
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
69
|
+
rspec-support (~> 3.1.0)
|
70
|
+
rspec-its (1.0.1)
|
71
|
+
rspec-core (>= 2.99.0.beta1)
|
72
|
+
rspec-expectations (>= 2.99.0.beta1)
|
73
|
+
rspec-mocks (3.1.0)
|
74
|
+
rspec-support (~> 3.1.0)
|
75
|
+
rspec-support (3.1.0)
|
76
|
+
thread_safe (0.3.4)
|
77
|
+
timecop (0.7.1)
|
78
|
+
yard (0.8.7.4)
|
69
79
|
|
70
80
|
PLATFORMS
|
71
81
|
ruby
|
72
82
|
|
73
83
|
DEPENDENCIES
|
74
|
-
cucumber
|
75
|
-
double-bag-ftps
|
76
|
-
jeweler
|
84
|
+
cucumber (~> 1.3.16)
|
85
|
+
double-bag-ftps (~> 0.1.2)
|
86
|
+
jeweler (~> 2.0.1)
|
77
87
|
memoizer (~> 1.0)
|
78
|
-
rake
|
79
|
-
redcarpet
|
80
|
-
rspec
|
81
|
-
|
82
|
-
|
88
|
+
rake (~> 10.3.2)
|
89
|
+
redcarpet (~> 3.1.2)
|
90
|
+
rspec (~> 3.1.0)
|
91
|
+
rspec-its (~> 1.0.1)
|
92
|
+
timecop (~> 0.7.1)
|
93
|
+
yard (~> 0.8.7.4)
|
data/README.md
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
# Ftpd
|
2
|
-
[![Code Climate](https://codeclimate.com/github/wconrad/ftpd.png)](https://codeclimate.com/github/wconrad/ftpd)
|
3
|
-
[![Build Status](https://travis-ci.org/wconrad/ftpd.png)](https://travis-ci.org/wconrad/ftpd)
|
4
2
|
[![Gem Version](https://badge.fury.io/rb/ftpd.png)](http://badge.fury.io/rb/ftpd)
|
3
|
+
[![Dependency Status](https://gemnasium.com/wconrad/ftpd.svg)](https://gemnasium.com/wconrad/ftpd)
|
4
|
+
[![Build Status](https://travis-ci.org/wconrad/ftpd.png)](https://travis-ci.org/wconrad/ftpd)
|
5
|
+
[![Code Climate](https://codeclimate.com/github/wconrad/ftpd.png)](https://codeclimate.com/github/wconrad/ftpd)
|
6
|
+
|
5
7
|
|
6
8
|
ftpd is a pure Ruby FTP server library. It supports implicit and
|
7
9
|
explicit TLS, IPV6, passive and active mode, and is unconditionally
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
1.0.0
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Then /^the server should have written( no)? log output$/ do |neg|
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
server.log_output.send(
|
2
|
+
verb = if neg
|
3
|
+
:to
|
4
|
+
else
|
5
|
+
:to_not
|
6
|
+
end
|
7
|
+
expect(server.log_output).send(verb, eq(''))
|
8
8
|
end
|
@@ -10,7 +10,7 @@ Then /^the remote file "(.*?)" should( exactly)? match the local file$/ do
|
|
10
10
|
local_contents = client.file_contents(local_path)
|
11
11
|
remote_contents = unix_line_endings(exactly, remote_contents)
|
12
12
|
local_contents = unix_line_endings(exactly, local_contents)
|
13
|
-
remote_contents.
|
13
|
+
expect(remote_contents).to eq local_contents
|
14
14
|
end
|
15
15
|
|
16
16
|
Then /^the local file "(.*?)" should( exactly)? match the remote file$/ do
|
@@ -20,5 +20,5 @@ Then /^the local file "(.*?)" should( exactly)? match the remote file$/ do
|
|
20
20
|
local_contents = client.file_contents(local_path)
|
21
21
|
remote_contents = unix_line_endings(exactly, remote_contents)
|
22
22
|
local_contents = unix_line_endings(exactly, local_contents)
|
23
|
-
local_contents.
|
23
|
+
expect(local_contents).to eq remote_contents
|
24
24
|
end
|
@@ -4,11 +4,11 @@ end
|
|
4
4
|
|
5
5
|
Then /^the local file "(.*?)" should have (unix|windows) line endings$/ do
|
6
6
|
|local_path, line_ending_type|
|
7
|
-
line_ending_type(client.file_contents(local_path)).
|
8
|
-
|
7
|
+
expect(line_ending_type(client.file_contents(local_path))).to eq \
|
8
|
+
line_ending_type.to_sym
|
9
9
|
end
|
10
10
|
|
11
11
|
Then /^the local file "(.*?)" should match its template$/ do |local_path|
|
12
|
-
client.template(local_path).
|
13
|
-
|
12
|
+
expect(client.template(local_path)).to eq \
|
13
|
+
client.file_contents(local_path)
|
14
14
|
end
|
@@ -29,9 +29,9 @@ When /^the (\S+) client tries to connect from (\S+)$/ do
|
|
29
29
|
end
|
30
30
|
|
31
31
|
Then /^the client should be connected$/ do
|
32
|
-
client.
|
32
|
+
expect(client).to be_connected
|
33
33
|
end
|
34
34
|
|
35
35
|
Then /^the client should not be connected$/ do
|
36
|
-
client.
|
36
|
+
expect(client).to_not be_connected
|
37
37
|
end
|
@@ -18,9 +18,9 @@ When /^the client successfully cd's to "(.*?)"$/ do |path|
|
|
18
18
|
end
|
19
19
|
|
20
20
|
Then /^the current directory should be "(.*?)"$/ do |path|
|
21
|
-
client.pwd.
|
21
|
+
expect(client.pwd).to eq path
|
22
22
|
end
|
23
23
|
|
24
24
|
Then /^the XPWD directory should be "(.*?)"$/ do |path|
|
25
|
-
client.xpwd.
|
25
|
+
expect(client.xpwd).to eq path
|
26
26
|
end
|
@@ -6,11 +6,11 @@ rescue Net::FTPError => e
|
|
6
6
|
end
|
7
7
|
|
8
8
|
Then /^the server returns no error$/ do
|
9
|
-
@error.
|
9
|
+
expect(@error).to be_nil
|
10
10
|
end
|
11
11
|
|
12
12
|
Then /^the server returns a "(.*?)" error$/ do |error_message|
|
13
|
-
(@error || '').
|
13
|
+
expect(@error || '').to include error_message
|
14
14
|
end
|
15
15
|
|
16
16
|
Then /^the server returns a too many connections error$/ do
|
@@ -7,11 +7,11 @@ def feature_regexp(feature)
|
|
7
7
|
end
|
8
8
|
|
9
9
|
Then /^the response should include feature "(.*?)"$/ do |feature|
|
10
|
-
@feature_reply.
|
10
|
+
expect(@feature_reply).to match feature_regexp(feature)
|
11
11
|
end
|
12
12
|
|
13
13
|
Then /^the response should not include feature "(.*?)"$/ do |feature|
|
14
|
-
@feature_reply.
|
14
|
+
expect(@feature_reply).to_not match feature_regexp(feature)
|
15
15
|
end
|
16
16
|
|
17
17
|
Then /^the response should( not)? include TLS features$/ do |neg|
|
@@ -5,14 +5,14 @@ end
|
|
5
5
|
|
6
6
|
Then /^the server should return a list of commands$/ do
|
7
7
|
commands = @help_reply.scan(/\b([A-Z][A-Z]+)\b/).flatten
|
8
|
-
commands.
|
9
|
-
commands.
|
8
|
+
expect(commands).to include 'NOOP'
|
9
|
+
expect(commands).to include 'USER'
|
10
10
|
end
|
11
11
|
|
12
12
|
Then /^the server should return help for "(.*?)"$/ do |command|
|
13
|
-
@help_reply.
|
13
|
+
expect(@help_reply).to match /Command #{command} is recognized/
|
14
14
|
end
|
15
15
|
|
16
16
|
Then /^the server should return no help for "(.*?)"$/ do |command|
|
17
|
-
@help_reply.
|
17
|
+
expect(@help_reply).to match /Command #{command} is not recognized/
|
18
18
|
end
|
@@ -52,22 +52,22 @@ When /^the client name-lists the directory( "(?:.*?)")?$/ do |directory|
|
|
52
52
|
end
|
53
53
|
|
54
54
|
Then /^the file list should( not)? contain "(.*?)"$/ do |neg, filename|
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
@list.filenames.send(
|
55
|
+
verb = if neg
|
56
|
+
:to_not
|
57
|
+
else
|
58
|
+
:to
|
59
|
+
end
|
60
|
+
expect(@list.filenames).send(verb, include(filename))
|
61
61
|
end
|
62
62
|
|
63
63
|
Then /^the file list should be in (long|short) form$/ do |form|
|
64
|
-
@list.
|
64
|
+
expect(@list).to send("be_#{form}_form")
|
65
65
|
end
|
66
66
|
|
67
67
|
Then /^the file list should be empty$/ do
|
68
|
-
@list.
|
68
|
+
expect(@list).to be_empty
|
69
69
|
end
|
70
70
|
|
71
71
|
Then /^the list should be in EPLF format$/ do
|
72
|
-
@list.
|
72
|
+
expect(@list).to be_eplf_format
|
73
73
|
end
|
@@ -47,11 +47,11 @@ end
|
|
47
47
|
|
48
48
|
Then /^the client should( not)? be logged in$/ do |neg|
|
49
49
|
matcher_method = if neg
|
50
|
-
:
|
50
|
+
:be_falsey
|
51
51
|
else
|
52
|
-
:
|
52
|
+
:be_truthy
|
53
53
|
end
|
54
|
-
logged_in
|
54
|
+
expect(logged_in?).to send(matcher_method)
|
55
55
|
end
|
56
56
|
|
57
57
|
When /^the client sends a password( with no parameter)?$/ do |no_param|
|
@@ -15,47 +15,47 @@ end
|
|
15
15
|
|
16
16
|
Then /^the server should( not)? have file "(.*?)"$/ do |neg, path|
|
17
17
|
matcher = if neg
|
18
|
-
:
|
18
|
+
:be_falsey
|
19
19
|
else
|
20
|
-
:
|
20
|
+
:be_truthy
|
21
21
|
end
|
22
|
-
server.has_file?(path).
|
22
|
+
expect(server.has_file?(path)).to send(matcher)
|
23
23
|
end
|
24
24
|
|
25
25
|
Then /^the server should( not)? have directory "(.*?)"$/ do |neg, path|
|
26
26
|
matcher = if neg
|
27
|
-
:
|
27
|
+
:be_falsey
|
28
28
|
else
|
29
|
-
:
|
29
|
+
:be_truthy
|
30
30
|
end
|
31
|
-
server.has_directory?(path).
|
31
|
+
expect(server.has_directory?(path)).to send(matcher)
|
32
32
|
end
|
33
33
|
|
34
34
|
Then /^the remote file "(.*?)" should have (unix|windows) line endings$/ do
|
35
35
|
|remote_path, line_ending_type|
|
36
|
-
line_ending_type(server.file_contents(remote_path)).
|
36
|
+
expect(line_ending_type(server.file_contents(remote_path))).to eq \
|
37
37
|
line_ending_type.to_sym
|
38
38
|
end
|
39
39
|
|
40
40
|
Then /^the server should have a file with the contents of "(.*?)"$/ do
|
41
41
|
|path|
|
42
|
-
server.has_file_with_contents_of?(path).
|
42
|
+
expect(server.has_file_with_contents_of?(path)).to be_truthy
|
43
43
|
end
|
44
44
|
|
45
45
|
Then /^the server should have (\d+) files? with "(.*?)" in the name$/ do
|
46
46
|
|count, name|
|
47
|
-
server.files_named_like(name).size.
|
47
|
+
expect(server.files_named_like(name).size).to eq count.to_i
|
48
48
|
end
|
49
49
|
|
50
50
|
Then /^the remote file "(.*?)" should match "(\w+)" \+ "(\w+)"$/ do
|
51
51
|
|remote_path, template1, template2|
|
52
52
|
expected = @server.template(template1) + @server.template(template2)
|
53
53
|
actual = @server.file_contents(remote_path)
|
54
|
-
actual.
|
54
|
+
expect(actual).to eq expected
|
55
55
|
end
|
56
56
|
|
57
57
|
Then /^the remote file "(.*?)" should match "(\w+)"$/ do |remote_path, template|
|
58
58
|
expected = @server.template(template)
|
59
59
|
actual = @server.file_contents(remote_path)
|
60
|
-
actual.
|
60
|
+
expect(actual).to eq expected
|
61
61
|
end
|