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