commit_hash stringlengths 40 40 | author stringlengths 1 57 | date timestamp[s]date 2010-07-26 04:45:09 2026-04-14 18:21:10 | message stringlengths 8 1.39M | diff stringlengths 68 51.2k | files_changed int64 1 136 | insertions int64 0 2.35k | deletions int64 0 1.9k |
|---|---|---|---|---|---|---|---|
8a0e9d4e6212cb616f89c7b3458f6a6512d8cfd8 | John-John Tedro | 2018-11-08T20:15:45 | Archive ends at first zeroed header and introduce ignore_zeros | diff --git a/src/archive.rs b/src/archive.rs
index 70e74d1..a9220cb 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -22,6 +22,7 @@ pub struct ArchiveInner<R: ?Sized> {
unpack_xattrs: bool,
preserve_permissions: bool,
preserve_mtime: bool,
+ ignore_zeros: bool,
obj: RefCell<R>,
}
@@ -46,6 +... | 2 | 84 | 36 |
08614e1291bc3010457f5216da997ff761b5144d | Alex Crichton | 2018-11-05T16:07:24 | Bump to 0.4.18 | diff --git a/Cargo.toml b/Cargo.toml
index a2df5bc..11bcbe6 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,6 @@
[package]
-
name = "tar"
-version = "0.4.17"
+version = "0.4.18"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 2 |
f442964da22bce0c66aad004e01bf6d4fb3adeb9 | Alex Crichton | 2018-10-29T17:30:07 | Add an option to disable preserving mtime
This is enabled by default as it's been enabled for awhile now, but not
all unpacking routines want to preserve the mtime!
Closes #169 | diff --git a/src/archive.rs b/src/archive.rs
index b61c569..c46da10 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -21,6 +21,7 @@ pub struct ArchiveInner<R: ?Sized> {
pos: Cell<u64>,
unpack_xattrs: bool,
preserve_permissions: bool,
+ preserve_mtime: bool,
obj: RefCell<R>,
}
@@ -44,6 +45,7... | 2 | 27 | 5 |
1fb99c5a3fc7000e2c8d691a778081bbd42d9252 | NightRa | 2018-09-29T08:37:14 | Remove AlignedHigher - Fixes #152 | diff --git a/src/archive.rs b/src/archive.rs
index fa6614f..b61c569 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -21,7 +21,7 @@ pub struct ArchiveInner<R: ?Sized> {
pos: Cell<u64>,
unpack_xattrs: bool,
preserve_permissions: bool,
- obj: RefCell<::AlignHigher<R>>,
+ obj: RefCell<R>,
}
///... | 2 | 3 | 26 |
e1a09f57546c9627ca576a39b84e2105d25b1e77 | Josh Stone | 2018-09-28T06:03:52 | Always write big-endian in numeric_extended_into
Before, this was transforming the number `to_be()`, then pulling out
least-significant bytes at shr 0, 8, 16, etc. This has the effect of
writing reversed bytes on a little-endian target. But since `to_be()`
does nothing on actual big-endian machines, they end up inco... | diff --git a/src/header.rs b/src/header.rs
index 124c466..0f2d7bd 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1422,7 +1422,7 @@ fn numeric_extended_into(dst: &mut [u8], src: u64) {
let len: usize = dst.len();
for (slot, val) in dst.iter_mut().zip(
repeat(0).take(len - 8) // to zero init extra ... | 1 | 1 | 1 |
7fb348b6953f190544c091073ca2a05a5a5cc408 | Louis | 2018-09-21T07:55:55 | Bump to 0.4.17 | diff --git a/Cargo.toml b/Cargo.toml
index f740455..a2df5bc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.16"
+version = "0.4.17"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
97ef67e3fd4d098ee363d539318b1a0eac02d570 | Louis | 2018-07-25T14:43:56 | add wrapper functions for tar's numeric extension | diff --git a/src/header.rs b/src/header.rs
index b9a153a..76364e9 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -282,8 +282,8 @@ impl Header {
///
/// May return an error if the field is corrupted.
pub fn entry_size(&self) -> io::Result<u64> {
- octal_from(&self.as_old().size).map_err(|err| io... | 2 | 96 | 66 |
80769acb6da9378268e41a01e34348ac40e5cb7a | Louis | 2018-07-24T11:24:46 | Explicitly zero init the size field bytes | diff --git a/src/header.rs b/src/header.rs
index 30e8e4f..b9a153a 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -307,6 +307,7 @@ impl Header {
// stored in binary and the high bit of the first byte is set to 1
// according to tar's Numeric Extensions.
if size >= 8589934592 {
+ ... | 1 | 1 | 0 |
6cdd928a3bd94a826a58482c92f66e4f782df835 | Louis | 2018-07-23T11:21:20 | Use numeric extension for size field when needed
Cf. the Numeric Extensions section:
https://www.freebsd.org/cgi/man.cgi?query=tar&sektion=5&manpath=FreeBSD+8-current | diff --git a/src/header.rs b/src/header.rs
index c50778a..30e8e4f 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -303,7 +303,21 @@ impl Header {
/// Encodes the `size` argument into the size field of this header.
pub fn set_size(&mut self, size: u64) {
- octal_into(&mut self.as_old_mut().size, siz... | 2 | 19 | 1 |
b3ea06fcaf8b1bf38b4266da3e73bb43fbcbc2d5 | Alex Crichton | 2018-06-29T19:40:41 | Bump to 0.4.16 | diff --git a/Cargo.toml b/Cargo.toml
index 73da477..f740455 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.15"
+version = "0.4.16"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
d3d14ad5c32922444f857382976c22f056e3cef4 | Alex Crichton | 2018-06-29T17:52:43 | Prevent writing through a symlink to arbitrary files | diff --git a/src/entry.rs b/src/entry.rs
index fbdec52..d426e83 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -482,7 +482,16 @@ impl<'a> EntryFields<'a> {
// As a result if we don't recognize the kind we just write out the file
// as we would normally.
- fs::File::create(dst).and_then(|mut ... | 2 | 46 | 2 |
089056223b190638b541f06c15be7baf98b7e33d | Alex Crichton | 2018-06-29T14:59:51 | Don't allow hardlinks to overwrite existing files | diff --git a/src/entry.rs b/src/entry.rs
index 32e56c4..fbdec52 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -4,7 +4,7 @@ use std::fs;
use std::io::prelude::*;
use std::io::{self, Error, ErrorKind, SeekFrom};
use std::marker;
-use std::path::{Component, Path};
+use std::path::{Component, Path, PathBuf};
use fi... | 2 | 83 | 27 |
7b6c14a73e0078f99bfb7a494a51b2e4f1be93d2 | Kornel | 2018-04-16T02:29:54 | Replace try!() with ? | diff --git a/src/archive.rs b/src/archive.rs
index 3a822d1..6861f33 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -128,11 +128,11 @@ impl<'a> Archive<Read + 'a> {
}
fn _unpack(&mut self, dst: &Path) -> io::Result<()> {
- for entry in try!(self._entries()) {
- let mut file = try!(entr... | 4 | 91 | 92 |
55845560648ea1245b8cb6b4984ce5d8b5e4e417 | Bastien Orivel | 2018-04-11T20:57:09 | Update filetime and bump version | diff --git a/Cargo.toml b/Cargo.toml
index 7fd7840..73da477 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.14"
+version = "0.4.15"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 3 | 5 | 5 |
84ebb433e172b201f49a26e71d65718d74ffb5d2 | Alex Crichton | 2018-02-02T18:49:56 | Fix compile on windows | diff --git a/src/header.rs b/src/header.rs
index 5e145a9..86816db 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1393,9 +1393,7 @@ fn ends_with_slash(p: &Path) -> bool {
#[cfg(windows)]
pub fn path2bytes(p: &Path) -> io::Result<Cow<[u8]>> {
p.as_os_str().to_str().map(|s| s.as_bytes()).ok_or_else(|| {
- ... | 1 | 1 | 3 |
1303c4eac58ff44bbee67e956ea86e199daa3a23 | Garrett Berg | 2018-01-27T16:56:39 | fix #128: add context to _all_ error messages except `Read` and `Write`
Obviously I may have missed a few but I tried to be as complete as I
could be. I approached this by looking at the return type of _every_
function. If it was `io::Error` then I carefully steped through
the function making sure:
- the function _its... | diff --git a/src/builder.rs b/src/builder.rs
index 6f91cb7..fa64832 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -306,9 +306,15 @@ fn append(mut dst: &mut Write,
fn append_path(dst: &mut Write, path: &Path, mode: HeaderMode, follow: bool) -> io::Result<()> {
let stat = if follow {
- try!(fs::metad... | 3 | 210 | 49 |
2fdfdff070920cfc087e3dfb1624c199d1daab84 | Igor Gnatenko | 2018-01-13T18:01:15 | deps: Update xattr to 0.2
get() used to return Result<Vec<u8>> which was indicating problem
either with getting attributes or those attributes being empty.
Now it returns Result<Option<Vec<u8>>> where Result is for reporting
problems with getting attrs and Option for showing whether attrs are
empty.
Then make sure th... | diff --git a/Cargo.toml b/Cargo.toml
index 1832df9..7fd7840 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,7 +24,7 @@ filetime = "0.1.5"
tempdir = "0.3"
[target."cfg(unix)".dependencies]
-xattr = { version = "0.1.7", optional = true }
+xattr = { version = "0.2", optional = true }
libc = "0.2"
[target.'cfg(targ... | 2 | 9 | 7 |
b5afca4e22f0a42c878c0bf16c03ba0f395768a0 | est31 | 2017-12-31T11:18:54 | Accept slices instead of an array reference | diff --git a/src/header.rs b/src/header.rs
index 7e95f47..8e4e23b 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -238,9 +238,13 @@ impl Header {
if self.is_gnu() {Some(unsafe { cast_mut(self) })} else {None}
}
- /// Treats the given byte array as a header
- pub fn from_byte_ref(bytes: &[u8; 512... | 2 | 15 | 3 |
ba17557eb1baf4c7e3d136d99d7d753fe6469348 | est31 | 2017-12-30T21:25:12 | Take a reference instead of an owned array | diff --git a/src/header.rs b/src/header.rs
index 4b5ee1d..7e95f47 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -238,9 +238,9 @@ impl Header {
if self.is_gnu() {Some(unsafe { cast_mut(self) })} else {None}
}
- /// Creates a header from the given byte array
- pub fn from_bytes(bytes: [u8; 512])... | 1 | 3 | 3 |
c180cedd100fcaf6c001ec5ba4e33d4ba85e3d3b | est31 | 2017-12-29T19:36:28 | Add a function to create headers from byte arrays without any transmute | diff --git a/src/header.rs b/src/header.rs
index f975574..4b5ee1d 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -238,6 +238,11 @@ impl Header {
if self.is_gnu() {Some(unsafe { cast_mut(self) })} else {None}
}
+ /// Creates a header from the given byte array
+ pub fn from_bytes(bytes: [u8; 512]... | 1 | 5 | 0 |
016e4c02bc36152be13e89d238062447f551e192 | Alex Crichton | 2017-11-25T14:41:07 | Bump to 0.4.14 | diff --git a/Cargo.toml b/Cargo.toml
index 84e4fb2..1832df9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.13"
+version = "0.4.14"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
b8d44a3930e58c3c2ad9b121087f454a2d08830d | Fredrik Larsson | 2017-11-22T21:48:29 | Set correct mtime when creating header | diff --git a/src/header.rs b/src/header.rs
index 35b45fd..f975574 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -145,6 +145,7 @@ impl Header {
gnu.magic = *b"ustar ";
gnu.version = *b" \0";
}
+ header.set_mtime(0);
header
}
@@ -162,6 +163,7 @@ impl Header {
... | 2 | 17 | 1 |
5e76a0962a1adc369bd2aa5cdecd245b562ee502 | Alex Crichton | 2017-11-20T19:20:10 | Fix double slashes encoded into symlink names
Mostly just a tweak to the `copy_path_into` logic
Closes #125 | diff --git a/src/header.rs b/src/header.rs
index d3f84c3..35b45fd 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1219,6 +1219,7 @@ fn copy_path_into(mut slot: &mut [u8],
path: &Path,
is_link_name: bool) -> io::Result<()> {
let mut emitted = false;
+ let mut needs_slash ... | 2 | 11 | 2 |
98548e56fe460e54198eacd4b450553b13cf8998 | cake4289 | 2017-10-05T08:26:26 | add link to documentation about numeric extension | diff --git a/src/header.rs b/src/header.rs
index 2e49abe..d3f84c3 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1153,8 +1153,11 @@ impl Default for GnuExtSparseHeader {
}
fn octal_from(slice: &[u8]) -> io::Result<u64> {
- if slice[0] & 0x80 != 0 { // GNU length extension
- let mut total: u64 = (slice... | 1 | 5 | 2 |
dc219b28f88bb70a0262c4f945e6f45f189e786b | cake4289 | 2017-10-03T08:55:00 | handle extended numeric formats in octal_from | diff --git a/src/header.rs b/src/header.rs
index a974183..2e49abe 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1153,13 +1153,24 @@ impl Default for GnuExtSparseHeader {
}
fn octal_from(slice: &[u8]) -> io::Result<u64> {
- let num = match str::from_utf8(truncate(slice)) {
- Ok(n) => n,
- Err(_... | 2 | 34 | 11 |
173a80c7b7e05ac1d3cdf4466fd47e1273dbab46 | Alex Crichton | 2017-09-02T15:54:11 | Fix a test on unix | diff --git a/tests/entry.rs b/tests/entry.rs
index 2b13082..bdad143 100644
--- a/tests/entry.rs
+++ b/tests/entry.rs
@@ -215,6 +215,7 @@ fn parent_paths_error() {
#[test]
#[cfg(unix)]
fn good_parent_paths_ok() {
+ use std::path::PathBuf;
let mut ar = tar::Builder::new(Vec::new());
let mut header = tar... | 1 | 1 | 0 |
c9e58aa15d9b6aa4d59cba07c513fc208937311b | Alex Crichton | 2017-09-02T15:48:41 | Fix warnings | diff --git a/tests/all.rs b/tests/all.rs
index fdc1500..6ecd440 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -350,7 +350,7 @@ fn extracting_malicious_tarball() {
assert!(header.set_path(path).is_err(),
"was ok: {:?}", path);
{
- let mut h = header.as_gnu_... | 2 | 1 | 2 |
ebb7dad20a10a967ba02f8a0ccedf72be2f07359 | Alex Crichton | 2017-09-02T15:48:14 | Move libc to a unix-specific dep | diff --git a/Cargo.toml b/Cargo.toml
index 14d1dfc..84e4fb2 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -18,7 +18,6 @@ contents are never required to be entirely resident in memory all at once.
"""
[dependencies]
-libc = "0.2"
filetime = "0.1.5"
[dev-dependencies]
@@ -26,6 +25,7 @@ tempdir = "0.3"
[target."c... | 2 | 2 | 1 |
c7f19bd291a38ba44301669a968e662a3d4f942b | Kornel | 2017-08-01T00:29:37 | It is valid for tar to contain ./ entry | diff --git a/src/header.rs b/src/header.rs
index e91ee18..a974183 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1215,6 +1215,8 @@ fn copy_path_into(mut slot: &mut [u8],
(Component::ParentDir, false) => {
return Err(other("paths in archives must not have `..`"))
}
+ ... | 2 | 6 | 2 |
b7b5ee216ca985236150e7ee36c2273d970533bd | Ian Douglas Scott | 2017-07-10T00:27:55 | Redox OS support | diff --git a/Cargo.toml b/Cargo.toml
index f53137b..14d1dfc 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -27,5 +27,8 @@ tempdir = "0.3"
[target."cfg(unix)".dependencies]
xattr = { version = "0.1.7", optional = true }
+[target.'cfg(target_os = "redox")'.dependencies]
+redox_syscall = "0.1"
+
[features]
default = ["... | 4 | 40 | 22 |
58e6053622606091a714a1b16387356e86394a25 | Ian Douglas Scott | 2017-06-30T23:19:21 | Fix xattr unit test
Fixes #100 | diff --git a/tests/all.rs b/tests/all.rs
index 3e8744a..dc21e61 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -192,7 +192,9 @@ fn extracting_directories() {
#[test]
#[cfg(all(unix, feature = "xattr"))]
fn xattrs() {
- let td = t!(TempDir::new("tar-rs"));
+ // If /tmp is a tmpfs, xattr will fail
+ // The x... | 1 | 3 | 1 |
157bab57a4f378107049b3d6e79fe7f211029eea | Ian Douglas Scott | 2017-06-30T19:37:23 | Add unit test for append_path() on a symlink | diff --git a/tests/all.rs b/tests/all.rs
index 3e8744a..2f890e9 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -770,3 +770,30 @@ fn path_separators() {
assert!(entries.next().is_none());
}
+
+#[test]
+#[cfg(unix)]
+fn append_path_symlink() {
+ use std::os::unix::fs::symlink;
+ use std::env;
+ use std:... | 1 | 27 | 0 |
025f45b789f26bc6a09def5456f60157bce23512 | Ian Douglas Scott | 2017-06-30T19:03:18 | Fix file size for symlink | diff --git a/src/header.rs b/src/header.rs
index 1196a88..e05a440 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -611,7 +611,7 @@ impl Header {
fn fill_from(&mut self, meta: &fs::Metadata, mode: HeaderMode) {
self.fill_platform_from(meta, mode);
// Set size of directories to zero
- self... | 1 | 1 | 1 |
52a6f0f8833367771225bd9b742e6453eee1faac | Ian Douglas Scott | 2017-06-30T17:52:12 | Option to not follow symlinks | diff --git a/src/builder.rs b/src/builder.rs
index 30924cc..6f91cb7 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -13,6 +13,7 @@ use header::{bytes2path, HeaderMode, path2bytes};
/// arbitrary writer.
pub struct Builder<W: Write> {
mode: HeaderMode,
+ follow: bool,
finished: bool,
obj: Option<... | 1 | 39 | 13 |
2bdff046740b0f27acb88eb79071da3dc6332224 | Alex Crichton | 2017-06-30T05:10:16 | Add implementations of `Debug` for headers
Should help when inspecting headers! | diff --git a/src/header.rs b/src/header.rs
index 881af5e..1196a88 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -6,6 +6,7 @@ use std::fmt;
use std::fs;
use std::io;
use std::iter::repeat;
+use std::iter;
use std::mem;
use std::path::{Path, PathBuf, Component};
use std::str;
@@ -139,8 +140,8 @@ impl Header {
... | 1 | 192 | 24 |
d771082e6478d6a51f87747c908bfe57c14ced28 | Alexandre Bury | 2017-06-18T19:22:42 | Unwrap returned Result in documentation for Builder | diff --git a/src/builder.rs b/src/builder.rs
index 458c149..30924cc 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -78,7 +78,7 @@ impl<W: Write> Builder<W> {
/// use tar::{Builder, Header};
///
/// let mut header = Header::new_gnu();
- /// header.set_path("foo");
+ /// header.set_path("foo").u... | 1 | 1 | 1 |
32bdb89155574a9229e7e3c4b376be0400891d25 | Luca Bruno | 2017-06-11T08:54:16 | entry: fix unpacking relative hardlinks
This commit fixes an unpacking failure triggered by hardlinks with
relative link names. In such case, the source of the hard-link
must be resolved first by nesting it under the unpacking directory. | diff --git a/src/entry.rs b/src/entry.rs
index 366498f..62dd11b 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -177,7 +177,7 @@ impl<'a, R: Read> Entry<'a, R> {
/// }
/// ```
pub fn unpack<P: AsRef<Path>>(&mut self, dst: P) -> io::Result<()> {
- self.fields.unpack(dst.as_ref())
+ self.fiel... | 2 | 68 | 6 |
8248482388d2dc0ecd0084c57111c2532ccc0077 | Alex Crichton | 2017-05-31T14:31:42 | Bump to 0.4.13 | diff --git a/Cargo.toml b/Cargo.toml
index e20a6d3..f53137b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.12"
+version = "0.4.13"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
7d9296270bb58ff0f403af4614be2f288fd8527b | Josh Stone | 2017-05-30T21:51:08 | Add `Builder::append_data` supporting long paths
This method lets one specify a manual header like `append`, but
incorporates the special handling needed for setting long paths. If
given path doesn't fit in the header `name`, it will write a GNU
'././@LongLink' entry beforehand.
Fixes #108.
Fixes #109. | diff --git a/src/builder.rs b/src/builder.rs
index 003e8fd..458c149 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -93,6 +93,53 @@ impl<W: Write> Builder<W> {
append(self.inner(), header, &mut data)
}
+ /// Adds a new entry to this archive with the specified path.
+ ///
+ /// This function... | 2 | 70 | 7 |
7946bfa95ec75c915d757e20aaf2a32d5b24f0d4 | Stu Hood | 2017-05-23T18:07:38 | Shpelling. | diff --git a/src/header.rs b/src/header.rs
index 576e98c..881af5e 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -636,7 +636,7 @@ impl Header {
self.set_uid(0);
self.set_gid(0);
- // Use a default umask value, but propogate the (user) execute bit.
+ /... | 1 | 1 | 1 |
893a96e89c84f44f60f0e2398d27ae3267d196f8 | Stu Hood | 2017-05-23T17:53:23 | Use a standard umask value, to provide reasonable behaviour for tar consumers that don`t apply a umask at extraction time. | diff --git a/src/header.rs b/src/header.rs
index 9e077a6..576e98c 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -10,8 +10,6 @@ use std::mem;
use std::path::{Path, PathBuf, Component};
use std::str;
-use libc;
-
use EntryType;
use other;
@@ -133,9 +131,6 @@ pub struct GnuExtSparseHeader {
pub padding: [... | 1 | 29 | 22 |
3531782a1081f855874db7b247100a7e3299bb0e | Stu Hood | 2017-05-22T22:26:20 | Test mode. | diff --git a/tests/header/mod.rs b/tests/header/mod.rs
index aca64da..7ad2559 100644
--- a/tests/header/mod.rs
+++ b/tests/header/mod.rs
@@ -1,4 +1,4 @@
-use std::fs::File;
+use std::fs::{self, File};
use std::io::{self, Write};
use std::path::Path;
use std::{iter, thread, time};
@@ -159,21 +159,26 @@ fn set_metadat... | 1 | 11 | 6 |
631916ee81a67df4056a38025bf7301d7d2c8ff4 | Stu Hood | 2017-05-22T19:47:16 | Respect only the file type and executable bit. | diff --git a/src/header.rs b/src/header.rs
index b4330c1..9e077a6 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -10,6 +10,8 @@ use std::mem;
use std::path::{Path, PathBuf, Component};
use std::str;
+use libc;
+
use EntryType;
use other;
@@ -131,6 +133,9 @@ pub struct GnuExtSparseHeader {
pub padding: [... | 1 | 23 | 17 |
babe0c8118a8d58c1c5e25a7663560153a78e51d | Alex Crichton | 2017-05-11T22:59:23 | Bump to 0.4.12 | diff --git a/Cargo.toml b/Cargo.toml
index b2de8e3..e20a6d3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.11"
+version = "0.4.12"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
c728ce8b5cfae844d32910d792e4be32def56e63 | Josh Stone | 2017-05-11T22:13:01 | Normalize all path separators to Unix-style `/`
In most cases, `tar` already wrote only `/` separators between path
components. This is the only separator that works on Unix, and it's
acceptable on Windows too. However, long paths in GNU headers were
writing the full `path2bytes` result without translation, which me... | diff --git a/src/header.rs b/src/header.rs
index 354923d..b4330c1 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -1031,7 +1031,7 @@ fn copy_path_into(mut slot: &mut [u8],
return Err(other("path component in archive cannot contain `/`"))
}
}
- try!(copy(&mut slot, bytes))... | 2 | 62 | 6 |
f5c4bcab0b8753763dfda1c13733c186b1b2f28d | Ian Douglas Scott | 2017-04-24T22:25:09 | Add test for append_dir_all() with "" as dest | diff --git a/tests/all.rs b/tests/all.rs
index 4a5df9e..5e42f40 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -247,6 +247,33 @@ fn writing_directories_recursively() {
assert!(fs::metadata(&file2_path).map(|m| m.is_file()).unwrap_or(false));
}
+#[test]
+fn append_dir_all_blank_dest() {
+ let td = t!(TempDir... | 1 | 27 | 0 |
6d731b7744e6bf6115b3e53d3909e56bc8ad8644 | Ian Douglas Scott | 2017-04-24T20:31:51 | Make append_dir_all() accept "" as dest
Fills root of archive from that directory. Closes #103. | diff --git a/src/builder.rs b/src/builder.rs
index fb062bc..003e8fd 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -316,7 +316,9 @@ fn append_dir_all(dst: &mut Write, path: &Path, src_path: &Path, mode: HeaderMod
let entry = try!(entry);
stack.push((entry.path(), try!(entry.file_t... | 1 | 3 | 1 |
322ee2ea81a10b063b808b244cab33cd0b45ad1f | Alex Crichton | 2017-03-31T15:31:30 | Bump to 0.4.11 | diff --git a/Cargo.toml b/Cargo.toml
index 7ddef3b..b2de8e3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.10"
+version = "0.4.11"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.... | 1 | 1 | 1 |
e975d4b2ecae99204dd6b3ae293225951e114d22 | Stu Hood | 2017-02-22T18:08:56 | Merge from master | diff --git a/src/builder.rs b/src/builder.rs
index 97cf80e..fb062bc 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -211,7 +211,8 @@ impl<W: Write> Builder<W> {
pub fn append_dir_all<P, Q>(&mut self, path: P, src_path: Q) -> io::Result<()>
where P: AsRef<Path>, Q: AsRef<Path>
{
- append_di... | 1 | 5 | 4 |
54a013195e8f7ae4b566cd9aa2987a86aced278f | Stu Hood | 2017-02-22T17:56:36 | Discourage folks from matching on HeaderMode types. | diff --git a/src/header.rs b/src/header.rs
index 5c51258..354923d 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -27,9 +27,13 @@ pub enum HeaderMode {
/// All supported metadata, including mod/access times and ownership will
/// be included.
Complete,
+
/// Only metadata that is directly relevant... | 1 | 6 | 0 |
6797132ce4f35d0aecb9afb6ad99231bc6f95b32 | Alex Crichton | 2017-02-22T04:31:31 | Use vtable dispatch in append_dir_all | diff --git a/src/builder.rs b/src/builder.rs
index 88a6f2b..dd0b96d 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -198,20 +198,7 @@ impl<W: Write> Builder<W> {
pub fn append_dir_all<P, Q>(&mut self, path: P, src_path: Q) -> io::Result<()>
where P: AsRef<Path>, Q: AsRef<Path>
{
- let mut ... | 1 | 18 | 14 |
b929eb2c347e5c8066e4c7fe37ee572eefa1e529 | Matthew D. Steele | 2017-02-21T22:54:50 | Save syscalls in append_dir_all and prevent it from working on non-dirs | diff --git a/src/builder.rs b/src/builder.rs
index 7c85818..88a6f2b 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -198,17 +198,17 @@ impl<W: Write> Builder<W> {
pub fn append_dir_all<P, Q>(&mut self, path: P, src_path: Q) -> io::Result<()>
where P: AsRef<Path>, Q: AsRef<Path>
{
- let mut... | 2 | 20 | 9 |
207be8862216b2f57730b21e10193c9aa5d6eaac | Stu Hood | 2017-02-18T21:25:57 | Add a deterministic append mode. | diff --git a/src/builder.rs b/src/builder.rs
index b3fdaa2..c3ca9de 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -5,22 +5,25 @@ use std::fs;
use std::borrow::Cow;
use {EntryType, Header, other};
-use header::{bytes2path, path2bytes};
+use header::{bytes2path, HeaderMode, path2bytes};
/// A structure for b... | 4 | 141 | 51 |
b6efc62bf17748d5a99516190dd5518d9dd0007c | Matthew D. Steele | 2017-02-18T15:37:31 | Eliminate walkdir dependency | diff --git a/Cargo.toml b/Cargo.toml
index 7f6e32a..61e0f97 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,7 +20,6 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.2"
filetime = "0.1.5"
-walkdir = "1.0"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/bui... | 3 | 9 | 9 |
b53fc4abc1c933fb4eef7da1198bfd74bc6d2edf | Peter Jin | 2017-02-15T19:40:52 | Implement methods on `Entry` for querying the raw byte positions of the
entry's header and file within the archive. | diff --git a/src/archive.rs b/src/archive.rs
index 54549b0..3a822d1 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -183,6 +183,7 @@ impl<'a> EntriesFields<'a> {
let delta = self.next - self.archive.inner.pos.get();
try!(self.archive.skip(delta));
+ let header_pos = self.next;
le... | 2 | 26 | 0 |
a25da58f28f9e1648fe6bab46026c7ef412b1ebf | Matthew D. Steele | 2017-02-12T02:13:46 | Add Builder::append_dir_all method | diff --git a/Cargo.toml b/Cargo.toml
index 61e0f97..7f6e32a 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,7 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.2"
filetime = "0.1.5"
+walkdir = "1.0"
[dev-dependencies]
tempdir = "0.3"
diff --git a/src/bui... | 4 | 68 | 0 |
79fc376a88b52c347ff01c76049f131a1749f2bc | Alex Crichton | 2017-01-13T17:23:36 | Bump to 0.4.10 | diff --git a/Cargo.toml b/Cargo.toml
index bbefc89..61e0f97 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.9"
+version = "0.4.10"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.c... | 1 | 1 | 1 |
ec78ba87c42ab4b8734f0b23cffcbf6aabc1696f | Alex Crichton | 2017-01-13T17:22:45 | Remove stray debug statement
Closes #92 | diff --git a/src/entry.rs b/src/entry.rs
index 8e6bf20..f93c7d4 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -376,7 +376,6 @@ impl<'a> EntryFields<'a> {
return Err(other("symlink destination is empty"))
}
- println!("{:?} {:?}", src, dst);
return if kind.is_har... | 1 | 0 | 1 |
7843d6acfc9c9bc766b01cee86e6d2db37726c1f | Luca Bruno | 2016-12-29T09:02:58 | entry: relax symlink target constraints
This allows the creation and extraction of symlinks pointing to targets
outside of the destination directory, including absolute paths and `../`
chains.
Path traversal is now checked at unpack time, by canonicalizing the target
path and ensuring that it is nested below destinat... | diff --git a/src/entry.rs b/src/entry.rs
index 4ebdbea..8e6bf20 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -2,9 +2,9 @@ use std::borrow::Cow;
use std::cmp;
use std::fs;
use std::io::prelude::*;
-use std::io::{self, SeekFrom};
+use std::io::{self, Error, ErrorKind, SeekFrom};
use std::marker;
-use std::path::{C... | 3 | 105 | 77 |
0321168f942a8864f4228f1195417b6d24e1d042 | Alex Crichton | 2016-11-24T02:54:35 | Bump to 0.4.9 | diff --git a/Cargo.toml b/Cargo.toml
index a4ad981..bbefc89 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.8"
+version = "0.4.9"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
85b6399b212f66eb955431f214e0e9eb408988c8 | Alex Crichton | 2016-11-24T02:54:02 | Disallow symlinks pointing outside the root
This should prevent symlinks which then point to external files that could
accidentally get overwritten during extraction. | diff --git a/src/entry.rs b/src/entry.rs
index f2c8f2d..4ebdbea 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -4,7 +4,7 @@ use std::fs;
use std::io::prelude::*;
use std::io::{self, SeekFrom};
use std::marker;
-use std::path::{Component, Path};
+use std::path::{Component, Path, PathBuf};
use filetime::{self, Fil... | 2 | 251 | 62 |
d91605be22d4298ede8964cfa02f10fccdc019ce | Josh Triplett | 2016-11-23T21:41:29 | Add an Entry::unpack_in to do safe unpacking of one Entry
This makes it easy to walk over each Entry in an archive, filter them in
some way, and unpack some subset of them, without reimplementing the
security-sensitive logic in Archive::unpack. | diff --git a/src/archive.rs b/src/archive.rs
index 4260946..54549b0 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -1,10 +1,9 @@
use std::cell::{RefCell, Cell};
use std::cmp;
-use std::fs;
use std::io::prelude::*;
use std::io;
use std::marker;
-use std::path::{Path, Component};
+use std::path::Path;
use en... | 2 | 88 | 59 |
6af27ea27b87770e50518f4eead9f1d9e191cfe9 | Alex Crichton | 2016-08-08T17:02:10 | Bump to 0.4.8 | diff --git a/Cargo.toml b/Cargo.toml
index c3bf8fe..a4ad981 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.7"
+version = "0.4.8"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
ae295b99e9e450dc4ee789627af6edea4925890e | Alex Crichton | 2016-07-25T04:49:31 | Add a regression test for ././@LongLink | diff --git a/tests/all.rs b/tests/all.rs
index 6c6e2f8..333b920 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -556,6 +556,9 @@ fn encoded_long_name_has_trailing_nul() {
let mut name = Vec::new();
t!(e.read_to_end(&mut name));
assert_eq!(name[name.len() - 1], 0);
+
+ let header_name = &e.header().as_... | 1 | 3 | 0 |
b499a7389e268523a8cc63295c532a6940ddd6a8 | James Sanderson | 2016-07-24T00:14:33 | Table name should be quoted with quotation marks not single quotes | diff --git a/Cargo.toml b/Cargo.toml
index 296f1e8..b0a2aad 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -24,5 +24,5 @@ filetime = "0.1.5"
[dev-dependencies]
tempdir = "0.3"
-[target.'cfg(unix)'.dependencies]
+[target."cfg(unix)".dependencies]
xattr = "0.1.7" | 1 | 1 | 1 |
7841a4fa862161d587b5dad40f64fa642692cfc0 | Laurentiu Nicola | 2016-07-23T09:10:22 | Use the right name for @LongLink entries
These seem to be found with a name of `././@LongLink`, however
`copy_path_into` emits that as `@LongLink`. This is more tricky to fix
because `Path::components()` collapses that into `./@LongLink`. For now,
just set it manually in append_fs().
Fixes #76 | diff --git a/src/builder.rs b/src/builder.rs
index 9ba4915..b3fdaa2 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -243,7 +243,7 @@ fn append_fs(dst: &mut Write,
return Err(e)
}
let mut header2 = Header::new_gnu();
- try!(header2.set_path("././@LongLink"));
+ header2.as... | 1 | 1 | 1 |
acf0b03efc59ed8296bc46456e9d5162347a2ef9 | Laurentiu Nicola | 2016-07-23T17:35:16 | Use iter() instead of &v | diff --git a/src/archive.rs b/src/archive.rs
index 6623c2f..4260946 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -411,7 +411,7 @@ impl<'a> EntriesFields<'a> {
data.push(EntryIo::Data(reader.take(len)));
Ok(())
};
- for block in &gnu.sparse {
+ ... | 1 | 2 | 2 |
e6008b646e393bed2b25f97dd1eb0c95b4c188df | Laurentiu Nicola | 2016-07-23T12:49:16 | Fix clippy warnings | diff --git a/src/archive.rs b/src/archive.rs
index 4260946..6623c2f 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -411,7 +411,7 @@ impl<'a> EntriesFields<'a> {
data.push(EntryIo::Data(reader.take(len)));
Ok(())
};
- for block in gnu.sparse.iter() {
+ ... | 3 | 28 | 22 |
81474349b7225b005899cfd51fa1c8de34269120 | Laurentiu Nicola | 2016-07-23T08:29:49 | Fill in the metadata for GNULongLink entries (7-zip compat)
Fixes #72 | diff --git a/src/builder.rs b/src/builder.rs
index c0d5618..9ba4915 100644
--- a/src/builder.rs
+++ b/src/builder.rs
@@ -244,6 +244,10 @@ fn append_fs(dst: &mut Write,
}
let mut header2 = Header::new_gnu();
try!(header2.set_path("././@LongLink"));
+ header2.set_mode(0o644);
+ he... | 1 | 4 | 0 |
32aac07e8c960cc4dbff6b2610877d3a6d48794c | Alex Crichton | 2016-07-22T16:27:55 | Add an option to preserve permissions
Closes #74 | diff --git a/src/archive.rs b/src/archive.rs
index 0ed4874..4260946 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -21,6 +21,7 @@ pub struct Archive<R: ?Sized + Read> {
pub struct ArchiveInner<R: ?Sized> {
pos: Cell<u64>,
unpack_xattrs: bool,
+ preserve_permissions: bool,
obj: RefCell<::AlignHig... | 2 | 31 | 3 |
470b6ab0670b3a3ca96808f368d728b7864241cd | Alex Crichton | 2016-07-22T16:12:18 | Allow storing all bits in header `mode` fields | diff --git a/src/header.rs b/src/header.rs
index b225be7..564da08 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -382,7 +382,7 @@ impl Header {
/// Encodes the `mode` provided into this header.
pub fn set_mode(&mut self, mode: u32) {
- octal_into(&mut self.as_old_mut().mode, mode & 0o3777);
+ ... | 1 | 2 | 2 |
2c0eb4e9c792932a54bf6f7252f2ac678627a755 | Alex Crichton | 2016-07-20T05:26:38 | Bump to 0.4.7 | diff --git a/Cargo.toml b/Cargo.toml
index 1139347..296f1e8 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.6"
+version = "0.4.7"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
59c71a992c82868cedbccdcde1f92a990ecfe1db | Alex Crichton | 2016-07-14T18:11:30 | Add a comment about atime/ctime | diff --git a/src/header.rs b/src/header.rs
index 267e9cb..b225be7 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -602,6 +602,15 @@ impl Header {
self.set_uid(meta.uid() as u32);
self.set_gid(meta.gid() as u32);
+ // Note that if we are a GNU header we *could* set atime/ctime, except
+ ... | 1 | 9 | 0 |
8b91523e93e6df845bb5cf7fa90c03c7a2af703b | Alex Crichton | 2016-07-14T18:10:24 | Add a simple example for writing an archive | diff --git a/examples/write.rs b/examples/write.rs
new file mode 100644
index 0000000..14392c2
--- /dev/null
+++ b/examples/write.rs
@@ -0,0 +1,12 @@
+extern crate tar;
+
+use std::fs::File;
+use tar::Builder;
+
+fn main() {
+ let file = File::create("foo.tar").unwrap();
+ let mut a = Builder::new(file);
+
+ a... | 1 | 12 | 0 |
2daf823a85b30b1e7d0e48623e7eed460e7251ff | Laurentiu Nicola | 2016-07-14T17:46:33 | Don't fill atime and ctime (7-zip compat)
The atime and ctime fields in the GNU entry header seem to be
deprecated. GNU tar only fills them in when --incremental is passed and
the manpage calls that variation "old GNU-format".
Filling the two fields is problematic because 7-zip (which is rather
popular on Windows) in... | diff --git a/src/header.rs b/src/header.rs
index a82585e..267e9cb 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -599,10 +599,6 @@ impl Header {
self.set_mode((meta.mode() & 0o3777) as u32);
self.set_mtime(meta.mtime() as u64);
- if let Some(gnu) = self.as_gnu_mut() {
- gnu.set_... | 1 | 0 | 4 |
584051b5140f218c8962e23880956664d4b84641 | Alex Crichton | 2016-06-17T15:55:52 | Remove extraneous main file | diff --git a/src/main.rs b/src/main.rs
deleted file mode 100644
index 55034c4..0000000
--- a/src/main.rs
+++ /dev/null
@@ -1,11 +0,0 @@
-extern crate xattr;
-use std::fs::File;
-
-use std::os::unix::prelude::*;
-use std::ffi::*;
-
-fn main() {
-
- let _ = File::create("foo");
- xattr::set("foo", OsStr::from_bytes... | 1 | 0 | 11 |
a3b80a522e4b6edd3f45e778d04ac298297d23c8 | Alex Crichton | 2016-06-17T15:52:17 | A few style touch-ups here and there | diff --git a/Cargo.toml b/Cargo.toml
index c39037b..1139347 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -26,6 +26,3 @@ tempdir = "0.3"
[target.'cfg(unix)'.dependencies]
xattr = "0.1.7"
-
-[target.'cfg(unix)'.dev-dependencies]
-xattr = "0.1.7"
diff --git a/src/entry.rs b/src/entry.rs
index d4d235c..5fd1a46 100644
--... | 3 | 2 | 5 |
6b78e50f06acd0ca81a139a5d02936aef6745162 | Alex Crichton | 2016-06-17T15:50:51 | Update docs | diff --git a/src/archive.rs b/src/archive.rs
index 60da2f4..0ed4874 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -91,8 +91,13 @@ impl<R: Read> Archive<R> {
me._unpack(dst.as_ref())
}
- /// Sets the flag determining the behavior of unpack(). If flag is set to
- /// true, unpack() will preser... | 2 | 14 | 4 |
dde44bfd435e0a0a74ea49bea165d874ada0e605 | Alex Crichton | 2016-06-17T15:48:19 | Change entries() to preserve unpack_xattrs | diff --git a/src/archive.rs b/src/archive.rs
index 2915ad1..60da2f4 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -113,7 +113,6 @@ impl<'a> Archive<Read + 'a> {
}
fn _unpack(&mut self, dst: &Path) -> io::Result<()> {
- let unpack_xattrs = self.inner.unpack_xattrs;
'outer: for entry in ... | 2 | 12 | 3 |
94d6f6f89bfe1deb1c186c672905b87fa1458188 | Alex Crichton | 2016-06-17T15:46:46 | Don't use #[should_fail] | diff --git a/tests/all.rs b/tests/all.rs
index 5df1463..6c6e2f8 100644
--- a/tests/all.rs
+++ b/tests/all.rs
@@ -191,7 +191,6 @@ fn xattrs() {
}
#[test]
-#[should_panic]
#[cfg(unix)]
fn no_xattrs() {
let td = t!(TempDir::new("tar-rs"));
@@ -200,7 +199,7 @@ fn no_xattrs() {
ar.set_unpack_xattrs(false);
t!... | 1 | 1 | 2 |
2ebf6fa0d75adbd29cab83bb0b0d5204248baec7 | Alex Crichton | 2016-06-17T15:44:57 | Fix compilation on Windows | diff --git a/src/archive.rs b/src/archive.rs
index b93979f..2915ad1 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -15,12 +15,12 @@ use {Entry, Header, GnuSparseHeader, GnuExtSparseHeader};
///
/// This archive can have an entry added to it and it can be iterated over.
pub struct Archive<R: ?Sized + Read> {
- ... | 2 | 53 | 34 |
7d85c18998f088f13b0bc98d7046feceb8548d7f | Alex Crichton | 2016-06-17T15:44:28 | Touch up a few other examples | diff --git a/examples/extract_file.rs b/examples/extract_file.rs
index 69b3821..33264d1 100644
--- a/examples/extract_file.rs
+++ b/examples/extract_file.rs
@@ -15,8 +15,8 @@ use tar::Archive;
fn main() {
let first_arg = args_os().skip(1).next().unwrap();
let filename = Path::new(&first_arg);
- let mut ar... | 2 | 5 | 5 |
dffcc9b1fd63b6e4849ff03bad165ddd261f890b | Alex Crichton | 2016-06-17T15:44:15 | Add an example to list raw entry headers | diff --git a/examples/raw_list.rs b/examples/raw_list.rs
new file mode 100644
index 0000000..072865a
--- /dev/null
+++ b/examples/raw_list.rs
@@ -0,0 +1,47 @@
+//! An example of listing raw entries in an archive.
+//!
+//! Takes a tarball on stdin and prints out all of the entries inside.
+
+extern crate tar;
+
+use st... | 1 | 47 | 0 |
6c30a8af33ac61d1041bc63920b5becc6f233725 | Alex Crichton | 2016-06-17T15:43:53 | Extend lifetimes of pax extensions
The reference returned is actually alive for a longer lifetime | diff --git a/src/pax.rs b/src/pax.rs
index 0f69abe..fe6d5aa 100644
--- a/src/pax.rs
+++ b/src/pax.rs
@@ -60,24 +60,24 @@ impl<'entry> PaxExtension<'entry> {
/// Returns the key for this key/value pair parsed as a string.
///
/// May fail if the key isn't actually utf-8.
- pub fn key(&self) -> Result<&... | 1 | 4 | 4 |
59008686a9f5e54ad894ba8aaedef09d72f2fd30 | Andrew Krasavin | 2016-06-16T01:04:37 | Remove duplicated methods
- remove unpack_preserving_xattrs() functions
- add unpack_xattrs fields to Archive and Entry
- add Archive::set_unpack_xattrs and Entry::set_unpack_xattrs instead
- s/preserve_xattrs/unpack_xattrs/g
- fix tests and docs | diff --git a/src/archive.rs b/src/archive.rs
index 3e6a590..b93979f 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -15,6 +15,7 @@ use {Entry, Header, GnuSparseHeader, GnuExtSparseHeader};
///
/// This archive can have an entry added to it and it can be iterated over.
pub struct Archive<R: ?Sized + Read> {
+ ... | 3 | 26 | 30 |
578a392be7a50b47ad72ecc593bdabbf8ef8c4ee | Andrew Krasavin | 2016-06-15T01:11:53 | Platform specific dependency: xattr (unix) | diff --git a/Cargo.toml b/Cargo.toml
index 17dffc9..c39037b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,18 +17,15 @@ writers. Additionally, great lengths are taken to ensure that the entire
contents are never required to be entirely resident in memory all at once.
"""
-[target.'cfg(unix)'.dependencies]
+[depend... | 1 | 6 | 9 |
917a63a68497012145a97d4547e4929946fc3590 | Andrew Krasavin | 2016-06-12T20:42:57 | Rename dependencies to target.'cfg(unix)'.dependencies; rename dev-dependencies to target.'cfg(unix)'.dev-dependencies | diff --git a/Cargo.toml b/Cargo.toml
index 355f3be..17dffc9 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,12 +17,12 @@ writers. Additionally, great lengths are taken to ensure that the entire
contents are never required to be entirely resident in memory all at once.
"""
-[dependencies]
+[target.'cfg(unix)'.depend... | 1 | 2 | 2 |
23b8100000410bbdb9355ce69370fef02f6ce0ac | Andrew Krasavin | 2016-06-12T20:18:24 | Add correct dependencies for windows | diff --git a/Cargo.toml b/Cargo.toml
index 9843ae3..355f3be 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -25,3 +25,10 @@ xattr = "0.1.7"
[dev-dependencies]
tempdir = "0.3"
xattr = "0.1.7"
+
+[target.'cfg(windows)'.dependencies]
+libc = "0.2"
+filetime = "0.1.5"
+
+[target.'cfg(windows)'.dev-dependencies]
+tempdir = "... | 1 | 7 | 0 |
443bb86599cf1ee9d2749f7fb06e58a36a6ae586 | Andrew Krasavin | 2016-06-12T18:43:48 | Implement unpack_preserving_xattrs() functions
This commit adds two new functions:
pub fn Archive::unpack_preserving_xattrs<P: AsRef<Path>>(&mut self, dst: P) -> io::Result<()>
pub fn Entry::unpack_preserving_xattrs<P: AsRef<Path>>(&mut self, dst: P) -> io::Result<()>
This functions have a similar behavior as unpack... | diff --git a/Cargo.toml b/Cargo.toml
index 5200526..9843ae3 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -20,6 +20,8 @@ contents are never required to be entirely resident in memory all at once.
[dependencies]
libc = "0.2"
filetime = "0.1.5"
+xattr = "0.1.7"
[dev-dependencies]
tempdir = "0.3"
+xattr = "0.1.7"
dif... | 4 | 64 | 9 |
a5435b54c6bf6d4ce56753765d8eba33beeeb445 | Alex Crichton | 2016-06-17T10:55:29 | Continue to not allow root paths
These differ on Unix/Windows, so let's figure out the interactions here later | diff --git a/src/header.rs b/src/header.rs
index 3379da1..a82585e 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -952,11 +952,6 @@ fn copy_path_into(mut slot: &mut [u8],
for component in path.components() {
let bytes = try!(path2bytes(Path::new(component.as_os_str())));
match component {
- ... | 2 | 0 | 7 |
0a1e505bafeb721b427e19c58a4a2209cea5ca7c | Alex Crichton | 2016-06-16T23:06:27 | Allow link names with '..' and '/'
These restrictions only apply to normal paths, not the link names
Closes #67 | diff --git a/src/header.rs b/src/header.rs
index 37cbae6..3379da1 100644
--- a/src/header.rs
+++ b/src/header.rs
@@ -326,7 +326,7 @@ impl Header {
if let Some(ustar) = self.as_ustar_mut() {
return ustar.set_path(path)
}
- copy_path_into(&mut self.as_old_mut().name, path)
+ c... | 2 | 25 | 11 |
d0aea97e1f4047810e5dfc8482457dfd635050a5 | Alex Crichton | 2016-06-09T14:56:59 | Bump to 0.4.6 | diff --git a/Cargo.toml b/Cargo.toml
index c5a06e3..5200526 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,7 +1,7 @@
[package]
name = "tar"
-version = "0.4.5"
+version = "0.4.6"
authors = ["Alex Crichton <alex@alexcrichton.com>"]
homepage = "https://github.com/alexcrichton/tar-rs"
repository = "https://github.co... | 1 | 1 | 1 |
4b0b804f66c79f4213f14b33de9732bbe18a654b | Alex Crichton | 2016-05-04T21:15:06 | Reexport OldHeader as well | diff --git a/src/lib.rs b/src/lib.rs
index d833b69..ed0101c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -27,7 +27,7 @@ extern crate filetime;
use std::io::{Error, ErrorKind};
use std::ops::{Deref, DerefMut};
-pub use header::{Header, UstarHeader, GnuHeader, GnuSparseHeader};
+pub use header::{Header, OldHeader, Ust... | 1 | 1 | 1 |
40efd16fdc779e10b52f3757a8559ab5e4dc8ac7 | Paul Colomiets | 2016-05-04T21:13:37 | Fix `entry.header().path()` to `entry.path()` in examples | diff --git a/examples/extract_file.rs b/examples/extract_file.rs
index f96aa3f..69b3821 100644
--- a/examples/extract_file.rs
+++ b/examples/extract_file.rs
@@ -18,7 +18,7 @@ fn main() {
let mut arch = Archive::new(stdin());
for file in arch.entries().unwrap() {
let mut f = file.unwrap();
- if... | 2 | 2 | 2 |
21941302bdb5dc64705cdf707414fa0a81c397e3 | Alex Crichton | 2016-04-30T19:14:25 | Optimize extracting sparse files
Don't write out a bunch of 0s, instead use `seek` plus `set_len`. | diff --git a/src/entry.rs b/src/entry.rs
index d07a513..de94252 100644
--- a/src/entry.rs
+++ b/src/entry.rs
@@ -2,7 +2,7 @@ use std::borrow::Cow;
use std::cmp;
use std::fs;
use std::io::prelude::*;
-use std::io;
+use std::io::{self, SeekFrom};
use std::marker;
use std::path::Path;
@@ -272,10 +272,21 @@ impl<'a>... | 1 | 16 | 5 |
93e40a67a5070b918bce8ff99a496eeb2dffe6a9 | Alex Crichton | 2016-04-30T18:52:10 | Touch up support for sparse files
* Tweak a few methods on the headers, add some documentation here and there.
* Change the `read` function to leverage more utilities from the standard
library by using I/O objects instead of keeping trck of all the state.
* Don't handle sparse files on `raw` iterators.
* Touch up th... | diff --git a/examples/extract_file.rs b/examples/extract_file.rs
index 51c9aa5..f96aa3f 100644
--- a/examples/extract_file.rs
+++ b/examples/extract_file.rs
@@ -1,3 +1,9 @@
+//! An example of extracting a file in an archive.
+//!
+//! Takes a tarball on standard input, looks for an entry with a listed file
+//! name as... | 9 | 239 | 195 |
c41bfba2728d726440a16007cc1790a97ec5e408 | Paul Colomiets | 2016-04-29T19:56:25 | Better encapsulation for code handling sparse files | diff --git a/src/archive.rs b/src/archive.rs
index 3255c48..768738f 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -3,13 +3,12 @@ use std::cmp;
use std::fs;
use std::io::prelude::*;
use std::io;
-use std::mem::transmute;
use std::marker;
use std::path::{Path, Component};
use entry::EntryFields;
use error:... | 2 | 54 | 18 |
4c6cdcab8407343d3bab701feef61000c4060ce1 | Paul Colomiets | 2016-04-28T21:41:51 | Implement Read trait for Entry having sparse file | diff --git a/src/archive.rs b/src/archive.rs
index 763253c..3255c48 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -10,6 +10,7 @@ use std::path::{Path, Component};
use entry::EntryFields;
use error::TarError;
use header::{GnuExtSparseHeader, octal_from};
+use reader::Reader;
use other;
use {Entry, Header};
... | 5 | 140 | 15 |
faf737b63668f2f408e4b8d5af34a6628e9a0ec3 | Paul Colomiets | 2016-04-28T21:31:12 | Add extract_file example | diff --git a/examples/extract_file.rs b/examples/extract_file.rs
new file mode 100644
index 0000000..51c9aa5
--- /dev/null
+++ b/examples/extract_file.rs
@@ -0,0 +1,20 @@
+extern crate tar;
+
+use std::io::{stdin, stdout, copy};
+use std::env::args_os;
+use std::path::Path;
+
+use tar::Archive;
+
+
+fn main() {
+ le... | 1 | 20 | 0 |
a222464dff2e35205587ca5f36f76008b26e57db | Paul Colomiets | 2016-04-28T18:01:28 | Implement header parsing for sparse files | diff --git a/src/archive.rs b/src/archive.rs
index 9cc5041..763253c 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -3,11 +3,13 @@ use std::cmp;
use std::fs;
use std::io::prelude::*;
use std::io;
+use std::mem::transmute;
use std::marker;
use std::path::{Path, Component};
use entry::EntryFields;
use error:... | 2 | 80 | 12 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.