minitar 0.12 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1599b7ba095a509ecf3e4cb540bc364307275322f7794cc57a08cfe338bf410c
4
- data.tar.gz: e2772f9012f50c7fef8ae5b8c8f30a7ac6e43946ceff776cd53ad9d8f5749eb2
3
+ metadata.gz: 64cb6019b1b62131244aee4503ca406f0828182eaadef04f12e54fa0f757b480
4
+ data.tar.gz: 58f1522ba94f6299d9b70fba3a2cacffe2da2080a42e7fa0a2d3a37a050e4bd9
5
5
  SHA512:
6
- metadata.gz: 0d2fd6dfbfeb28f40ad1bc0654fc1dc2cb2ca9743006009bd6af0f38f1de164a47043c0f8f45db64c668617d8f62154efe73d1c211227f52fa4a45060b218053
7
- data.tar.gz: 7227d0e1ee873ca7cea9bef8709b3144f3d218391fc5655c86fba83716dbf78733b3632fac0980d7ce64f258c64004416263d1d2d30f5137bcd11bfe31f28214
6
+ metadata.gz: 6500363b15feec90fdec5c5da4ef39ef01be47080678dbc8e557a19bfa54baf3e66803b223093bd5bfe43f783e797c9f7770543b16812284bdc1798c74d04347
7
+ data.tar.gz: 8a064c89a64f9e7f4b6d054f5b257dbecdcb8d5d248bec32ce28d5d00bd27b1cdfb7fce6f2354b406c63300b6ee92535d9ff8b47406318ce06249463543d342c
data/History.md CHANGED
@@ -1,156 +1,158 @@
1
1
  # History
2
2
 
3
- ## 0.12 / 2024-08-DD
3
+ ## 0.12.1 / 2024-08-21
4
4
 
