minitar 1.0.2 → 1.1.1

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 (57) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +326 -0
  3. data/CODE_OF_CONDUCT.md +167 -0
  4. data/CONTRIBUTING.md +312 -0
  5. data/CONTRIBUTORS.md +27 -0
  6. data/LICENCE.md +42 -0
  7. data/Manifest.txt +31 -8
  8. data/README.md +82 -0
  9. data/Rakefile +74 -20
  10. data/SECURITY.md +54 -0
  11. data/lib/minitar/input.rb +242 -189
  12. data/lib/minitar/output.rb +72 -64
  13. data/lib/minitar/pax_header.rb +111 -0
  14. data/lib/minitar/posix_header.rb +276 -239
  15. data/lib/minitar/reader.rb +226 -231
  16. data/lib/minitar/version.rb +5 -0
  17. data/lib/minitar/writer.rb +246 -299
  18. data/lib/minitar.rb +134 -115
  19. data/licenses/bsdl.txt +20 -0
  20. data/licenses/dco.txt +34 -0
  21. data/licenses/ruby.txt +52 -0
  22. data/test/fixtures/issue_46.tar.gz +0 -0
  23. data/test/fixtures/issue_62.tar.gz +0 -0
  24. data/test/fixtures/tar_input.tgz +0 -0
  25. data/test/fixtures/test_input_non_strict_octal.tgz +0 -0
  26. data/test/fixtures/test_input_relative.tgz +0 -0
  27. data/test/fixtures/test_input_space_octal.tgz +0 -0
  28. data/test/fixtures/test_minitar.tar.gz +0 -0
  29. data/test/minitest_helper.rb +12 -1
  30. data/test/support/minitar_test_helpers/fixtures.rb +38 -0
  31. data/test/support/minitar_test_helpers/header.rb +130 -0
  32. data/test/support/minitar_test_helpers/tarball.rb +324 -0
  33. data/test/support/minitar_test_helpers.rb +36 -0
  34. data/test/test_filename_boundary_conditions.rb +74 -0
  35. data/test/test_gnu_tar_compatibility.rb +92 -0
  36. data/test/test_integration_pack_unpack_cycle.rb +38 -0
  37. data/test/test_issue_46.rb +5 -23
  38. data/test/test_issue_62.rb +50 -0
  39. data/test/test_minitar.rb +168 -39
  40. data/test/test_path_normalization.rb +170 -0
  41. data/test/test_pax_header.rb +104 -0
  42. data/test/test_pax_support.rb +66 -0
  43. data/test/test_tar_header.rb +289 -75
  44. data/test/test_tar_input.rb +14 -61
  45. data/test/test_tar_output.rb +7 -9
  46. data/test/test_tar_reader.rb +17 -18
  47. data/test/test_tar_writer.rb +105 -126
  48. data/test/test_windows_extraction.rb +121 -0
  49. metadata +108 -95
  50. data/Code-of-Conduct.md +0 -128
  51. data/Contributing.md +0 -94
  52. data/History.md +0 -236
  53. data/Licence.md +0 -15
  54. data/README.rdoc +0 -92
  55. data/docs/bsdl.txt +0 -19
  56. data/docs/ruby.txt +0 -56
  57. data/test/support/tar_test_helpers.rb +0 -134
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3134140277b4b8a5ac33e40ddc3de53268d526b793c3e65935bc49158897444
4
- data.tar.gz: 0e2d087a23c4b0d0898e32d9a02b0f5b6a23350cfd9596e42fea9d7f849791a9
3
+ metadata.gz: 7855c77e89244e7288b4bb9398593ea6ac680a3891f3e9ce0bda77a8ea5f2e48
4
+ data.tar.gz: 1c2d05408cc0d2a69b604e257ec032bdbd98efd5384198a0b0d47f78e1407a31
5
5
  SHA512:
