Debian Codegraph @

third_party/rust/tempfile/CHANGELOG.md

raw
1 # Changelog
2
3 ## 3.16.0
4
5 - Update `getrandom` to `0.3.0` (thanks to @paolobarbolini).
6 - Allow `windows-sys` versions `0.59.x` in addition to `0.59.0` (thanks @ErichDonGubler).
7 - Improved security documentation (thanks to @n0toose for collaborating with me on this).
8
9 ## 3.15.0
10
11 Re-seed the per-thread RNG from system randomness when we repeatedly fail to create temporary files (#314). This resolves a potential DoS vector (#178) while avoiding `getrandom` in the common case where it's necessary. The feature is optional but enabled by default via the `getrandom` feature.
12
13 For libc-free builds, you'll either need to disable this feature or opt-in to a different [`getrandom` backend](https://github.com/rust-random/getrandom?tab=readme-ov-file#opt-in-backends).
14
15 ## 3.14.0
16
17 - Make the wasip2 target work (requires tempfile's "nightly" feature to be enabled). [#305](https://github.com/Stebalien/tempfile/pull/305).
18 - Allow older windows-sys versions [#304](https://github.com/Stebalien/tempfile/pull/304).
19
20 ## 3.13.0
21
22 - Add `with_suffix` constructors for easily creating new temporary files with a specific suffix (e.g., a specific file extension). Thanks to @Borgerr.
23 - Update dependencies (fastrand & rustix).
24
25 ## 3.12.0
26
27 - Add a `keep(keep: bool)` function to builder that suppresses delete-on-drop behavior (thanks to @RalfJung).
28 - Update `windows-sys` from 0.52 to 0.59.
29
30 ## 3.11.0
31
32 - Add the ability to override the default temporary directory. This API shouldn't be used in general, but there are some cases where it's unavoidable.
33
34 ## 3.10.1
35
36 - Handle potential integer overflows in 32-bit systems when seeking/truncating "spooled" temporary files past 4GiB (2³²).
37 - Handle a theoretical 32-bit overflow when generating a temporary file name larger than 4GiB. Now it'll panic (on allocation failure) rather than silently succeeding due to wraparound.
38
39 Thanks to @stoeckmann for finding and fixing both of these issues.
40
41 ## 3.10.0
42
43 - Drop `redox_syscall` dependency, we now use `rustix` for Redox.
44 - Add `Builder::permissions` for setting the permissions on temporary files and directories (thanks to @Byron).
45 - Update rustix to 0.38.31.
46 - Update fastrand to 2.0.1.
47
48 ## 3.9.0
49
50 - Updates windows-sys to 0.52
51 - Updates minimum rustix version to 0.38.25
52
53 ## 3.8.1
54
55 - Update rustix to fix a potential panic on `persist_noclobber` on android.
56 - Update redox_syscall to 0.4 (on redox).
57 - Fix some docs typos.
58
59 ## 3.8.0
60
61 - Added `with_prefix` and `with_prefix_in` to `TempDir` and `NamedTempFile` to make it easier to create temporary files/directories with nice prefixes.
62 - Misc cleanups.
63
64 ## 3.7.1
65
66 - Tempfile builds on haiku again.
67 - Under the hood, we've switched from the unlinkat/linkat syscalls to the regular unlink/link syscalls where possible.
68
69 ## 3.7.0
70
71 BREAKING: This release updates the MSRV to 1.63. This isn't an API-breaking change (so no major
72 release) but it's still a breaking change for some users.
73
74 - Update fastrand from 1.6 to 2.0
75 - Update rustix to 0.38
76 - Updates the MSRV to 1.63.
77 - Provide AsFd/AsRawFd on wasi.
78
79 ## 3.6.0
80
81 - Update windows-sys to 0.48.
82 - Update rustix min version to 0.37.11
83 - Forward some `NamedTempFile` and `SpooledTempFile` methods to the underlying `File` object for
84 better performance (especially vectorized writes, etc.).
85 - Implement `AsFd` and `AsHandle`.
86 - Misc documentation fixes and code cleanups.
87
88 ## 3.5.0
89
90 - Update rustix from 0.36 to 0.37.1. This makes wasi work on rust stable
91 - Update `windows-sys`, `redox_syscall`
92 - BREAKING: Remove the implementation of `Write for &NamedTempFile<F> where &F: Write`. Unfortunately, this can cause compile issues in unrelated code (https://github.com/Stebalien/tempfile/issues/224).
93
94 ## 3.4.0
95
96 SECURITY: Prior `tempfile` releases depended on `remove_dir_all` version 0.5.0 which was vulnerable to a [TOCTOU race](https://github.com/XAMPPRocky/remove_dir_all/security/advisories/GHSA-mc8h-8q98-g5hr). This same race is present in rust versions prior to 1.58.1.
97
98 Features:
99
100 - Generalized temporary files: `NamedTempFile` can now abstract over different kinds of files (e.g.,
101 unix domain sockets, pipes, etc.):
102 - Add `Builder::make` and `Builder::make_in` for generalized temp file
103 creation.
104 - Add `NamedTempFile::from_parts` to complement `NamedTempFile::into_parts`.
105 - Add generic parameter to `NamedTempFile` to support wrapping non-File types.
106
107 Bug Fixes/Improvements:
108
109 - Don't try to create a temporary file multiple times if the file path has been fully specified by
110 the user (no random characters).
111 - `NamedTempFile::persist_noclobber` is now always atomic on linux when `renameat_with` is
112 supported. Previously, it would first link the new path, then unlink the previous path.
113 - Fix compiler warnings on windows.
114
115 Trivia:
116
117 - Switch from `libc` to `rustix` on wasi/unix. This now makes direct syscalls instead of calling
118 through libc.
119 - Remove `remove_dir_all` dependency. The rust standard library has optimized their internal version
120 significantly.
121 - Switch to official windows-sys windows bindings.
122
123 Breaking:
124
125 - The minimum rust version is now `1.48.0`.
126 - Mark most functions as `must_use`.
127 - Uses direct syscalls on linux by default, instead of libc.
128 - The new type parameter in `NamedTempFile` may lead to type inference issues in some cases.
129
130 ## 3.3.0
131
132 Features:
133
134 - Replace rand with fastrand for a significantly smaller dependency tree. Cryptographic randomness
135 isn't necessary for temporary file names, and isn't all that helpful either.
136 - Add limited WASI support.
137 - Add a function to extract the inner data from a `SpooledTempFile`.
138
139 Bug Fixes:
140
141 - Make it possible to persist unnamed temporary files on linux by removing the `O_EXCL` flag.
142 - Fix redox minimum crate version.
143
144 ## 3.2.0
145
146 Features:
147
148 - Bump rand dependency to `0.8`.
149 - Bump cfg-if dependency to `1.0`
150
151 Other than that, this release mostly includes small cleanups and simplifications.
152
153 Breaking: The minimum rust version is now `1.40.0`.
154
155 ## 3.1.0
156
157 Features:
158
159 - Bump rand dependency to `0.7`.
160
161 Breaking: The minimum rust version is now `1.32.0`.
162
163 ## 3.0.9
164
165 Documentation:
166
167 - Add an example for reopening a named temporary file.
168 - Flesh out the security documentation.
169
170 Features:
171
172 - Introduce an `append` option to the builder.
173 - Errors:
174 - No longer implement the soft-deprecated `description`.
175 - Implement `source` instead of `cause`.
176
177 Breaking: The minimum rust version is now 1.30.
178
179 ## 3.0.8
180
181 This is a bugfix release.
182
183 Fixes:
184
185 - Export `PathPersistError`.
186 - Fix a bug where flushing a `SpooledTempFile` to disk could fail to write part
187 of the file in some rare, yet-to-reproduced cases.
188
189 ## 3.0.7
190
191 Breaking:
192
193 - `Builder::prefix` and `Builder::suffix` now accept a generic `&AsRef<OsStr>`.
194 This could affect type inference.
195 - Temporary files (except unnamed temporary files on Windows and Linux >= 3.11)
196 now use absolute path names. This will break programs that create temporary
197 files relative to their current working directory when they don't have the
198 search permission (x) on some ancestor directory. This is only likely to
199 affect programs with strange chroot-less filesystem sandboxes. If you believe
200 you're affected by this issue, please comment on #40.
201
202 Features:
203
204 - Accept anything implementing `&AsRef<OsStr>` in the builder: &OsStr, &OsString, &Path, etc.
205
206 Fixes:
207
208 - Fix LFS support.
209 - Use absolute paths for named temporary files to guard against changes in the
210 current directory.
211 - Use absolute paths when creating unnamed temporary files on platforms that
212 can't create unlinked or auto-deleted temporary files. This fixes a very
213 unlikely race where the current directory could change while the temporary
214 file is being created.
215
216 Misc:
217
218 - Use modern stdlib features to avoid custom unsafe code. This reduces the
219 number of unsafe blocks from 12 to 4.
220
221 ## 3.0.6
222
223 - Don't hide temporary files on windows, fixing #66 and #69.
224
225 ## 3.0.5
226
227 Features:
228
229 - Added a spooled temporary file implementation. This temporary file variant
230 starts out as an in-memory temporary file but "rolls-over" onto disk when it
231 grows over a specified size (#68).
232 - Errors are now annotated with paths to make debugging easier (#73).
233
234 Misc:
235
236 - The rand version has been bumped to 0.6 (#74).
237
238 Bugs:
239
240 - Tempfile compiles again on Redox (#75).
241
242 ## 3.0.4
243
244 - Now compiles on unsupported platforms.
245
246 ## 3.0.3
247
248 - update rand to 0.5
249
250 ## 3.0.2
251
252 - Actually *delete* temporary files on non-Linux unix systems (thanks to
253 @oliverhenshaw for the fix and a test case).
254
255 ## 3.0.1
256
257 - Restore NamedTempFile::new_in
258
259 ## 3.0.0
260
261 - Adds temporary directory support (@KodrAus)
262 - Allow closing named temporary files without deleting them (@jasonwhite)
263
264 ## 2.2.0
265
266 - Redox Support
267
268 ## 2.1.6
269
270 - Remove build script and bump minimum rustc version to 1.9.0
271
272 ## 2.1.5
273
274 - Don't build platform-specific dependencies on all platforms.
275 - Cleanup some documentation.
276
277 ## 2.1.4
278
279 - Fix crates.io tags. No interesting changes.
280
281 ## 2.1.3
282
283 Export `PersistError`.
284
285 ## 2.1.2
286
287 Add `Read`/`Write`/`Seek` impls on `&NamedTempFile`. This mirrors the
288 implementations on `&File`. One can currently just deref to a `&File` but these
289 implementations are more discoverable.
290
291 ## 2.1.1
292
293 Add LFS Support.
294
295 ## 2.1.0
296
297 - Implement `AsRef<File>` for `NamedTempFile` allowing named temporary files to
298 be borrowed as `File`s.
299 - Add a method to convert a `NamedTempFile` to an unnamed temporary `File`.
300
301 ## 2.0.1
302
303 - Arm bugfix
304
305 ## 2.0.0
306
307 This release replaces `TempFile` with a `tempfile()` function that returns
308 `std::fs::File` objects. These are significantly more useful because most rust
309 libraries expect normal `File` objects.
310
311 To continue supporting shared temporary files, this new version adds a
312 `reopen()` method to `NamedTempFile`.