5
- - Properly handle very long GNU filenames, resolving [#46][].
6
- - Handle very long GNU filenames that are 512 or more bytes, resolving [#45][].
7
- Originally implemented in [#47][] by Vijay, but accidentally closed.
5
+ - Reverted @adbbb9b596 to restore compatibility with Ruby < 2.0. Resolves
6
+ [#63][#63] reported by Robert Schulze.
7
+
8
+ ## 0.12 / 2024-08-06
9
+
10
+ - Properly handle very long GNU filenames, resolving [#46][#46].
11
+ - Handle very long GNU filenames that are 512 or more bytes, resolving
12
+ [#45][#45]. Originally implemented in [#47][#47] by Vijay, but accidentally
13
+ closed.
8
14
 
9
15
  ## 0.11 / 2022-12-31
10
16
 
11
- - symlink support is complete. Merged as PR [#42][], rebased and built on top of
12
- PR [#12][] by fetep.
17
+ - symlink support is complete. Merged as PR [#42][#42], rebased and built on top
18
+ of PR [#12][#12] by fetep.
13
19
 
14
- - kymmt90 fixed a documentation error on Minitar.pack in PR [#43][].
20
+ - kymmt90 fixed a documentation error on Minitar.pack in PR [#43][#43].
15
21
 
16
22
  - This version is a soft-deprecation of all versions before Ruby 2.7, as they
17
23
  will no longer be tested in CI.
18
24
 
19
25
  ## 0.10 / 2022-03-26
20
26
 
21
- - nevesenin fixed an issue with long filename handling. Merged as PR [#40][].
27
+ - nevesenin fixed an issue with long filename handling. Merged as PR [#40][#40].
22
28
 
23
29
  ## 0.9 / 2019-09-04
24
30
 
25
- - jtappa added the ability to skip fsync with a new option to Minitar.unpack
26
- and Minitar::Input#extract_entry. Provide `:fsync => false` as the last
27
- parameter to enable. Merged from a modified version of PR [#37][].
31
+ - jtappa added the ability to skip fsync with a new option to Minitar.unpack and
32
+ Minitar::Input#extract_entry. Provide `:fsync => false` as the last parameter
33
+ to enable. Merged from a modified version of PR [#37][#37].
28
34
 
29
35
  ## 0.8 / 2019-01-05
30
36
 
31
- - inkstak resolved an issue introduced in the fix for [#31][] by allowing
37
+ - inkstak resolved an issue introduced in the fix for [#31][#31] by allowing
32
38
  spaces to be considered valid characters in strict octal handling. Octal
33
- conversion ignores leading spaces. Merged from a slightly modified version
34
- of PR [#35][].
39
+ conversion ignores leading spaces. Merged from a slightly modified version of
40
+ PR [#35][#35].
35
41
 
36
- - dearblue contributed PR [#32][] providing an explicit call to #bytesize for
42
+ - dearblue contributed PR [#32][#32] providing an explicit call to #bytesize for
37
43
  strings that include multibyte characters. The PR has been modified to be
38
44
  compatible with older versions of Ruby and extend tests.
39
45
 
40
- - Akinori MUSHA (knu) contributed PR [#36][] that treats certain badly
41
- encoded regular files (with names ending in `/`) as if they were
42
- directories on decode.
46
+ - Akinori MUSHA (knu) contributed PR [#36][#36] that treats certain badly
47
+ encoded regular files (with names ending in `/`) as if they were directories
48
+ on decode.
43
49
 
44
50
  ## 0.7 / 2018-02-19
45
51
 
46
- - Fixed issue [#28][] with a modified version of PR [#29][] covering the
47
- security policy and position for Minitar. Thanks so much to ooooooo_q for
48
- the report and an initial patch. Additional information was added as
49
- [#30][].
52
+ - Fixed issue [#28][#28] with a modified version of PR [#29][#29] covering the
53
+ security policy and position for Minitar. Thanks so much to ooooooo_q for the
54
+ report and an initial patch. Additional information was added as [#30][#30].
50
55
 
51
- - dearblue contributed PR [#33][] providing a fix for Minitar::Reader when
56
+ - dearblue contributed PR [#33][#33] providing a fix for Minitar::Reader when
52
57
  the IO-like object does not have a `#pos` method.
53
58
 
54
- - Kevin McDermott contributed PR [#34][] so that an InvalidTarStream is
55
- raised if the tar header is not valid, preventing incorrect streaming of
56
- files from a non-tarfile. This is a minor breaking change, so the version
57
- has been bumped accordingly.
59
+ - Kevin McDermott contributed PR [#34][#34] so that an InvalidTarStream is
60
+ raised if the tar header is not valid, preventing incorrect streaming of files
61
+ from a non-tarfile. This is a minor breaking change, so the version has been
62
+ bumped accordingly.
58
63
 
59
- - Kazuyoshi Kato contributed PR [#26][] providing support for the GNU tar
64
+ - Kazuyoshi Kato contributed PR [#26][#26] providing support for the GNU tar
60
65
  long filename extension.
61
66
 
62
67
  - Addressed a potential DOS with negative size fields in tar headers
63
- ([#31][]). This has been handled in two ways: the size field in a tar
68
+ ([#31][#31]). This has been handled in two ways: the size field in a tar
64
69
  header is interpreted as a strict octal value and the Minitar reader will
65
70
  raise an InvalidTarStream if the size ends up being negative anyway.
66
71
 
67
72
  ## 0.6.1 / 2017-02-07
68
73
 
69
- - Fixed issue [#24][] where streams were being improperly closed immediately
74
+ - Fixed issue [#24][#24] where streams were being improperly closed immediately
70
75
  on open unless there was a block provided.
71
76
 
72
- - Hopefully fixes issue [#23][] by releasing archive-tar-minitar after
77
+ - Hopefully fixes issue [#23][#23] by releasing archive-tar-minitar after
73
78
  minitar-cli is available.
74
79
 
75
80
  ## 0.6 / 2017-02-07
76
81
 
77
82
  - Breaking Changes:
78
83
 
79
- - Extracted `bin/minitar` into a new gem, `minitar-cli`. No, I am _not_
80
- going to bump the major version for this. As far as I can tell, few
81
- people use the command-line utility anyway. (Installing
82
- `archive-tar-minitar` will install both `minitar` and `minitar-cli`, at
83
- least until version 1.0.)
84
+ - Extracted `bin/minitar` into a new gem, `minitar-cli`. No, I am _not_ going
85
+ to bump the major version for this. As far as I can tell, few people use the
86
+ command-line utility anyway. (Installing `archive-tar-minitar` will install
87
+ both `minitar` and `minitar-cli`, at least until version 1.0.)
84
88
 
85
- - Minitar extraction before 0.6 traverses directories if the tarball
86
- includes a relative directory reference, as reported in [#16][] by
87
- @ecneladis. This has been disallowed entirely and will throw a
88
- SecureRelativePathError when found. Additionally, if the final
89
- destination of an entry is an already-existing symbolic link, the
90
- existing symbolic link will be removed and the file will be written
91
- correctly (on platforms that support symblic links).
89
+ - Minitar extraction before 0.6 traverses directories if the tarball includes
90
+ a relative directory reference, as reported in [#16][#16] by @ecneladis.
91
+ This has been disallowed entirely and will throw a SecureRelativePathError
92
+ when found. Additionally, if the final destination of an entry is an
93
+ already-existing symbolic link, the existing symbolic link will be removed
94
+ and the file will be written correctly (on platforms that support symblic
95
+ links).
92
96
 
93
97
  - Enhancements:
94
98
 
95
- - Licence change. After speaking with Mauricio Fernández, we have changed
96
- the licensing of this library to Ruby and Simplified BSD and have
97
- dropped the GNU GPL license. This takes effect from the 0.6 release.
98
- - Printing a deprecation warning for including Archive::Tar to put
99
- Minitar in the top-level namespace.
100
- - Printing a deprecation warning for including Archive::Tar::Minitar into
101
- a class (Minitar will be a class for version 1.0).
102
- - Moved Archive::Tar::PosixHeader to Archive::Tar::Minitar::PosixHeader
103
- with a deprecation warning. Do not depend on
104
- Archive::Tar::Minitar::PosixHeader, as it will be moving to
105
- ::Minitar::PosixHeader in a future release.
99
+ - Licence change. After speaking with Mauricio Fernández, we have changed the
100
+ licensing of this library to Ruby and Simplified BSD and have dropped the
101
+ GNU GPL license. This takes effect from the 0.6 release.
102
+ - Printing a deprecation warning for including Archive::Tar to put Minitar in
103
+ the top-level namespace.
104
+ - Printing a deprecation warning for including Archive::Tar::Minitar into a
105
+ class (Minitar will be a class for version 1.0).
106
+ - Moved Archive::Tar::PosixHeader to Archive::Tar::Minitar::PosixHeader with a
107
+ deprecation warning. Do not depend on Archive::Tar::Minitar::PosixHeader, as
108
+ it will be moving to ::Minitar::PosixHeader in a future release.
106
109
  - Added an alias, ::Minitar, for Archive::Tar::Minitar, opted in with
107
110
  `require 'minitar'`. In future releases, this alias will be enabled by
108
- default, and the Archive::Tar namespace will be removed entirely for
109
- version 1.0.
110
- - Modified the handling of `mtime` in PosixHeader to do an integer
111
- conversion (#to_i) so that a Time object can be used instead of the
112
- integer value of the time object.
113
- - Writer::RestrictedStream was renamed to Writer::WriteOnlyStream for
114
- clarity. No alias or deprecation warning was provided for this as it is
115
- an internal implementation detail.
116
- - Writer::BoundedStream was renamed to Writer::BoundedWriteStream for
117
- clarity. A deprecation warning is provided on first use because a
118
- BoundedWriteStream may raise a BoundedWriteStream::FileOverflow
119
- exception.
111
+ default, and the Archive::Tar namespace will be removed entirely for version
112
+ 1.0.
113
+ - Modified the handling of `mtime` in PosixHeader to do an integer conversion
114
+ (#to_i) so that a Time object can be used instead of the integer value of
115
+ the time object.
116
+ - Writer::RestrictedStream was renamed to Writer::WriteOnlyStream for clarity.
117
+ No alias or deprecation warning was provided for this as it is an internal
118
+ implementation detail.
119
+ - Writer::BoundedStream was renamed to Writer::BoundedWriteStream for clarity.
120
+ A deprecation warning is provided on first use because a BoundedWriteStream
121
+ may raise a BoundedWriteStream::FileOverflow exception.
120
122
  - Writer::BoundedWriteStream::FileOverflow has been renamed to
121
- Writer::WriteBoundaryOverflow and inherits from StandardError instead
122
- of RuntimeError. Note that for Ruby 2.0 or higher, an error will be
123
- raised when specifying Writer::BoundedWriteStream::FileOverflow because
123
+ Writer::WriteBoundaryOverflow and inherits from StandardError instead of
124
+ RuntimeError. Note that for Ruby 2.0 or higher, an error will be raised when
125
+ specifying Writer::BoundedWriteStream::FileOverflow because
124
126
  Writer::BoundedWriteStream has been declared a private constant.
125
- - Modified Writer#add_file_simple to accept the data for a
126
- file in `opts[:data]`. When `opts[:data]` is provided, a stream block
127
- must not be provided. Improved the documentation for this method.
127
+ - Modified Writer#add_file_simple to accept the data for a file in
128
+ `opts[:data]`. When `opts[:data]` is provided, a stream block must not be
129
+ provided. Improved the documentation for this method.
128
130
  - Modified Writer#add_file to accept `opts[:data]` and transparently call
129
131
  Writer#add_file_simple in this case.
130
132
  - Methods that require blocks are no longer required, so the
131
133
  Archive::Tar::Minitar::BlockRequired exception has been removed with a
132
134
  warning (this may not work on Ruby 1.8).
133
- - Dramatically reduced the number of strings created when creating a
134
- POSIX tarball header.
135
- - Added a helper, Input.each_entry that iterates over each entry in an
136
- opened entry object.
135
+ - Dramatically reduced the number of strings created when creating a POSIX
136
+ tarball header.
137
+ - Added a helper, Input.each_entry that iterates over each entry in an opened
138
+ entry object.
137
139
 
138
140
  - Bugs:
139
141
 
140
- - Fix [#2][] to handle IO streams that are not seekable, such as pipes,
142
+ - Fix [#2][#2] to handle IO streams that are not seekable, such as pipes,
141
143
  STDIN, or STDOUT.
142
- - Fix [#3][] to make the test timezone resilient.
143
- - Fix [#4][] for supporting the reading of tar files with filenames in
144
- the GNU long filename extension format. Ported from @atoulme’s fork,
145
- originally provided by Curtis Sampson.
146
- - Fix [#6][] by making it raise the correct error for a long filename
147
- with no path components.
148
- - Fix [#13][] provided by @fetep fixes an off-by-one error on filename
144
+ - Fix [#3][#3] to make the test timezone resilient.
145
+ - Fix [#4][#4] for supporting the reading of tar files with filenames in the
146
+ GNU long filename extension format. Ported from @atoulme’s fork, originally
147
+ provided by Curtis Sampson.
148
+ - Fix [#6][#6] by making it raise the correct error for a long filename with
149
+ no path components.
150
+ - Fix [#13][#13] provided by @fetep fixes an off-by-one error on filename
149
151
  splitting.
150
- - Fix [#14][] provided by @kzys should fix Windows detection issues.
151
- - Fix [#16][] as specified above.
152
- - Fix an issue where Minitar.pack would not include Unix hidden files
153
- when creating a tarball.
152
+ - Fix [#14][#14] provided by @kzys should fix Windows detection issues.
153
+ - Fix [#16][#16] as specified above.
154
+ - Fix an issue where Minitar.pack would not include Unix hidden files when
155
+ creating a tarball.
154
156
 
155
157
  - Development:
156
158
 
@@ -169,8 +171,8 @@
169
171
 
170
172
  ## 0.5.0
171
173
 
172
- - Initial release. Does files and directories. Command does create, extract,
173
- and list.
174
+ - Initial release. Does files and directories. Command does create, extract, and
175
+ list.
174
176
 
175
177
  [#2]: https://github.com/halostatue/minitar/issues/2
176
178
  [#3]: https://github.com/halostatue/minitar/issues/3
@@ -199,3 +201,4 @@
199
201
  [#45]: https://github.com/halostatue/minitar/issues/45
200
202
  [#46]: https://github.com/halostatue/minitar/issues/46
201
203
  [#47]: https://github.com/halostatue/minitar/pull/47
204
+ [#63]: https://github.com/halostatue/minitar/issues/63
@@ -135,7 +135,7 @@ module Archive::Tar::Minitar
135
135
  # However, squeeze consecutive '/' characters together.
136
136
  full_name = entry.full_name.squeeze("/")
137
137
 
138
- if /\.{2}(?:\/|\z)/.match?(full_name)
138
+ if full_name =~ /\.{2}(?:\/|\z)/
139
139
  raise SecureRelativePathError, "Path contains '..'"
140
140
  end
141
141
 
@@ -125,7 +125,7 @@ class Archive::Tar::Minitar::PosixHeader
125
125
  private
126
126
 
127
127
  def strict_oct(string)
128
- return string.oct if /\A[0-7 ]*\z/.match?(string)
128
+ return string.oct if string =~ /\A[0-7 ]*\z/
129
129
  raise ArgumentError, "#{string.inspect} is not a valid octal string"
130
130
  end
131
131
  end
@@ -74,7 +74,7 @@ end
74
74
  # tar.close
75
75
  # end
76
76
  module Archive::Tar::Minitar
77
- VERSION = "0.12".freeze # :nodoc:
77
+ VERSION = "0.12.1".freeze # :nodoc:
78
78
 
79
79
  # The base class for any minitar error.
80
80
  Error = Class.new(::StandardError)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: minitar
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.12'
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Austin Ziegler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-06 00:00:00.000000000 Z
11
+ date: 2024-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest