ftpd 2.0.1 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +6 -0
  3. data/Gemfile +2 -15
  4. data/Gemfile.lock +12 -51
  5. data/README.md +12 -0
  6. data/VERSION +1 -1
  7. data/bin/ftpdrb +17 -12
  8. data/examples/write_only.rb +61 -0
  9. data/ftpd.gemspec +59 -261
  10. data/lib/ftpd/session.rb +51 -51
  11. metadata +11 -153
  12. data/.travis.yml +0 -6
  13. data/features/example/eplf.feature +0 -14
  14. data/features/example/example.feature +0 -18
  15. data/features/example/read_only.feature +0 -63
  16. data/features/example/step_definitions/example_server.rb +0 -13
  17. data/features/ftp_server/abort.feature +0 -13
  18. data/features/ftp_server/allo.feature +0 -33
  19. data/features/ftp_server/append.feature +0 -94
  20. data/features/ftp_server/cdup.feature +0 -36
  21. data/features/ftp_server/command_errors.feature +0 -13
  22. data/features/ftp_server/concurrent_sessions.feature +0 -14
  23. data/features/ftp_server/delay_after_failed_login.feature +0 -23
  24. data/features/ftp_server/delete.feature +0 -60
  25. data/features/ftp_server/directory_navigation.feature +0 -59
  26. data/features/ftp_server/disconnect_after_failed_logins.feature +0 -25
  27. data/features/ftp_server/eprt.feature +0 -56
  28. data/features/ftp_server/epsv.feature +0 -37
  29. data/features/ftp_server/features.feature +0 -38
  30. data/features/ftp_server/file_structure.feature +0 -43
  31. data/features/ftp_server/get.feature +0 -80
  32. data/features/ftp_server/get_ipv6.feature +0 -46
  33. data/features/ftp_server/get_tls.feature +0 -23
  34. data/features/ftp_server/help.feature +0 -21
  35. data/features/ftp_server/implicit_tls.feature +0 -23
  36. data/features/ftp_server/invertability.feature +0 -15
  37. data/features/ftp_server/list.feature +0 -94
  38. data/features/ftp_server/list_tls.feature +0 -29
  39. data/features/ftp_server/logging.feature +0 -11
  40. data/features/ftp_server/login_auth_level_account.feature +0 -51
  41. data/features/ftp_server/login_auth_level_password.feature +0 -59
  42. data/features/ftp_server/login_auth_level_user.feature +0 -31
  43. data/features/ftp_server/max_connections.feature +0 -39
  44. data/features/ftp_server/mdtm.feature +0 -53
  45. data/features/ftp_server/mkdir.feature +0 -70
  46. data/features/ftp_server/mode.feature +0 -43
  47. data/features/ftp_server/name_list.feature +0 -77
  48. data/features/ftp_server/name_list_tls.feature +0 -30
  49. data/features/ftp_server/noop.feature +0 -17
  50. data/features/ftp_server/options.feature +0 -17
  51. data/features/ftp_server/pasv.feature +0 -30
  52. data/features/ftp_server/port.feature +0 -49
  53. data/features/ftp_server/put.feature +0 -79
  54. data/features/ftp_server/put_tls.feature +0 -23
  55. data/features/ftp_server/put_unique.feature +0 -56
  56. data/features/ftp_server/quit.feature +0 -23
  57. data/features/ftp_server/reinitialize.feature +0 -13
  58. data/features/ftp_server/rename.feature +0 -97
  59. data/features/ftp_server/rmdir.feature +0 -71
  60. data/features/ftp_server/site.feature +0 -13
  61. data/features/ftp_server/size.feature +0 -69
  62. data/features/ftp_server/status.feature +0 -18
  63. data/features/ftp_server/step_definitions/logging.rb +0 -10
  64. data/features/ftp_server/step_definitions/test_server.rb +0 -71
  65. data/features/ftp_server/structure_mount.feature +0 -13
  66. data/features/ftp_server/syntax_errors.feature +0 -18
  67. data/features/ftp_server/syst.feature +0 -18
  68. data/features/ftp_server/timeout.feature +0 -26
  69. data/features/ftp_server/type.feature +0 -59
  70. data/features/step_definitions/append.rb +0 -17
  71. data/features/step_definitions/client.rb +0 -27
  72. data/features/step_definitions/client_and_server_files.rb +0 -26
  73. data/features/step_definitions/client_files.rb +0 -16
  74. data/features/step_definitions/command.rb +0 -7
  75. data/features/step_definitions/connect.rb +0 -39
  76. data/features/step_definitions/delete.rb +0 -17
  77. data/features/step_definitions/directory_navigation.rb +0 -28
  78. data/features/step_definitions/error_replies.rb +0 -117
  79. data/features/step_definitions/features.rb +0 -23
  80. data/features/step_definitions/file_structure.rb +0 -18
  81. data/features/step_definitions/generic_send.rb +0 -11
  82. data/features/step_definitions/get.rb +0 -18
  83. data/features/step_definitions/help.rb +0 -20
  84. data/features/step_definitions/invalid_commands.rb +0 -13
  85. data/features/step_definitions/ipv6.rb +0 -11
  86. data/features/step_definitions/line_endings.rb +0 -9
  87. data/features/step_definitions/list.rb +0 -75
  88. data/features/step_definitions/login.rb +0 -84
  89. data/features/step_definitions/mkdir.rb +0 -11
  90. data/features/step_definitions/mode.rb +0 -17
  91. data/features/step_definitions/mtime.rb +0 -25
  92. data/features/step_definitions/noop.rb +0 -17
  93. data/features/step_definitions/options.rb +0 -11
  94. data/features/step_definitions/passive.rb +0 -10
  95. data/features/step_definitions/pending.rb +0 -5
  96. data/features/step_definitions/port.rb +0 -7
  97. data/features/step_definitions/put.rb +0 -31
  98. data/features/step_definitions/quit.rb +0 -17
  99. data/features/step_definitions/rename.rb +0 -13
  100. data/features/step_definitions/rmdir.rb +0 -11
  101. data/features/step_definitions/server_files.rb +0 -63
  102. data/features/step_definitions/server_title.rb +0 -14
  103. data/features/step_definitions/size.rb +0 -22
  104. data/features/step_definitions/status.rb +0 -11
  105. data/features/step_definitions/success_replies.rb +0 -9
  106. data/features/step_definitions/system.rb +0 -12
  107. data/features/step_definitions/timing.rb +0 -21
  108. data/features/step_definitions/type.rb +0 -17
  109. data/features/support/env.rb +0 -6
  110. data/features/support/example_server.rb +0 -69
  111. data/features/support/file_templates/ascii_unix +0 -4
  112. data/features/support/file_templates/ascii_windows +0 -4
  113. data/features/support/file_templates/binary +0 -0
  114. data/features/support/test_client.rb +0 -258
  115. data/features/support/test_file_templates.rb +0 -35
  116. data/features/support/test_server.rb +0 -304
  117. data/features/support/test_server_files.rb +0 -59
  118. data/rake_tasks/cucumber.rake +0 -9
  119. data/rake_tasks/default.rake +0 -1
  120. data/rake_tasks/jeweler.rake +0 -52
  121. data/rake_tasks/spec.rake +0 -3
  122. data/rake_tasks/test.rake +0 -2
  123. data/rake_tasks/yard.rake +0 -3
  124. data/spec/command_sequence_checker_spec.rb +0 -85
  125. data/spec/connection_throttle_spec.rb +0 -101
  126. data/spec/connection_tracker_spec.rb +0 -99
  127. data/spec/data_server_factory_spec.rb +0 -104
  128. data/spec/disk_file_system_spec.rb +0 -322
  129. data/spec/exception_translator_spec.rb +0 -38
  130. data/spec/file_info_spec.rb +0 -61
  131. data/spec/ftp_server_error_spec.rb +0 -15
  132. data/spec/list_format/eplf_spec.rb +0 -63
  133. data/spec/list_format/ls_spec.rb +0 -272
  134. data/spec/list_path_spec.rb +0 -23
  135. data/spec/null_logger_spec.rb +0 -26
  136. data/spec/protocols_spec.rb +0 -159
  137. data/spec/server_spec.rb +0 -83
  138. data/spec/spec_helper.rb +0 -17
  139. data/spec/telnet_spec.rb +0 -77
  140. data/spec/translate_exceptions_spec.rb +0 -42
  141. data/testlib/network.rb +0 -17