6
- metadata.gz: 0205475c41f4f793832f30344bf60a71e04b72a6f0bd40f967994cc25194724f80fe9b9e404c779428f771fb1fee1daf88c111a172730a0dbb90da62df7b9cc7
7
- data.tar.gz: 706350e009f79466f37a3bd0efb25ba21183a3b1d9816f18446c3c276d61c75a3767e5ed41f0ef037531d330c521b4df16c10c932cbc4b93c67057b7c5d04ccd
6
+ metadata.gz: 01dd7962ebc29dcdfa69221b6ece851f4ad488b1c9f25cd546054a611ec90f9ae3f44a7a3d0555f9efb7927a71f9c59cba75729bd46b103e4a8b4ead52e46547
7
+ data.tar.gz: 58e66377d5e593c6be0c149ac392931affea945c03fc12b34262fe5fa6154edd24247aa2ad7008b37891c12002199e664b8fe4875833b70d961492b8a42b2628
data/CHANGELOG.md ADDED
@@ -0,0 +1,326 @@
1
+ # Changelog
2
+
3
+ ## 1.1.1 / 2026-11-11
4
+
5
+ - Security:
6
+
7
+ - Relative path rejection ignored Windows-like filenames in maliciously
8
+ crafted tarballs _on Windows itself_. This affects all versions of minitar
9
+ < 1.1.1.
10
+
11
+ Tar entry names are byte strings following POSIX rules, where `/` is the
12
+ only directory separator and characters special on Windows (`:` and `\`)
13
+ are ordinary. This meant that `..\x` skipped relative path rejection and
14
+ affected files or directories outside of the extraction destination.
15
+
16
+ When running on Windows, Minitar now normalizes all `\` characters to `/`
17
+ before checking for potential relative path escapes.
18
+
19
+ The following filename patterns are all rejected with
20
+ `UnsafeFileNameError`:
21
+
22
+ - paths that start with drive designators (`[A-Z]:`);
23
+ - paths that contain `:` (NTFS alternate data stream names); and
24
+ - path components that have trailing `.` or space characters.
25
+
26
+ UNC paths are normalized to relative directories in the destination.
27
+
28
+ Behaviour on non-Windows platform has not been changed.
29
+
30
+ - Bug fix:
31
+
32
+ - The `..` check now rejects only path components that are exactly `..`.
33
+ Names such as `dirname../file` were previously rejected incorrectly on all
34
+ platforms.
35
+
36
+ - Documentation:
37
+
38
+ - Removed duplicate documentation files and updated the RDoc to match the
39
+ configuration.
40
+
41
+ ## 1.1.0 / 2025-09-07
42
+
43
+ - Enhancements:
44
+
45
+ - Support large file size encoded in base-256 encoding which is a GNU tar
46
+ extension [#121][pull-121].
47
+
48
+ - Support large file size encoded in PAX extension header. [#121][pull-121].
49
+
50
+ - Bug fix:
51
+
52
+ - Resolved [#62][issue-62]. The initial solution was developed with the
53
+ assistance of Claude Sonnet 4 via Kiro, but nearly every line of the
54
+ solution and tests were rewritten as part of a comprehensive review of all
55
+ tests.
56
+
57
+ - Breaking Change:
58
+
59
+ - Removed `Minitar::PosixHeader.new_from_stream` which should have been
60
+ removed with 1.0.0 and has been deprecated for a decade or so.
61
+
62
+ - Governance:
63
+
64
+ Changes described below are effective 2024-12-31.
65
+
66
+ - Update gem management details to use markdown files for everything,
67
+ enabled in part by [flavorjones/hoe-markdown][hoe-markdown]. Several files
68
+ were renamed to be more consistent with standard practices.
69
+
70
+ - Updated security notes with an [age][age] public key rather than pointing
71
+ to Keybase.io and a PGP public key which I no longer use. The use of the
72
+ [Tidelift security contact][tidelift] is recommended over direct
73
+ disclosure.
74
+
75
+ Changes described below are effective 2025-08-04.
76
+
77
+ - Contributions to minitar now require a DCO certification.
78
+
79
+ ## 1.0.2 / 2024-08-23
80
+
81
+ - Bug fix:
82
+
83
+ - Minitar 1.0.1 was released with an unchanged gemspec. Reported by
84
+ Debashish Biswas in [#65][issue-65].
85
+
86
+ ## 1.0.1 / 2024-08-08
87
+
88
+ - Bug fix:
89
+
90
+ - Resolve a constant lookup issue. The accepted fix has been provided by
91
+ Aram Price in [#58][issue-58].
92
+
93
+ ## 1.0.0 / 2024-08-07
94
+
95
+ - Breaking Changes:
96
+
97
+ - Minimum Ruby version is 3.1.
98
+
99
+ - The `Archive::Tar::Minitar` namespace has been completely removed and
100
+ `Minitar` is a class instead of a module.
101
+
102
+ - Enhancements:
103
+
104
+ - Added `Minitar.pack_as_file`, originally proposed by John Prince back in
105
+ 2011 [#7][issue-07].
106
+
107
+ ## 0.12.1 / 2024-08-21
108
+
109
+ - Reverted adbbb9b596 to restore compatibility with Ruby < 2.0. Resolves
110
+ [#63][issue-63] reported by Robert Schulze.
111
+
112
+ ## 0.12 / 2024-08-06
113
+
114
+ - Properly handle very long GNU filenames, resolving [#46][issue-46].
115
+ - Handle very long GNU filenames that are 512 or more bytes, resolving
116
+ [#45][issue-45]. Originally implemented in [#47][pull-47] by Vijay, but
117
+ accidentally closed.
118
+
119
+ ## 0.11 / 2022-12-31
120
+
121
+ - symlink support is complete. Merged as PR [#42][pull-42], rebased and built
122
+ on top of PR [#12][pull-12] by fetep.
123
+
124
+ - kymmt90 fixed a documentation error on `Minitar.pack` in PR [#43][pull-43].
125
+
126
+ - This version is a soft-deprecation of all versions before Ruby 2.7, as they
127
+ will no longer be tested in CI.
128
+
129
+ ## 0.10 / 2022-03-26
130
+
131
+ - nevesenin fixed an issue with long filename handling. Merged as PR
132
+ [#40][pull-40].
133
+
134
+ ## 0.9 / 2019-09-04
135
+
136
+ - jtappa added the ability to skip fsync with a new option to `Minitar.unpack`
137
+ and `Minitar::Input#extract_entry`. Provide `:fsync => false` as the last
138
+ parameter to enable. Merged from a modified version of PR [#37][pull-37].
139
+
140
+ ## 0.8 / 2019-01-05
141
+
142
+ - [@inkstak](https://github.com/inkstak) resolved an issue introduced in the
143
+ fix for [#31][issue-31] by allowing spaces to be considered valid characters
144
+ in strict octal handling. Octal conversion ignores leading spaces. Merged
145
+ from a slightly modified version of PR [#35][pull-35].
146
+
147
+ - [@dearblue](https://github.com/dearblue) contributed PR [#32][pull-32]
148
+ providing an explicit call to #bytesize for strings that include multibyte
149
+ characters. The PR has been modified to be compatible with older versions of
150
+ Ruby and extend tests.
151
+
152
+ - Akinori MUSHA (knu) contributed PR [#36][pull-36] that treats certain badly
153
+ encoded regular files (with names ending in `/`) as if they were directories
154
+ on decode.
155
+
156
+ ## 0.7 / 2018-02-19
157
+
158
+ - Fixed issue [#28][issue-28] with a modified version of PR [#29][pull-29]
159
+ covering the security policy and position for `Minitar`. Thanks so much to
160
+ [@ooooooo-q](https://github.com/ooooooo-q) for the report and an initial
161
+ patch. Additional information was added as [#30][issue-30].
162
+
163
+ - [@dearblue](https://github.com/dearblue) contributed PR [#33][pull-33]
164
+ providing a fix for `Minitar::Reader` when the IO-like object does not have
165
+ a `#pos` method.
166
+
167
+ - Kevin McDermott contributed PR [#34][pull-34] so that an InvalidTarStream is
168
+ raised if the tar header is not valid, preventing incorrect streaming of
169
+ files from a non-tarfile. This is a minor breaking change, so the version
170
+ has been bumped accordingly.
171
+
172
+ - Kazuyoshi Kato contributed PR [#26][pull-26] providing support for the GNU
173
+ tar long filename extension.
174
+
175
+ - Addressed a potential DOS with negative size fields in tar headers
176
+ ([#31][issue-31]). This has been handled in two ways: the size field in a
177
+ tar header is interpreted as a strict octal value and the `Minitar` reader
178
+ will raise an InvalidTarStream if the size ends up being negative anyway.
179
+
180
+ ## 0.6.1 / 2017-02-07
181
+
182
+ - Fixed issue [#24][issue-24] where streams were being improperly closed
183
+ immediately on open unless there was a block provided.
184
+
185
+ - Hopefully fixes issue [#23][issue-23] by releasing archive-tar-minitar after
186
+ minitar-cli is available.
187
+
188
+ ## 0.6 / 2017-02-07
189
+
190
+ - Breaking Changes:
191
+
192
+ - Extracted `bin/minitar` into a new gem, `minitar-cli`. No, I am _not_
193
+ going to bump the major version for this. As far as I can tell, few people
194
+ use the command-line utility anyway. (Installing `archive-tar-minitar`
195
+ will install both `minitar` and `minitar-cli`, at least until version
196
+ 1.0.)
197
+
198
+ - `Minitar` extraction before 0.6 traverses directories if the tarball
199
+ includes a relative directory reference, as reported in [#16][issue-16] by
200
+ [@ecneladis](https://github.com/ecneladis). This has been disallowed
201
+ entirely and will throw a `SecureRelativePathError` when found.
202
+ Additionally, if the final destination of an entry is an already-existing
203
+ symbolic link, the existing symbolic link will be removed and the file
204
+ will be written correctly (on platforms that support symbolic links).
205
+
206
+ - Enhancements:
207
+
208
+ - Licence change. After speaking with Mauricio Fernández, we have changed
209
+ the licensing of this library to Ruby and Simplified BSD and have dropped
210
+ the GNU GPL license. This takes effect from the 0.6 release.
211
+ - Printing a deprecation warning for including Archive::Tar to put `Minitar`
212
+ in the top-level namespace.
213
+ - Printing a deprecation warning for including `Archive::Tar::Minitar` into
214
+ a class (`Minitar` will be a class for version 1.0).
215
+ - Moved `Archive::Tar::PosixHeader` to `Archive::Tar::Minitar::PosixHeader`
216
+ with a deprecation warning. Do not depend on
217
+ `Archive::Tar::Minitar::PosixHeader`, as it will be moving to
218
+ `::Minitar::PosixHeader` in a future release.
219
+ - Added an alias, `::Minitar`, for `Archive::Tar::Minitar`, opted in with
220
+ `require 'minitar'`. In future releases, this alias will be enabled by
221
+ default, and the `Archive::Tar` namespace will be removed entirely for
222
+ version 1.0.
223
+ - Modified the handling of `mtime` in `PosixHeader` to do an integer
224
+ conversion (`#to_i`) so that a Time object can be used instead of the
225
+ integer value of the time object.
226
+ - `Writer::RestrictedStream` was renamed to `Writer::WriteOnlyStream` for
227
+ clarity. No alias or deprecation warning was provided for this as it is an
228
+ internal implementation detail.
229
+ - `Writer::BoundedStream` was renamed to `Writer::BoundedWriteStream` for
230
+ clarity. A deprecation warning is provided on first use because a
231
+ BoundedWriteStream may raise a `BoundedWriteStream::FileOverflow`
232
+ exception.
233
+ - `Writer::BoundedWriteStream::FileOverflow` has been renamed to
234
+ `Writer::WriteBoundaryOverflow` and inherits from `StandardError` instead
235
+ of `RuntimeError`. Note that for Ruby 2.0 or higher, an error will be
236
+ raised when specifying `Writer::BoundedWriteStream::FileOverflow` because
237
+ `Writer::BoundedWriteStream` has been declared a private constant.
238
+ - Modified `Writer#add_file_simple` to accept the data for a file in
239
+ `opts[:data]`. When `opts[:data]` is provided, a stream block must not be
240
+ provided. Improved the documentation for this method.
241
+ - Modified `Writer#add_file` to accept `opts[:data]` and transparently call
242
+ `Writer#add_file_simple` in this case.
243
+ - Methods that require blocks are no longer required, so the
244
+ `Archive::Tar::Minitar::BlockRequired` exception has been removed with a
245
+ warning (this may not work on Ruby 1.8).
246
+ - Dramatically reduced the number of strings created when creating a POSIX
247
+ tarball header.
248
+ - Added a helper, `Input.each_entry` that iterates over each entry in an
249
+ opened entry object.
250
+
251
+ - Bugs:
252
+
253
+ - Fix [#2][issue-02] to handle IO streams that are not seekable, such as
254
+ pipes, `STDIN`, or `STDOUT`.
255
+ - Fix [#3][issue-03] to make the test timezone resilient.
256
+ - Fix [#4][issue-04] for supporting the reading of tar files with filenames
257
+ in the GNU long filename extension format. Ported from
258
+ [@atoulme](https://github.com/atoulme)’s fork, originally provided by
259
+ Curtis Sampson.
260
+ - Fix [#6][issue-06] by making it raise the correct error for a long
261
+ filename with no path components.
262
+ - Fix [#13][issue-13] provided by [@fetep](https://github.com/fetep) fixes
263
+ an off-by-one error on filename splitting.
264
+ - Fix [#14][issue-14] provided by [@kzys](https://github.com/kzys) should
265
+ fix Windows detection issues.
266
+ - Fix [#16][issue-16] as specified above.
267
+ - Fix an issue where `Minitar.pack` would not include Unix hidden files when
268
+ creating a tarball.
269
+
270
+ - Development:
271
+
272
+ - Modernized minitar tooling around Hoe.
273
+ - Added travis and coveralls.
274
+
275
+ ## 0.5.2 / 2008-02-26
276
+
277
+ - Bugs:
278
+ - Fixed a Ruby 1.9 compatibility error.
279
+
280
+ ## 0.5.1 / 2004-09-27
281
+
282
+ - Bugs:
283
+ - Fixed a variable name error.
284
+
285
+ ## 0.5.0
286
+
287
+ - Initial release. Does files and directories. Command does create, extract,
288
+ and list.
289
+
290
+ [age]: https://github.com/FiloSottile/age
291
+ [hoe-halostatue]: https://github.com/halostatue/hoe-halostatue
292
+ [hoe-markdown]: https://github.com/flavorjones/hoe-markdown
293
+ [issue-02]: https://github.com/halostatue/minitar/issues/2
294
+ [issue-03]: https://github.com/halostatue/minitar/issues/3
295
+ [issue-04]: https://github.com/halostatue/minitar/issues/4
296
+ [issue-06]: https://github.com/halostatue/minitar/issues/6
297
+ [issue-07]: https://github.com/halostatue/minitar/issues/7
298
+ [issue-13]: https://github.com/halostatue/minitar/issues/13
299
+ [issue-14]: https://github.com/halostatue/minitar/issues/14
300
+ [issue-16]: https://github.com/halostatue/minitar/issues/16
301
+ [issue-23]: https://github.com/halostatue/minitar/issues/23
302
+ [issue-24]: https://github.com/halostatue/minitar/issues/24
303
+ [issue-28]: https://github.com/halostatue/minitar/issues/28
304
+ [issue-30]: https://github.com/halostatue/minitar/issues/30
305
+ [issue-31]: https://github.com/halostatue/minitar/issues/31
306
+ [issue-45]: https://github.com/halostatue/minitar/issues/45
307
+ [issue-46]: https://github.com/halostatue/minitar/issues/46
308
+ [issue-58]: https://github.com/halostatue/minitar/issues/58
309
+ [issue-62]: https://github.com/halostatue/minitar/issues/62
310
+ [issue-63]: https://github.com/halostatue/minitar/issues/63
311
+ [issue-65]: https://github.com/halostatue/minitar/issues/65
312
+ [pull-12]: https://github.com/halostatue/minitar/pull/12
313
+ [pull-26]: https://github.com/halostatue/minitar/pull/26
314
+ [pull-29]: https://github.com/halostatue/minitar/pull/29
315
+ [pull-32]: https://github.com/halostatue/minitar/pull/32
316
+ [pull-33]: https://github.com/halostatue/minitar/pull/33
317
+ [pull-34]: https://github.com/halostatue/minitar/pull/34
318
+ [pull-35]: https://github.com/halostatue/minitar/pull/35
319
+ [pull-36]: https://github.com/halostatue/minitar/pull/36
320
+ [pull-37]: https://github.com/halostatue/minitar/pull/37
321
+ [pull-40]: https://github.com/halostatue/minitar/pull/40
322
+ [pull-42]: https://github.com/halostatue/minitar/pull/42
323
+ [pull-43]: https://github.com/halostatue/minitar/pull/43
324
+ [pull-47]: https://github.com/halostatue/minitar/pull/47
325
+ [pull-121]: https://github.com/halostatue/minitar/pull/121
326
+ [tidelift]: https://tidelift.com/security
@@ -0,0 +1,167 @@
1
+ # Contributor Covenant 3.0 Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We pledge to make our community welcoming, safe, and equitable for all.
6
+
7
+ We are committed to fostering an environment that respects and promotes the
8
+ dignity, rights, and contributions of all individuals, regardless of
9
+ characteristics including race, ethnicity, caste, color, age, physical
10
+ characteristics, neurodiversity, disability, sex or gender, gender identity or
11
+ expression, sexual orientation, language, philosophy or religion, national or
12
+ social origin, socio-economic position, level of education, or other status.
13
+ The same privileges of participation are extended to everyone who participates
14
+ in good faith and in accordance with this Covenant.
15
+
16
+ ## Encouraged Behaviors
17
+
18
+ While acknowledging differences in social norms, we all strive to meet our
19
+ community's expectations for positive behavior. We also understand that our
20
+ words and actions may be interpreted differently than we intend based on
21
+ culture, background, or native language.
22
+
23
+ With these considerations in mind, we agree to behave mindfully toward each
24
+ other and act in ways that center our shared values, including:
25
+
26
+ 1. Respecting the **purpose of our community**, our activities, and our ways
27
+ of gathering.
28
+ 2. Engaging **kindly and honestly** with others.
29
+ 3. Respecting **different viewpoints** and experiences.
30
+ 4. **Taking responsibility** for our actions and contributions.
31
+ 5. Gracefully giving and accepting **constructive feedback**.
32
+ 6. Committing to **repairing harm** when it occurs.
33
+ 7. Behaving in other ways that promote and sustain the **well-being of our
34
+ community**.
35
+
36
+ ## Restricted Behaviors
37
+
38
+ We agree to restrict the following behaviors in our community. Instances,
39
+ threats, and promotion of these behaviors are violations of this Code of
40
+ Conduct.
41
+
42
+ 1. **Harassment.** Violating explicitly expressed boundaries or engaging in
43
+ unnecessary personal attention after any clear request to stop.
44
+ 2. **Character attacks.** Making insulting, demeaning, or pejorative comments
45
+ directed at a community member or group of people.
46
+ 3. **Stereotyping or discrimination.** Characterizing anyone’s personality or
47
+ behavior on the basis of immutable identities or traits.
48
+ 4. **Sexualization.** Behaving in a way that would generally be considered
49
+ inappropriately intimate in the context or purpose of the community.
50
+ 5. **Violating confidentiality**. Sharing or acting on someone's personal or
51
+ private information without their permission.
52
+ 6. **Endangerment.** Causing, encouraging, or threatening violence or other
53
+ harm toward any person or group.
54
+ 7. Behaving in other ways that **threaten the well-being** of our community.
55
+
56
+ ### Other Restrictions
57
+
58
+ 1. **Misleading identity.** Impersonating someone else for any reason, or
59
+ pretending to be someone else to evade enforcement actions.
60
+ 2. **Failing to credit sources.** Not properly crediting the sources of
61
+ content you contribute.
62
+ 3. **Promotional materials**. Sharing marketing or other commercial content in
63
+ a way that is outside the norms of the community.
64
+ 4. **Irresponsible communication.** Failing to responsibly present content
65
+ which includes, links or describes any other restricted behaviors.
66
+
67
+ ## Reporting an Issue
68
+
69
+ Tensions can occur between community members even when they are trying their
70
+ best to collaborate. Not every conflict represents a code of conduct
71
+ violation, and this Code of Conduct reinforces encouraged behaviors and norms
72
+ that can help avoid conflicts and minimize harm.
73
+
74
+ When an incident does occur, it is important to report it promptly. To report
75
+ a possible violation, create a [private security advisory][advisory]
76
+ — violations of this code of conduct are considered security vulnerabilities.
77
+
78
+ Community Moderators take reports of violations seriously and will make every
79
+ effort to respond in a timely manner. They will investigate all reports of
80
+ code of conduct violations, reviewing messages, logs, and recordings, or
81
+ interviewing witnesses and other participants. Community Moderators will keep
82
+ investigation and enforcement actions as transparent as possible while
83
+ prioritizing safety and confidentiality. In order to honor these values,
84
+ enforcement actions are carried out in private with the involved parties, but
85
+ communicating to the whole community may be part of a mutually agreed upon
86
+ resolution.
87
+
88
+ ## Addressing and Repairing Harm
89
+
90
+ If an investigation by the Community Moderators finds that this Code of
91
+ Conduct has been violated, the following enforcement ladder may be used to
92
+ determine how best to repair harm, based on the incident's impact on the
93
+ individuals involved and the community as a whole. Depending on the severity
94
+ of a violation, lower rungs on the ladder may be skipped.
95
+
96
+ 1. Warning
97
+ 1. Event: A violation involving a single incident or series of incidents.
98
+ 2. Consequence: A private, written warning from the Community Moderators.
99
+ 3. Repair: Examples of repair include a private written apology,
100
+ acknowledgement of responsibility, and seeking clarification on
101
+ expectations.
102
+
103
+ 2. Temporarily Limited Activities
104
+ 1. Event: A repeated incidence of a violation that previously resulted in a
105
+ warning, or the first incidence of a more serious violation.
106
+ 2. Consequence: A private, written warning with a time-limited cooldown
107
+ period designed to underscore the seriousness of the situation and give
108
+ the community members involved time to process the incident. The
109
+ cooldown period may be limited to particular communication channels or
110
+ interactions with particular community members.
111
+ 3. Repair: Examples of repair may include making an apology, using the
112
+ cooldown period to reflect on actions and impact, and being thoughtful
113
+ about re-entering community spaces after the period is over.
114
+
115
+ 3. Temporary Suspension
116
+ 1. Event: A pattern of repeated violation which the Community Moderators
117
+ have tried to address with warnings, or a single serious violation.
118
+ 2. Consequence: A private written warning with conditions for return from
119
+ suspension. In general, temporary suspensions give the person being
120
+ suspended time to reflect upon their behavior and possible corrective
121
+ actions.
122
+ 3. Repair: Examples of repair include respecting the spirit of the
123
+ suspension, meeting the specified conditions for return, and being
124
+ thoughtful about how to reintegrate with the community when the
125
+ suspension is lifted.
126
+
127
+ 4. Permanent Ban
128
+ 1. Event: A pattern of repeated code of conduct violations that other steps
129
+ on the ladder have failed to resolve, or a violation so serious that the
130
+ Community Moderators determine there is no way to keep the community
131
+ safe with this person as a member.
132
+ 2. Consequence: Access to all community spaces, tools, and communication
133
+ channels is removed. In general, permanent bans should be rarely used,
134
+ should have strong reasoning behind them, and should only be resorted to
135
+ if working through other remedies has failed to change the behavior.
136
+ 3. Repair: There is no possible repair in cases of this severity.
137
+
138
+ This enforcement ladder is intended as a guideline. It does not limit the
139
+ ability of Community Managers to use their discretion and judgment, in keeping
140
+ with the best interests of our community.
141
+
142
+ ## Scope
143
+
144
+ This Code of Conduct applies within all community spaces, and also applies
145
+ when an individual is officially representing the community in public or other
146
+ spaces. Examples of representing our community include using an official email
147
+ address, posting via an official social media account, or acting as an
148
+ appointed representative at an online or offline event.
149
+
150
+ ## Attribution
151
+
152
+ This Code of Conduct is adapted from the Contributor Covenant, version 3.0,
153
+ permanently available at <https://www.contributor-covenant.org/version/3/0/>.
154
+
155
+ Contributor Covenant is stewarded by the Organization for Ethical Source and
156
+ licensed under CC BY-SA 4.0. To view a copy of this license, visit
157
+ <https://creativecommons.org/licenses/by-sa/4.0/>.
158
+
159
+ For answers to common questions about Contributor Covenant, see the FAQ at
160
+ <https://www.contributor-covenant.org/faq>. Translations are provided at
161
+ <https://www.contributor-covenant.org/translations>. Additional enforcement
162
+ and community guideline resources can be found at
163
+ <https://www.contributor-covenant.org/resources>. The enforcement ladder was
164
+ inspired by the work of [Mozilla’s code of conduct team][inclusion].
165
+
166
+ [advisory]: https://github.com/halostatue/minitar/security/advisories/new
167
+ [inclusion]: https://github.com/mozilla/inclusion