Age | Commit message (Collapse) | Author |
|
Instead of printing out error messages, return an errro ID and match
the behavior with the Windows implementation. Also, don't check first
if the struct stat says it is a link, the readlinkat() system call
will fail if it isn't. Avoid confusing the deputy.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This is also the reason we need to lug around the original directory
path on Windows.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of dropping the path immediately, store it inside the structure.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Using depth-first search, we collect some crude statistics about
directory tree types (e.g. regular files, directories, device special
files and so on) and print them out after serializing the tree.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of adding special sentinel modes, simply treat hard links as
special case of symlinks, setting a flag to indicate that it is a
hard link and another flag to indicate that it has been resolved.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Use the next_by_type pointer to create a list of all unresolved
hard links and iterate over that list for link resolution.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Instead of having a file_info_t next pointer, requiring an up-cast
to tree_node_t all the time, simply add a "next_by_type" pointer to
the tree node itself, which can also be used for other purposes by
other node types and removes the need for up-casting.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The single boolean created_implicitly can be replaced with a general
purpose flag field. The "children" pointer can then be hoisted directly
into the data union of tree_node_t.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
If we look at a sub directory, piece totether the full path and open
that instead. This allows us to move the directory open into the scan
function and get rid of the dirfd trickery. Also pull the recusion
step out into the parent function.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
On Windows, long is a 32 bit integer, so we cannot check if the long
value is greater than UINT32_MAX. Instead, check if strtol sets errno.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
We do not allow hard links to directories, so we can toss the special
case handling code for that. The visited mechanism was pointless
anyway, because we don't even descend down hard links in the recursive
tree handling functions.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
For some reason, the recursive hardlink resolution ended up in post
process, calling into the non recrusive one in hardlink.c that wasn't
used elsewhere.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The idea of the block align feature was to allow micro-managing that
some files are forcefully aligned to 1k/4k ("device block") boundaries,
hoping to improve access time at the cost of data density. The feature
was not exposed in the tools for a long time and eventuall added to the
sort file. Measurement and experimentation showed, that it in fact
worsened the read performance on a test system with an old micro SD
card as the bottle neck.
The feature is removed, and if needed, can be brought back simply by
wrapping/sub-classing the default block writer, if need be..
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
This basically re-uses the libxfrm pack/unpack tests, but runs
the data through a stream wrapper.
When de-compressing, we have a ridiculously tiny input buffer,
to force the wrapper to snort up the data in several attempts
until the it can decompress something. We read the data byte-by-byte
to force the wraper to internally cache the uncompressed data and
spoon feed it to us. It has to be completely transparent to us that
it internaly decompresses and also reads transparently across
concatenated streams.
When compressing, we only require that the output is smaller than
the input and not equal to it. We also require the wrapper to flush
the wrapped stream when it is flushed. We then test if the compressed
data can be unpacked again.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
We were previously building pack for unpack and vice versa.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Having it all in one buffer allows us the re-use the "generat GNU
record" function.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
By cobbling together the xattr lines manually in libtar, the
need (and thus the function itself) are removed.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Generate a simple tarball and compare it with a reference.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
In the istream implementation, automatically skip the padding when we
reach end-of-file. Also skip file AND padding when we destroy the
object. Replace the remaining instances with a simple istream_skip
instead and remove the wrapper from libtar.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
The tar_istream_t reads the data from a tar file, having been given
the header, and synthesizes zero bytes for sparse regions.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Use read_number in the places that remain.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
There was some code duplication for extracting the sparse entry
fields from the start record and the subsequent extended record.
This commit introduces a data structure for both and unifies
the parsing code paths.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
- Use is_memory_zero from libutil
- Move checksum update function to tar writer code
- Move checksum verify function to tar reader code
- Only export the function to compute the checksum
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|
|
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
|