@@ -1,56 +0,0 @@
1
- Feature: EPRT
2
-
3
- As a programmer
4
- I want good error messages
5
- So that I can correct problems
6
-
7
- Background:
8
- Given the stack supports ipv6
9
- Given the test server is bound to "::"
10
- Given the test server is started
11
-
12
- Scenario: Port 1024
13
- Given a successful login
14
- Then the client successfully sends "EPRT |1|1.2.3.4|1024|"
15
-
16
- Scenario: Port 1023; low ports disallowed
17
- Given the test server disallows low data ports
18
- And a successful login
19
- When the client sends "EPRT |1|2.3.4.3|255|"
20
- Then the server returns an unimplemented parameter error
21
-
22
- Scenario: Port out of range
23
- Given a successful login
24
- When the client sends "EPRT |1|2.3.4.5|65536|"
25
- Then the server returns an unimplemented parameter error
26
-
27
- Scenario: Port 1023; low ports allowed
28
- Given the test server allows low data ports
29
- And a successful login
30
- Then the client successfully sends "EPRT |1|2.3.4.3|255|"
31
-
32
- Scenario: Not logged in
33
- Given a successful connection
34
- When the client sends "EPRT |1|2.3.4.5|6|"
35
- Then the server returns a not logged in error
36
-
37
- Scenario: Too few parts
38
- Given a successful login
39
- When the client sends "EPRT |1|2.3.4|"
40
- Then the server returns a syntax error
41
-
42
- Scenario: Too many parts
43
- Given a successful login
44
- When the client sends "EPRT |1|2.3.4|5|6|"
45
- Then the server returns a syntax error
46
-
47
- Scenario: Unknown network protocol
48
- Given a successful login
49
- When the client sends "EPRT |3|2.3.4.5|6|"
50
- Then the server returns a network protocol not supported error
51
-
52
- Scenario: After "EPSV ALL"
53
- Given a successful login
54
- Given the client successfully sends "EPSV ALL"
55
- When the client sends "EPRT |1|2.3.4.5|6|"
56
- Then the server sends a not allowed after epsv all error
@@ -1,37 +0,0 @@
1
- Feature: EPSV
2
-
3
- As a programmer
4
- I want good error messages
5
- So that I can correct problems
6
-
7
- Background:
8
- Given the stack supports ipv6
9
- Given the test server is bound to "::"
10
- And the test server is started
11
-
12
- Scenario: No argument
13
- Given a successful login
14
- Then the client successfully sends "EPSV"
15
-
16
- Scenario: Explicit IPV4
17
- Given a successful login
18
- Then the client successfully sends "EPSV 1"
19
-
20
- Scenario: Explicit IPV6
21
- Given a successful login
22
- Then the client successfully sends "EPSV 2"
23
-
24
- Scenario: After "EPSV ALL"
25
- Given a successful login
26
- Given the client successfully sends "EPSV ALL"
27
- Then the client successfully sends "EPSV"
28
-
29
- Scenario: Not logged in
30
- Given a successful connection
31
- When the client sends "EPSV"
32
- Then the server returns a not logged in error
33
-
34
- Scenario: Unknown network protocol
35
- Given a successful login
36
- When the client sends "EPSV 99"
37
- Then the server returns a network protocol not supported error
@@ -1,38 +0,0 @@
1
- Feature: Features
2
-
3
- As a client
4
- I want to know what FTP extension the server supports
5
- So that I can use them without trial-and-error
6
-
7
- Background:
8
-
9
- Scenario: TLS Disabled
10
- Given the test server is started
11
- And the client connects
12
- When the client successfully requests features
13
- Then the response should not include TLS features
14
-
15
- Scenario: TLS Enabled
16
- Given the test server has TLS mode "explicit"
17
- And the test server is started
18
- And the client connects
19
- When the client successfully requests features
20
- Then the response should include TLS features
21
-
22
- Scenario: Argument given
23
- Given the test server is started
24
- And the client connects
25
- When the client sends "FEAT FOO"
26
- Then the server returns a syntax error
27
-
28
- Scenario: IPV6 Extensions
29
- Given the test server is started
30
- When the client successfully requests features
31
- Then the response should include feature "EPRT"
32
- And the response should include feature "EPSV"
33
-
34
- Scenario: RFC 3659 Extensions
35
- Given the test server is started
36
- When the client successfully requests features
37
- Then the response should include feature "SIZE"
38
- Then the response should include feature "MDTM"
@@ -1,43 +0,0 @@
1
- Feature: File Structure
2
-
3
- As a server
4
- I want to accept the obsolute file structure (STRU) command
5
- For compatability
6
-
7
- Background:
8
- Given the test server is started
9
-
10
- Scenario: File
11
- Given a successful login
12
- And the server has file "ascii_unix"
13
- When the client successfully sets file structure "F"
14
- And the client successfully gets text "ascii_unix"
15
- Then the remote file "ascii_unix" should match the local file
16
-
17
- Scenario: Record
18
- Given a successful login
19
- And the server has file "ascii_unix"
20
- When the client sets file structure "R"
21
- Then the server returns a file structure not implemented error
22
-
23
- Scenario: Page
24
- Given a successful login
25
- And the server has file "ascii_unix"
26
- When the client sets file structure "P"
27
- Then the server returns a file structure not implemented error
28
-
29
- Scenario: Invalid
30
- Given a successful login
31
- And the server has file "ascii_unix"
32
- When the client sets file structure "*"
33
- Then the server returns an invalid file structure error
34
-
35
- Scenario: Not logged in
36
- Given a successful connection
37
- When the client sets file structure "F"
38
- Then the server returns a not logged in error
39
-
40
- Scenario: Missing parameter
41
- Given a successful login
42
- When the client sets file structure with no parameter
43
- Then the server returns a syntax error
@@ -1,80 +0,0 @@
1
- Feature: Get
2
-
3
- As a client
4
- I want to securely get a file
5
- So that I have it on my computer
6
- But nobody else can
7
-
8
- Background:
9
- Given the test server is started
10
-
11
- Scenario: ASCII file with *nix line endings
12
- Given a successful login
13
- And the server has file "ascii_unix"
14
- When the client successfully gets text "ascii_unix"
15
- Then the local file "ascii_unix" should match the remote file
16
- And the local file "ascii_unix" should have unix line endings
17
-
18
- Scenario: ASCII file with windows line endings
19
- Given a successful login
20
- And the server has file "ascii_windows"
21
- When the client successfully gets text "ascii_windows"
22
- Then the local file "ascii_windows" should match the remote file
23
- And the local file "ascii_windows" should have unix line endings
24
-
25
- Scenario: Binary file
26
- Given a successful login
27
- And the server has file "binary"
28
- When the client successfully gets binary "binary"
29
- Then the local file "binary" should exactly match the remote file
30
-
31
- Scenario: Passive
32
- Given a successful login
33
- And the server has file "ascii_unix"
34
- And the client is in passive mode
35
- When the client successfully gets text "ascii_unix"
36
- Then the local file "ascii_unix" should match the remote file
37
-
38
- Scenario: File in subdirectory
39
- Given a successful login
40
- And the server has file "foo/ascii_unix"
41
- Then the client successfully gets text "foo/ascii_unix"
42
-
43
- Scenario: Non-root working directory
44
- Given a successful login
45
- And the server has file "foo/ascii_unix"
46
- And the client successfully cd's to "foo"
47
- When the client successfully gets text "ascii_unix"
48
- Then the remote file "foo/ascii_unix" should match the local file
49
-
50
- Scenario: Access denied
51
- Given a successful login
52
- When the client gets text "forbidden"
53
- Then the server returns an access denied error
54
-
55
- Scenario: Missing file
56
- Given a successful login
57
- When the client gets text "foo"
58
- Then the server returns a not found error
59
-
60
- Scenario: Not logged in
61
- Given a successful connection
62
- When the client gets text "foo"
63
- Then the server returns a not logged in error
64
-
65
- Scenario: Missing path
66
- Given a successful login
67
- When the client gets with no path
68
- Then the server returns a syntax error
69
-
70
- Scenario: File system error
71
- Given a successful login
72
- When the client gets text "unable"
73
- Then the server returns an action not taken error
74
-
75
- Scenario: Read not enabled
76
- Given the test server lacks read
77
- And a successful login
78
- And the server has file "foo"
79
- When the client gets text "foo"
80
- Then the server returns an unimplemented command error
@@ -1,46 +0,0 @@
1
- Feature: Get IPV6
2
-
3
- As a client
4
- I want to get a file
5
- So that I have it on my computer
6
-
7
- Background:
8
- Given the stack supports ipv6
9
-
10
- Scenario: Active
11
- Given the test server is bound to "::1"
12
- And the test server is started
13
- And a successful login
14
- And the server has file "ascii_unix"
15
- And the client is in active mode
16
- When the client successfully gets text "ascii_unix"
17
- Then the local file "ascii_unix" should match the remote file
18
-
19
- Scenario: Passive
20
- Given the test server is bound to "::1"
21
- And the test server is started
22
- And a successful login
23
- And the server has file "ascii_unix"
24
- And the client is in passive mode
25
- When the client successfully gets text "ascii_unix"
26
- Then the local file "ascii_unix" should match the remote file
27
-
28
- Scenario: Active, TLS
29
- Given the test server is bound to "::1"
30
- And the test server has TLS mode "explicit"
31
- And the test server is started
32
- And a successful login
33
- And the server has file "ascii_unix"
34
- And the client is in active mode
35
- When the client successfully gets text "ascii_unix"
36
- Then the local file "ascii_unix" should match the remote file
37
-
38
- Scenario: Passive, TLS
39
- Given the test server is bound to "::1"
40
- And the test server has TLS mode "explicit"
41
- And the test server is started
42
- And a successful login
43
- And the server has file "ascii_unix"
44
- And the client is in passive mode
45
- When the client successfully gets text "ascii_unix"
46
- Then the local file "ascii_unix" should match the remote file
@@ -1,23 +0,0 @@
1
- Feature: Get TLS
2
-
3
- As a client
4
- I want to get a file
5
- So that I have it on my computer
6
-
7
- Background:
8
- Given the test server has TLS mode "explicit"
9
- And the test server is started
10
-
11
- Scenario: Active
12
- Given a successful login with explicit TLS
13
- And the server has file "ascii_unix"
14
- And the client is in active mode
15
- When the client successfully gets text "ascii_unix"
16
- Then the local file "ascii_unix" should match the remote file
17
-
18
- Scenario: Passive
19
- Given a successful login with explicit TLS
20
- And the server has file "ascii_unix"
21
- And the client is in passive mode
22
- When the client successfully gets text "ascii_unix"
23
- Then the local file "ascii_unix" should match the remote file
@@ -1,21 +0,0 @@
1
- Feature: Help
2
-
3
- As a client
4
- I want to ask for help
5
- So that I can know which commands are supported
6
-
7
- Background:
8
- Given the test server is started
9
- And a successful connection
10
-
11
- Scenario: No argument
12
- When the client successfully asks for help
13
- Then the server should return a list of commands
14
-
15
- Scenario: Known command
16
- When the client successfully asks for help for "NOOP"
17
- Then the server should return help for "NOOP"
18
-
19
- Scenario: Unknown command
20
- When the client successfully asks for help for "FOO"
21
- Then the server should return no help for "FOO"
@@ -1,23 +0,0 @@
1
- Feature: Implicit TLS
2
-
3
- As a server
4
- I want to use implicit TLS
5
- Because I must serve out-of-date clients
6
-
7
- Background:
8
- Given the test server has TLS mode "implicit"
9
- And the test server is started
10
-
11
- Scenario: Active
12
- Given a successful login with implicit TLS
13
- And the client has file "ascii_unix"
14
- And the client is in active mode
15
- When the client successfully puts text "ascii_unix"
16
- Then the remote file "ascii_unix" should match the local file
17
-
18
- Scenario: Passive
19
- Given a successful login with implicit TLS
20
- And the client has file "ascii_unix"
21
- And the client is in passive mode
22
- When the client successfully puts text "ascii_unix"
23
- Then the remote file "ascii_unix" should match the local file
@@ -1,15 +0,0 @@
1
- Feature: Get
2
-
3
- As a client
4
- I want a file to be the same when I get it as it was when I put it
5
- So that I can use the FTP server for storage
6
-
7
- Background:
8
- Given the test server is started
9
-
10
- Scenario: Binary file
11
- Given a successful login
12
- And the client has file "binary"
13
- When the client successfully puts binary "binary"
14
- And the client successfully gets binary "binary"
15
- Then the local file "binary" should match its template
@@ -1,94 +0,0 @@
1
- Feature: List
2
-
3
- As a client
4
- I want to list files
5
- So that I can see what file to transfer
6
-
7
- Background:
8
- Given the test server is started
9
-
10
- Scenario: Implicit
11
- Given a successful login
12
- And the server has file "foo"
13
- And the server has file "bar"
14
- When the client successfully lists the directory
15
- Then the file list should be in long form
16
- And the file list should contain "foo"
17
- And the file list should contain "bar"
18
-
19
- Scenario: Root
20
- Given a successful login
21
- And the server has file "foo"
22
- And the server has file "bar"
23
- When the client successfully lists the directory "/"
24
- Then the file list should be in long form
25
- And the file list should contain "foo"
26
- And the file list should contain "bar"
27
-
28
- Scenario: Parent of root
29
- Given a successful login
30
- And the server has file "foo"
31
- And the server has file "bar"
32
- When the client successfully lists the directory "/.."
33
- Then the file list should be in long form
34
- And the file list should contain "foo"
35
- And the file list should contain "bar"
36
-
37
- Scenario: Subdir
38
- Given a successful login
39
- And the server has file "subdir/foo"
40
- When the client successfully lists the directory "subdir"
41
- Then the file list should be in long form
42
- And the file list should contain "foo"
43
-
44
- Scenario: After CWD
45
- Given a successful login
46
- And the server has file "subdir/foo"
47
- And the client successfully cd's to "subdir"
48
- When the client successfully lists the directory
49
- Then the file list should be in long form
50
- And the file list should contain "foo"
51
-
52
- Scenario: Glob
53
- Given a successful login
54
- And the server has file "foo"
55
- And the server has file "bar"
56
- When the client successfully lists the directory "f*"
57
- Then the file list should be in long form
58
- And the file list should contain "foo"
59
- And the file list should not contain "bar"
60
-
61
- Scenario: Passive
62
- Given a successful login
63
- And the server has file "foo"
64
- And the server has file "bar"
65
- And the client is in passive mode
66
- When the client successfully lists the directory
67
- Then the file list should be in long form
68
- And the file list should contain "foo"
69
- And the file list should contain "bar"
70
-
71
- Scenario: -a
72
- Given a successful login
73
- And the server has file "foo"
74
- And the server has file "bar"
75
- When the client successfully lists the directory "-a"
76
- Then the file list should be in long form
77
- And the file list should contain "foo"
78
- And the file list should contain "bar"
79
-
80
- Scenario: Missing directory
81
- Given a successful login
82
- When the client successfully lists the directory "missing/file"
83
- Then the file list should be empty
84
-
85
- Scenario: Not logged in
86
- Given a successful connection
87
- When the client lists the directory
88
- Then the server returns a not logged in error
89
-
90
- Scenario: List not enabled
91
- Given the test server lacks list
92
- And a successful login
93
- When the client lists the directory
94
- Then the server returns an unimplemented command error