head 1.10;
access;
symbols
libarchive-3-8-10:1.1.1.8
pkgsrc-2026Q3:1.9.0.20
pkgsrc-2026Q3-base:1.9
libarchive-3-8-9:1.1.1.7
libarchive-3-8-8:1.1.1.7
pkgsrc-2026Q2:1.9.0.18
pkgsrc-2026Q2-base:1.9
libarchive-3-8-7:1.1.1.7
libarchive-3-8-6:1.1.1.7
pkgsrc-2026Q1:1.9.0.16
pkgsrc-2026Q1-base:1.9
libarchive-3-8-5:1.1.1.7
libarchive-3-8-4:1.1.1.7
pkgsrc-2025Q4:1.9.0.14
pkgsrc-2025Q4-base:1.9
libarchive-3-8-3:1.1.1.7
libarchive-3-8-2:1.1.1.7
pkgsrc-2025Q3:1.9.0.12
pkgsrc-2025Q3-base:1.9
libarchive-3-8-1:1.1.1.7
pkgsrc-2025Q2:1.9.0.10
pkgsrc-2025Q2-base:1.9
libarchive-3-8-0:1.1.1.7
libarchive-3-7-9:1.1.1.7
pkgsrc-2025Q1:1.9.0.8
pkgsrc-2025Q1-base:1.9
pkgsrc-2024Q4:1.9.0.6
pkgsrc-2024Q4-base:1.9
libarchive-3-7-7:1.1.1.7
pkgsrc-2024Q3:1.9.0.4
pkgsrc-2024Q3-base:1.9
libarchive-3-7-5:1.1.1.7
pkgsrc-2024Q2:1.9.0.2
pkgsrc-2024Q2-base:1.9
libarchive-3-7-4:1.1.1.7
libarchive-3-7-3:1.1.1.6
pkgsrc-2024Q1:1.8.0.2
pkgsrc-2024Q1-base:1.8
libarchive-3-7-2:1.1.1.6
pkgsrc-2023Q4:1.7.0.30
pkgsrc-2023Q4-base:1.7
pkgsrc-2023Q3:1.7.0.28
pkgsrc-2023Q3-base:1.7
pkgsrc-2023Q2:1.7.0.26
pkgsrc-2023Q2-base:1.7
pkgsrc-2023Q1:1.7.0.24
pkgsrc-2023Q1-base:1.7
pkgsrc-2022Q4:1.7.0.22
pkgsrc-2022Q4-base:1.7
pkgsrc-2022Q3:1.7.0.20
pkgsrc-2022Q3-base:1.7
pkgsrc-2022Q2:1.7.0.18
pkgsrc-2022Q2-base:1.7
pkgsrc-2022Q1:1.7.0.16
pkgsrc-2022Q1-base:1.7
pkgsrc-2021Q4:1.7.0.14
pkgsrc-2021Q4-base:1.7
pkgsrc-2021Q3:1.7.0.12
pkgsrc-2021Q3-base:1.7
pkgsrc-2021Q2:1.7.0.10
pkgsrc-2021Q2-base:1.7
pkgsrc-2021Q1:1.7.0.8
pkgsrc-2021Q1-base:1.7
pkgsrc-2020Q4:1.7.0.6
pkgsrc-2020Q4-base:1.7
pkgsrc-2020Q3:1.7.0.4
pkgsrc-2020Q3-base:1.7
pkgsrc-2020Q2:1.7.0.2
pkgsrc-2020Q2-base:1.7
pkgsrc-2020Q1:1.6.0.4
pkgsrc-2020Q1-base:1.6
pkgsrc-2019Q4:1.6.0.6
pkgsrc-2019Q4-base:1.6
pkgsrc-2019Q3:1.6.0.2
pkgsrc-2019Q3-base:1.6
libarchive-3-4-0:1.1.1.5
libarchive-3-3-3:1.1.1.4
pkgsrc-2019Q2:1.5.0.18
pkgsrc-2019Q2-base:1.5
pkgsrc-2019Q1:1.5.0.16
pkgsrc-2019Q1-base:1.5
pkgsrc-2018Q4:1.5.0.14
pkgsrc-2018Q4-base:1.5
pkgsrc-2018Q3:1.5.0.12
pkgsrc-2018Q3-base:1.5
pkgsrc-2018Q2:1.5.0.10
pkgsrc-2018Q2-base:1.5
pkgsrc-2018Q1:1.5.0.8
pkgsrc-2018Q1-base:1.5
pkgsrc-2017Q4:1.5.0.6
pkgsrc-2017Q4-base:1.5
pkgsrc-2017Q3:1.5.0.4
pkgsrc-2017Q3-base:1.5
libarchive-3-3-2:1.1.1.4
pkgsrc-2017Q2:1.4.0.4
pkgsrc-2017Q2-base:1.4
pkgsrc-2017Q1:1.4.0.2
pkgsrc-2017Q1-base:1.4
libarchive-3-3-1:1.1.1.3
pkgsrc-2016Q4:1.3.0.6
pkgsrc-2016Q4-base:1.3
pkgsrc-2016Q3:1.3.0.4
pkgsrc-2016Q3-base:1.3
pkgsrc-2016Q2:1.3.0.2
pkgsrc-2016Q2-base:1.3
libarchive-3-2-1:1.1.1.2
pkgsrc-2016Q1:1.2.0.10
pkgsrc-2016Q1-base:1.2
pkgsrc-2015Q4:1.2.0.8
pkgsrc-2015Q4-base:1.2
pkgsrc-2015Q3:1.2.0.6
pkgsrc-2015Q3-base:1.2
pkgsrc-2015Q2:1.2.0.4
pkgsrc-2015Q2-base:1.2
pkgsrc-2015Q1:1.2.0.2
pkgsrc-2015Q1-base:1.2
pkgsrc-2014Q4:1.1.1.1.0.40
pkgsrc-2014Q4-base:1.1.1.1
pkgsrc-2014Q3:1.1.1.1.0.38
pkgsrc-2014Q3-base:1.1.1.1
pkgsrc-2014Q2:1.1.1.1.0.36
pkgsrc-2014Q2-base:1.1.1.1
pkgsrc-2014Q1:1.1.1.1.0.34
pkgsrc-2014Q1-base:1.1.1.1
pkgsrc-2013Q4:1.1.1.1.0.32
pkgsrc-2013Q4-base:1.1.1.1
pkgsrc-2013Q3:1.1.1.1.0.30
pkgsrc-2013Q3-base:1.1.1.1
pkgsrc-2013Q2:1.1.1.1.0.28
pkgsrc-2013Q2-base:1.1.1.1
pkgsrc-2013Q1:1.1.1.1.0.26
pkgsrc-2013Q1-base:1.1.1.1
pkgsrc-2012Q4:1.1.1.1.0.24
pkgsrc-2012Q4-base:1.1.1.1
pkgsrc-2012Q3:1.1.1.1.0.22
pkgsrc-2012Q3-base:1.1.1.1
pkgsrc-2012Q2:1.1.1.1.0.20
pkgsrc-2012Q2-base:1.1.1.1
pkgsrc-2012Q1:1.1.1.1.0.18
pkgsrc-2012Q1-base:1.1.1.1
pkgsrc-2011Q4:1.1.1.1.0.16
pkgsrc-2011Q4-base:1.1.1.1
pkgsrc-2011Q3:1.1.1.1.0.14
pkgsrc-2011Q3-base:1.1.1.1
pkgsrc-2011Q2:1.1.1.1.0.12
pkgsrc-2011Q2-base:1.1.1.1
pkgsrc-2011Q1:1.1.1.1.0.10
pkgsrc-2011Q1-base:1.1.1.1
pkgsrc-2010Q4:1.1.1.1.0.8
pkgsrc-2010Q4-base:1.1.1.1
pkgsrc-2010Q3:1.1.1.1.0.6
pkgsrc-2010Q3-base:1.1.1.1
libarchive-2-8-4:1.1.1.1
pkgsrc-2010Q2:1.1.1.1.0.4
pkgsrc-2010Q2-base:1.1.1.1
pkgsrc-2010Q1:1.1.1.1.0.2
pkgsrc-2010Q1-base:1.1.1.1
libarchive-2-8-3:1.1.1.1
libarchive-2-8-2:1.1.1.1
libarchive-2-8-0:1.1.1.1
KIENTZLE:1.1.1;
locks; strict;
comment @# @;
1.10
date 2026.10.19.12.05.17; author adam; state Exp;
branches;
next 1.9;
commitid R3KJfVxz3NuPb50H;
1.9
date 2024.04.30.06.05.19; author adam; state Exp;
branches;
next 1.8;
commitid id0E8i4RwCC4c88F;
1.8
date 2024.01.18.18.00.17; author adam; state Exp;
branches;
next 1.7;
commitid hNXpsHx3SuHqsXUE;
1.7
date 2020.05.26.09.16.41; author nia; state Exp;
branches;
next 1.6;
commitid nNhsdZACz3PjmJ9C;
1.6
date 2019.09.22.09.55.08; author joerg; state Exp;
branches;
next 1.5;
commitid FdPvRjF4OzwBwZDB;
1.5
date 2017.08.01.22.26.23; author joerg; state Exp;
branches;
next 1.4;
commitid 32clTfkmVE8bPy1A;
1.4
date 2017.02.25.21.11.19; author joerg; state Exp;
branches;
next 1.3;
commitid rW8QfCWrsCO1snHz;
1.3
date 2016.06.20.17.24.57; author joerg; state Exp;
branches;
next 1.2;
commitid ArUvympBjfBseebz;
1.2
date 2015.01.17.12.44.49; author adam; state Exp;
branches;
next 1.1;
commitid yy7e1hLrfmA2pn6y;
1.1
date 2010.02.20.03.49.47; author joerg; state Exp;
branches
1.1.1.1;
next ;
1.1.1.1
date 2010.02.20.03.49.47; author joerg; state Exp;
branches;
next 1.1.1.2;
1.1.1.2
date 2016.06.20.17.12.04; author joerg; state Exp;
branches;
next 1.1.1.3;
commitid rRgm3BqbmbI8aebz;
1.1.1.3
date 2017.02.25.20.54.21; author joerg; state Exp;
branches;
next 1.1.1.4;
commitid ReqPI0ibLYjdmnHz;
1.1.1.4
date 2017.08.01.22.21.12; author joerg; state Exp;
branches;
next 1.1.1.5;
commitid XQwPAFJku336Ny1A;
1.1.1.5
date 2019.09.22.09.51.33; author joerg; state Exp;
branches;
next 1.1.1.6;
commitid 5kDbfPbiV3INvZDB;
1.1.1.6
date 2024.01.18.17.37.45; author adam; state Exp;
branches;
next 1.1.1.7;
commitid zDULEPUODGjTkXUE;
1.1.1.7
date 2024.04.30.05.50.49; author adam; state Exp;
branches;
next 1.1.1.8;
commitid e4DnFoZdQV9Z688F;
1.1.1.8
date 2026.10.19.11.50.39; author adam; state Exp;
branches;
next ;
commitid eS0MvMrTxXQX650H;
desc
@@
1.10
log
@libarchive: updated to 3.8.10
3.8.10
New features:
7z: add Delta, RISCV, ARMTHUMB and IA64 filters for non-lzma archives
libarchive: support digest with nettle 4 and mbedtls 3
tar: add --mode option
Security and Bug Fixes
see ChangeLog
@
text
@ARCHIVE_READ_DISK(3) manual page
== NAME ==
'''archive_read_disk_new''',
'''archive_read_disk_open''',
'''archive_read_disk_open_w''',
'''archive_read_disk_set_behavior''',
'''archive_read_disk_set_symlink_logical''',
'''archive_read_disk_set_symlink_physical''',
'''archive_read_disk_set_symlink_hybrid''',
'''archive_read_disk_entry_from_file''',
'''archive_read_disk_gname''',
'''archive_read_disk_uname''',
'''archive_read_disk_set_uname_lookup''',
'''archive_read_disk_set_gname_lookup''',
'''archive_read_disk_set_standard_lookup''',
'''archive_read_disk_descend''',
'''archive_read_disk_can_descend''',
'''archive_read_disk_current_filesystem''',
'''archive_read_disk_current_filesystem_is_synthetic''',
'''archive_read_disk_current_filesystem_is_remote''',
'''archive_read_disk_set_matching''',
'''archive_read_disk_set_metadata_filter_callback''',
- functions for reading objects from disk
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
== SYNOPSIS ==
'''#include '''
''struct archive *''
'''archive_read_disk_new'''(''void'');
''int''
'''archive_read_disk_open'''(''struct archive *'', ''const char *'');
''int''
'''archive_read_disk_open_w'''(''struct archive *'', ''const wchar_t *'');
''int''
'''archive_read_disk_set_behavior'''(''struct archive *'', ''int'');
''int''
'''archive_read_disk_set_symlink_logical'''(''struct archive *'');
''int''
'''archive_read_disk_set_symlink_physical'''(''struct archive *'');
''int''
'''archive_read_disk_set_symlink_hybrid'''(''struct archive *'');
''const char *''
'''archive_read_disk_gname'''(''struct archive *'', ''gid_t'');
''const char *''
'''archive_read_disk_uname'''(''struct archive *'', ''uid_t'');
''int''
'''archive_read_disk_set_gname_lookup'''(''struct archive *'', ''void *'', ''const char *(*lookup)(void *, gid_t)'', ''void (*cleanup)(void *)'');
''int''
'''archive_read_disk_set_uname_lookup'''(''struct archive *'', ''void *'', ''const char *(*lookup)(void *, uid_t)'', ''void (*cleanup)(void *)'');
''int''
'''archive_read_disk_set_standard_lookup'''(''struct archive *'');
''int''
'''archive_read_disk_entry_from_file'''(''struct archive *'', ''struct archive_entry *'', ''int fd'', ''const struct stat *'');
''int''
'''archive_read_disk_descend'''(''struct archive *'');
''int''
'''archive_read_disk_can_descend'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem_is_synthetic'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem_is_remote'''(''struct archive *'');
''int''
'''archive_read_disk_set_matching'''(''struct archive *'', ''struct archive *'', ''void (*excluded_func)(struct archive *, void *, struct archive entry *)'', ''void *'');
''int''
'''archive_read_disk_set_metadata_filter_callback'''(''struct archive *'', ''int (*metadata_filter_func)(struct archive *, void*, struct archive_entry *)'', ''void *'');
== DESCRIPTION ==
These functions provide an API for reading information about
objects on disk.
In particular, they provide an interface for populating
'''struct archive_entry'''
objects.
- '''archive_read_disk_new'''()
-
Allocates and initializes a
'''struct archive'''
object suitable for reading object information from disk.
- '''archive_read_disk_open'''()
-
Opens the file or directory from the given path and prepares the
'''struct archive'''
to read it from disk.
- '''archive_read_disk_open_w'''()
-
Opens the file or directory from the given path as a wide character string and prepares the
'''struct archive'''
to read it from disk.
- '''archive_read_disk_set_behavior'''()
-
Configures various behavior options when reading entries from disk.
The flags field consists of a bitwise OR of one or more of the
following values:
- '''ARCHIVE_READDISK_HONOR_NODUMP'''
-
Skip files and directories with the nodump file attribute (file flag) set.
By default, the nodump file attribute is ignored.
- '''ARCHIVE_READDISK_MAC_COPYFILE'''
-
Mac OS X specific.
Read metadata (ACLs and extended attributes) with
[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
By default, metadata is read using
[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
- '''ARCHIVE_READDISK_NO_ACL'''
-
Do not read Access Control Lists.
By default, ACLs are read from disk.
- '''ARCHIVE_READDISK_NO_FFLAGS'''
-
Do not read file attributes (file flags).
By default, file attributes are read from disk.
See
[[chattr(1)|http://www.freebsd.org/cgi/man.cgi?query=chattr&sektion=1]]
(Linux)
or
[[chflags(1)|http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=1]]
(FreeBSD, Mac OS X)
for more information on file attributes.
- '''ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS'''
-
Do not traverse mount points.
By default, mount points are traversed.
- '''ARCHIVE_READDISK_NO_XATTR'''
-
Do not read extended file attributes (xattrs).
By default, extended file attributes are read from disk.
See
[[xattr(7)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=7]]
(Linux,)
[[xattr(2)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=2]]
(Mac OS X,)
or
[[getextattr(8)|http://www.freebsd.org/cgi/man.cgi?query=getextattr&sektion=8]]
(FreeBSD)
for more information on extended file attributes.
- '''ARCHIVE_READDISK_RESTORE_ATIME'''
-
Restore access time of traversed files.
By default, access time of traversed files is not restored.
- '''ARCHIVE_READDISK_NO_SPARSE'''
-
Do not read sparse file information.
By default, sparse file information is read from disk.
-
'''archive_read_disk_set_symlink_logical'''(),
'''archive_read_disk_set_symlink_physical'''(),
'''archive_read_disk_set_symlink_hybrid'''()
-
This sets the mode used for handling symbolic links.
The
"logical"
mode follows all symbolic links, except that a symbolic link whose
target is an ancestor directory of the link is archived as a symbolic
link rather than being followed, to avoid loops.
The
"physical"
mode does not follow any symbolic links.
The
"hybrid"
mode follows symbolic links specified as the target of
'''archive_read_disk_open'''()
or
'''archive_read_disk_open_w'''()
but does not follow symbolic links anywhere else.
-
'''archive_read_disk_gname'''(),
'''archive_read_disk_uname'''()
-
Returns a user or group name given a gid or uid value.
By default, these always return a NULL string.
-
'''archive_read_disk_set_gname_lookup'''(),
'''archive_read_disk_set_uname_lookup'''()
-
These allow you to override the functions used for
user and group name lookups.
You may also provide a
'''void *'''
pointer to a private data structure and a cleanup function for
that data.
The cleanup function will be invoked when the
'''struct archive'''
object is destroyed or when new lookup functions are registered.
- '''archive_read_disk_set_standard_lookup'''()
-
This convenience function installs a standard set of user
and group name lookup functions.
These functions use
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
and
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]]
to convert ids to names, defaulting to NULL if the names cannot
be looked up.
These functions also implement a simple memory cache to reduce
the number of calls to
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
and
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]].
- '''archive_read_disk_entry_from_file'''()
-
Populates a
'''struct archive_entry'''
object with information about a particular file.
The
'''archive_entry'''
object must have already been created with
[[ManPageArchiveEntryNew3]]
and at least one of the source path or path fields must already be set.
(If both are set, the source path will be used.)
Information is read from disk using the path name from the
'''struct archive_entry'''
object.
If a file descriptor is provided, some information will be obtained using
that file descriptor, on platforms that support the appropriate
system calls.
If a pointer to a
'''struct stat'''
is provided, information from that structure will be used instead
of reading from the disk where appropriate.
This can provide performance benefits in scenarios where
'''struct stat'''
information has already been read from the disk as a side effect
of some other operation.
(For example, directory traversal libraries often provide this information.)
Where necessary, user and group ids are converted to user and group names
using the currently-registered lookup functions above.
This affects the file ownership fields and ACL values in the
'''struct archive_entry'''
object.
- '''archive_read_disk_descend'''()
-
If the current entry can be descended, this function will mark the directory as the next entry for
[[ManPageArchiveReadHeader3]]
to visit.
- '''archive_read_disk_can_descend'''()
-
Returns 1 if the current entry is an unvisited directory and 0 otherwise.
- '''archive_read_disk_current_filesystem'''()
-
Returns the index of the most recent filesystem entry that has been visited through archive_read_disk.
- '''archive_read_disk_current_filesystem_is_synthetic'''()
-
Returns 1 if the current filesystem is a virtual filesystem. Returns 0 if the current filesystem is not a virtual filesystem. Returns -1 if it is unknown.
- '''archive_read_disk_current_filesystem_is_remote'''()
-
Returns 1 if the current filesystem is a remote filesystem. Returns 0 if the current filesystem is not a remote filesystem. Returns -1 if it is unknown.
- '''archive_read_disk_set_matching'''()
-
Allows the caller to set
'''struct archive'''
*_ma to compare each entry during
[[ManPageArchiveReadHeader3]]
calls. If matched based on calls to
'''archive_match_path_excluded ,'''
'''archive_match_time_excluded ,'''
or
'''archive_match_owner_excluded ,'''
then the callback function specified by the _excluded_func parameter will execute. This function will receive data provided to the fourth parameter, void *_client_data.
- '''archive_read_disk_set_metadata_filter_callback'''()
-
Allows the caller to set a callback function during calls to
[[ManPageArchiveReadHeader3]]
to filter out metadata for each entry. The callback function receives the
'''struct archive'''
object, void* custom filter data, and the
'''struct archive_entry .'''
If the callback function returns an error, ARCHIVE_RETRY will be returned and the entry will not be further processed.
More information about the
''struct'' archive
object and the overall design of the library can be found in the
[[ManPageLibarchive3]]
overview.
== EXAMPLES ==
The following illustrates basic usage of the library by
showing how to use it to copy an item on disk into an archive.
```text
void
file_to_archive(struct archive *a, const char *name)
{
char buff[8192];
size_t bytes_read;
struct archive *ard;
struct archive_entry *entry;
int fd;
fd = open(name, O_RDONLY);
if (fd < 0)
return;
ard = archive_read_disk_new();
archive_read_disk_set_standard_lookup(ard);
entry = archive_entry_new();
archive_entry_copy_pathname(entry, name);
archive_read_disk_entry_from_file(ard, entry, fd, NULL);
archive_write_header(a, entry);
while ((bytes_read = read(fd, buff, sizeof(buff))) > 0)
archive_write_data(a, buff, bytes_read);
archive_write_finish_entry(a);
archive_read_free(ard);
archive_entry_free(entry);
}
```
== RETURN VALUES ==
Most functions return
'''ARCHIVE_OK'''
(zero) on success, or one of several negative
error codes for errors.
Specific error codes include:
'''ARCHIVE_RETRY'''
for operations that might succeed if retried,
'''ARCHIVE_WARN'''
for unusual conditions that do not prevent further operations, and
'''ARCHIVE_FATAL'''
for serious errors that make remaining operations impossible.
'''archive_read_disk_new'''()
returns a pointer to a newly-allocated
'''struct archive'''
object or NULL if the allocation failed for any reason.
'''archive_read_disk_gname'''()
and
'''archive_read_disk_uname'''()
return
'''const char *'''
pointers to the textual name or NULL if the lookup failed for any reason.
The returned pointer points to internal storage that
may be reused on the next call to either of these functions;
callers should copy the string if they need to continue accessing it.
== ERRORS ==
Detailed error codes and textual descriptions are available from the
'''archive_errno'''()
and
'''archive_error_string'''()
functions.
== SEE ALSO ==
[[ManPageBsdtar1]],
[[ManPageArchiveRead3]],
[[ManPageArchiveUtil3]],
[[ManPageArchiveWrite3]],
[[ManPageArchiveWriteDisk3]],
[[ManPageLibarchive3]]
== HISTORY ==
The
'''libarchive'''
library first appeared in
FreeBSD 5.3.
The
'''archive_read_disk'''
interface was added to
'''libarchive''' 2.6
and first appeared in
FreeBSD 8.0.
== AUTHORS ==
The
'''libarchive'''
library was written by
Tim Kientzle <kientzle@@FreeBSD.org.>
== BUGS ==
The
"standard"
user name and group name lookup functions are not the defaults because
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]]
and
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
are sometimes too large for particular applications.
The current design allows the application author to use a more
compact implementation when appropriate.
The full list of metadata read from disk by
'''archive_read_disk_entry_from_file'''()
is necessarily system-dependent.
The
'''archive_read_disk_entry_from_file'''()
function reads as much information as it can from disk.
Some method should be provided to limit this so that clients who
do not need ACLs, for instance, can avoid the extra work needed
to look up such information.
This API should provide a set of methods for walking a directory tree.
That would make it a direct parallel of the
[[ManPageArchiveRead3]]
API.
When such methods are implemented, the
"hybrid"
symbolic link mode will make sense.
@
1.9
log
@libarchive: updated to 3.7.4
Libarchive 3.7.4 is a bugfix and security release
Security fixes:
rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access
Important bugfixes:
7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d39 1
a39 1
'''archive_read_disk_open_w'''(''struct archive *'', ''const wchar_t *'', '''');
d184 3
a186 1
mode follows all symbolic links.
d192 5
a196 3
mode currently behaves identically to the
"logical"
mode.
d264 1
a264 1
If the current entry can be descended, this function will mark the directory as the next entry for
d270 1
a270 1
Returns the index of the most recent filesystem entry that has been visited through archive_read_disk
d291 1
a291 1
object, void* custom filter data, and the
d312 3
a317 3
fd = open(name, O_RDONLY);
if (fd < 0)
return;
@
1.8
log
@libarchive: updated to 3.7.2
Libarchive 3.7.2 is a security, bugfix and feature release.
Security fixes:
Multiple vulnerabilities have been fixed in the PAX writer (1b4e0d0)
Important bugfixes:
bsdunzip(1) now correctly handles arguments following an -x after the zipfile
New features:
bsdunzip(1) now supports the "--version" flag
7-zip reader now translates Windows permissions into UNIX permissions
uudecode filter in raw mode now supports file name and file mode
zstd filter now supports the "long" write option
Libarchive 3.7.1 is a security, feature and bugfix release.
Security fixes:
SEGV and stack buffer overflow in verbose mode of cpio
Feature updates:
bsdunzip updated to match latest upstream code
Important bugfixes:
miscellaneous functional bugfixes
build fixes on multiple platforms
Libarchive 3.7.0 is a feature and bugfix release.
New features:
bsdunzip: new tool ported from FreeBSD
drop-in replacement for Info-ZIP unzip, not yet ported for Windows
7zip reader: support for Zstandard compression
7zip reader: support for ARM64 filter
zstd filter: support for multi-frame zstd archives
Other notable bugfixes and improvements:
pax: fix year 2038 problem on platforms with 64-bit time_t
Windows: Universal Windows Platform (UWP) fixes and improvements
Windows: bcrypt usage fixes and improvements
Windows: time function usage fixes and improvements
@
text
@d281 1
a281 1
then the callback function specified by the _excluded_func parameter will execute. This function will recieve data provided to the fourth parameter, void *_client_data.
d285 1
a285 1
to filter out metadata for each entry. The callback function recieves the
@
1.7
log
@libarchive: Update to 3.4.3
Libarchive 3.4.3 is a feature and bugfix release.
New features:
support for pzstd compressed files (#1357)
support for RHT.security.selinux tar extended attribute (#1348)
Important bugfixes:
various zstd fixes and improvements (#1342 #1352 #1359)
child process handling fixes (#1372)
Libarchive 3.4.2 is a feature and security release.
New features:
support for atomic file extraction (bsdtar -x --safe-writes) (#1289)
support for mbed TLS (PolarSSL) (#1301)
Important bugfixes:
security fixes in RAR5 reader (#1280 #1326)
compression buffer fix in XAR writer (#1317)
fix uname and gname longer than 32 characters in PAX writer (#1319)
fix segfault when archiving hard links in ISO9660 and XAR writers (#1325)
fix support for extracting 7z archive entries with Delta filter (#987)
Libarchive 3.4.1 is a feature and security release.
New features:
Unicode filename support for reading lha/lzh archives
New pax write option "xattrhdr"
Important bugfixes:
security fixes in wide string processing (#1276 #1298)
security fixes in RAR5 reader (#1212 #1217 #1296)
security fixes and optimizations to write filter logic (#351)
security fix related to use of readlink(2) (1dae5a5)
sparse file handling fixes (#1218 #1260)
Thanks to all contributors and bug reporters.
Special thanks to Christos Zoulas (@@zoulasc) from NetBSD for the atomic file extraction feature.
@
text
@d4 2
d15 8
a22 1
'''archive_read_disk_set_standard_lookup'''
d35 8
d80 28
d119 8
d172 3
d233 1
a233 1
[[ManPagerchiventryew3]]
d259 31
d294 1
a294 1
[[ManPageibarchive3]]
d359 5
a363 5
[[ManPagerchiveead3]],
[[ManPagerchivetil3]],
[[ManPagerchiverite3]],
[[ManPagerchiveriteisk3]],
[[ManPageibarchive3]]
d404 1
a404 1
[[ManPagerchiveead3]]
@
1.6
log
@Update for libarchive-3.4.0:
- improvements for Android APK and JAR archives
- better support for non-recursive list and extract
- tar --exclude-vcs support
- fixes for file attributes and flags handling
- zipx support
- rar 5.0 reader
@
text
@d81 1
a81 1
By default, the nodump file atrribute is ignored.
d83 2
a84 1
Mac OS X specific. Read metadata (ACLs and extended attributes) with
d103 1
a103 1
By defaut, moint points are traversed.
d177 1
a177 1
[[ManPageArchiveEntryNew3]]
d199 1
a199 1
using the currently registered lookup functions above.
d207 1
a207 1
[[ManPageLibarchive3]]
d209 1
a209 1
== EXAMPLE ==
a270 4
[[ManPageArchiveRead3]],
[[ManPageArchiveUtil3]],
[[ManPageArchiveWrite3]],
[[ManPageArchiveWriteDisk3]],
d272 5
a276 1
[[ManPageLibarchive3]]
d317 1
a317 1
[[ManPageArchiveRead3]]
@
1.5
log
@Merge for libarchive-3.3.2.
@
text
@d176 1
a176 1
[[ManPagerchiventryew3]]
d206 1
a206 1
[[ManPageibarchive3]]
d270 4
a273 4
[[ManPagerchiveead3]],
[[ManPagerchivetil3]],
[[ManPagerchiverite3]],
[[ManPagerchiveriteisk3]],
d275 1
a275 1
[[ManPageibarchive3]]
d316 1
a316 1
[[ManPagerchiveead3]]
@
1.4
log
@Merge libarchive-3.3.1.
@
text
@d4 1
d13 1
a13 4
'''archive_read_disk_set_standard_lookup''',
'''archive_read_close''',
'''archive_read_finish''',
'''archive_read_free'''
d26 4
a62 12
''int''
'''archive_read_close'''(''struct archive *'');
''int''
'''archive_read_finish'''(''struct archive *'');
''int''
'''archive_read_free'''(''struct archive *'');
d74 45
d176 1
a176 1
[[ManPageArchiveEntryNew3]]
a201 11
'''archive_read_close'''()
Does nothing for
'''archive_read_disk'''
handles.
'''archive_read_finish'''()
This is a deprecated synonym for
'''archive_read_free'''().
'''archive_read_free'''()
Invokes
'''archive_read_close'''()
if it was not invoked manually, then releases all resources.
d206 1
a206 1
[[ManPageLibarchive3]]
d270 4
a273 4
[[ManPageArchiveRead3]],
[[ManPageArchiveUtil3]],
[[ManPageArchiveWrite3]],
[[ManPageArchiveWriteDisk3]],
d275 1
a275 1
[[ManPageLibarchive3]]
d316 1
a316 1
[[ManPageArchiveRead3]]
@
1.3
log
@Update for libarchive 3.2.1.
@
text
@d38 1
a38 1
''int''
d42 1
a42 1
''int''
d141 1
a141 1
[[ManPagerchiventryew3]]
d182 1
a182 1
[[ManPageibarchive3]]
d246 4
a249 4
[[ManPagerchiveead3]],
[[ManPagerchivetil3]],
[[ManPagerchiverite3]],
[[ManPagerchiveriteisk3]],
d251 1
a251 1
[[ManPageibarchive3]]
d292 1
a292 1
[[ManPagerchiveead3]]
@
1.2
log
@Changes 3.1.2:
This is a maintenance update to fix issues with the new RAR seeking
feature. This new release also contains fixes for build failures when
building libarchive using Visual Studio 2012 and MinGW.
@
text
@d22 1
a22 1
'''struct archive *'''
d26 1
a26 1
'''int'''
d30 1
a30 1
'''int'''
d34 1
a34 1
'''int'''
d38 1
a38 1
'''int'''
d42 1
a42 1
'''int'''
d46 1
a46 1
'''int'''
d50 1
a50 1
'''int'''
d54 1
a54 1
'''int'''
d58 1
a58 1
'''int'''
d62 1
a62 1
'''int'''
d66 1
a66 1
'''int'''
d70 1
a70 1
'''int'''
d124 1
a124 1
'''getpwuid'''(3)
d126 1
a126 1
'''getgrgid'''(3)
d131 1
a131 1
'''getpwuid'''(3)
d133 1
a133 1
'''getgrgid'''(3).
d141 1
a141 1
'''archive_entry_new'''(3)
d182 1
a182 1
'''libarchive'''(3)
d246 6
a251 6
'''archive_read'''(3),
'''archive_util'''(3),
'''archive_write'''(3),
'''archive_write_disk'''(3),
'''tar'''(1),
'''libarchive'''(3)
d272 1
a272 1
'''getgrgid'''(3)
d274 1
a274 1
'''getpwuid'''(3)
d292 1
a292 1
'''archive_read'''(3)
@
1.1
log
@Initial revision
@
text
@d1 143
a143 136
#summary archive_read_disk 3 manual page
== NAME ==
*archive_read_disk_new*,
*archive_read_disk_set_symlink_logical*,
*archive_read_disk_set_symlink_physical*,
*archive_read_disk_set_symlink_hybrid*,
*archive_read_disk_entry_from_file*,
*archive_read_disk_gname*,
*archive_read_disk_uname*,
*archive_read_disk_set_uname_lookup*,
*archive_read_disk_set_gname_lookup*,
*archive_read_disk_set_standard_lookup*,
*archive_read_close*,
*archive_read_finish*
- functions for reading objects from disk
== SYNOPSIS ==
*#include *
*struct archive `*`*
*archive_read_disk_new*(_void_);
*int*
*archive_read_disk_set_symlink_logical*(_struct archive `*`_);
*int*
*archive_read_disk_set_symlink_physical*(_struct archive `*`_);
*int*
*archive_read_disk_set_symlink_hybrid*(_struct archive `*`_);
*int*
*archive_read_disk_gname*(_struct archive `*`_, _gid_t_);
*int*
*archive_read_disk_uname*(_struct archive `*`_, _uid_t_);
*int*
*archive_read_disk_set_gname_lookup*(_struct archive `*`_, _void `*`_, _const char `*`(`*`lookup)(void `*`, gid_t)_, _void (`*`cleanup)(void `*`)_);
*int*
*archive_read_disk_set_uname_lookup*(_struct archive `*`_, _void `*`_, _const char `*`(`*`lookup)(void `*`, uid_t)_, _void (`*`cleanup)(void `*`)_);
*int*
*archive_read_disk_set_standard_lookup*(_struct archive `*`_);
*int*
*archive_read_disk_entry_from_file*(_struct archive `*`_, _struct archive_entry `*`_, _int fd_, _const struct stat `*`_);
*int*
*archive_read_close*(_struct archive `*`_);
*int*
*archive_read_finish*(_struct archive `*`_);
== DESCRIPTION ==
These functions provide an API for reading information about
objects on disk.
In particular, they provide an interface for populating
*struct archive_entry*
objects.
- *archive_read_disk_new*()
-
Allocates and initializes a
*struct archive*
object suitable for reading object information from disk.
-
*archive_read_disk_set_symlink_logical*(),
*archive_read_disk_set_symlink_physical*(),
*archive_read_disk_set_symlink_hybrid*()
-
This sets the mode used for handling symbolic links.
The
"logical"
mode follows all symbolic links.
The
"physical"
mode does not follow any symbolic links.
The
"hybrid"
mode currently behaves identically to the
"logical"
mode.
-
*archive_read_disk_gname*(),
*archive_read_disk_uname*()
-
Returns a user or group name given a gid or uid value.
By default, these always return a NULL string.
-
*archive_read_disk_set_gname_lookup*(),
*archive_read_disk_set_uname_lookup*()
-
These allow you to override the functions used for
user and group name lookups.
You may also provide a
*void `*`*
pointer to a private data structure and a cleanup function for
that data.
The cleanup function will be invoked when the
*struct archive*
object is destroyed or when new lookup functions are registered.
- *archive_read_disk_set_standard_lookup*()
-
This convenience function installs a standard set of user
and group name lookup functions.
These functions use
*getpwid*(3)
and
*getgrid*(3)
to convert ids to names, defaulting to NULL if the names cannot
be looked up.
These functions also implement a simple memory cache to reduce
the number of calls to
*getpwid*(3)
and
*getgrid*(3).
- *archive_read_disk_entry_from_file*()
-
Populates a
*struct archive_entry*
object with information about a particular file.
The
*archive_entry*
object must have already been created with
*archive_entry_new*(3)
and at least one of the source path or path fields must already be set.
(If both are set, the source path will be used.)
d145 6
a150 6
Information is read from disk using the path name from the
*struct archive_entry*
object.
If a file descriptor is provided, some information will be obtained using
that file descriptor, on platforms that support the appropriate
system calls.
d152 9
a160 9
If a pointer to a
*struct stat*
is provided, information from that structure will be used instead
of reading from the disk where appropriate.
This can provide performance benefits in scenarios where
*struct stat*
information has already been read from the disk as a side effect
of some other operation.
(For example, directory traversal libraries often provide this information.)
d162 26
a187 21
Where necessary, user and group ids are converted to user and group names
using the currently registered lookup functions above.
This affects the file ownership fields and ACL values in the
*struct archive_entry*
object.
- *archive_read_close*()
-
This currently does nothing.
- *archive_write_finish*()
-
Invokes
*archive_write_close*()
if it was not invoked manually, then releases all resources.
More information about the
_struct_ archive
object and the overall design of the library can be found in the
*libarchive*(3)
overview.
== EXAMPLE ==
The following illustrates basic usage of the library by
showing how to use it to copy an item on disk into an archive.
{{{
d202 1
a202 1
archive_entry_copy_sourcepath(entry, name);
d208 1
a208 1
archive_read_finish(ard);
d211 13
a223 22
}}}
== RETURN VALUES ==
Most functions return
*ARCHIVE_OK*
(zero) on success, or one of several negative
error codes for errors.
Specific error codes include:
*ARCHIVE_RETRY*
for operations that might succeed if retried,
*ARCHIVE_WARN*
for unusual conditions that do not prevent further operations, and
*ARCHIVE_FATAL*
for serious errors that make remaining operations impossible.
The
*archive_errno*(3)
and
*archive_error_string*(3)
functions can be used to retrieve an appropriate error code and a
textual error message.
(See
*archive_util*(3)
for details.)
d225 4
a228 4
*archive_read_disk_new*()
returns a pointer to a newly-allocated
*struct archive*
object or NULL if the allocation failed for any reason.
d230 48
a277 9
*archive_read_disk_gname*()
and
*archive_read_disk_uname*()
return
*const char `*`*
pointers to the textual name or NULL if the lookup failed for any reason.
The returned pointer points to internal storage that
may be reused on the next call to either of these functions;
callers should copy the string if they need to continue accessing it.
d279 3
a281 32
== SEE ALSO ==
*archive_read*(3),
*archive_write*(3),
*archive_write_disk*(3),
*tar*(1),
*libarchive*(3)
== HISTORY ==
The
*libarchive*
library first appeared in
FreeBSD 5.3.
The
*archive_read_disk*
interface was added to
*libarchive* 2.6
and first appeared in
FreeBSD 8.0.
== AUTHORS ==
The
*libarchive*
library was written by
Tim Kientzle
== BUGS ==
The
"standard"
user name and group name lookup functions are not the defaults because
*getgrid*(3)
and
*getpwid*(3)
are sometimes too large for particular applications.
The current design allows the application author to use a more
compact implementation when appropriate.
d283 6
a288 3
The full list of metadata read from disk by
*archive_read_disk_entry_from_file*()
is necessarily system-dependent.
d290 7
a296 14
The
*archive_read_disk_entry_from_file*()
function reads as much information as it can from disk.
Some method should be provided to limit this so that clients who
do not need ACLs, for instance, can avoid the extra work needed
to look up such information.
This API should provide a set of methods for walking a directory tree.
That would make it a direct parallel of the
*archive_read*(3)
API.
When such methods are implemented, the
"hybrid"
symbolic link mode will make sense.
@
1.1.1.1
log
@Import libarchive 2.8.0:
- Infrastructure:
- Allow command line tools as fallback for missing compression
libraries. If compiled without gzip for example, gunzip will
be used automatically.
- Improved support for a number of platforms like high-resolution
timestamps and Extended Attributes on various Unix systems
- New convience interface for creating archives based on disk content,
complement of the archive_write_disk interface.
- Frontends:
- bsdcpio ready for public consumption
- hand-written date parser replaces the yacc code
- Filter system:
- Simplified read filter chains
- Option support for filters
- LZMA, XZ, uudecode handled
- Format support:
- Write support for mtree files based on file system or archive
content
- Basic read support for Joliet
- Write support for zip files
- Write support for shar archives, both text-only and binary-safe
@
text
@@
1.1.1.2
log
@Import libarchive-3.2.1:
- security fixes and other bugfixes
- support for multhreading in xz 5.2+
@
text
@d1 136
a136 143
ARCHIVE_READ_DISK(3) manual page
== NAME ==
'''archive_read_disk_new''',
'''archive_read_disk_set_symlink_logical''',
'''archive_read_disk_set_symlink_physical''',
'''archive_read_disk_set_symlink_hybrid''',
'''archive_read_disk_entry_from_file''',
'''archive_read_disk_gname''',
'''archive_read_disk_uname''',
'''archive_read_disk_set_uname_lookup''',
'''archive_read_disk_set_gname_lookup''',
'''archive_read_disk_set_standard_lookup''',
'''archive_read_close''',
'''archive_read_finish''',
'''archive_read_free'''
- functions for reading objects from disk
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
== SYNOPSIS ==
'''#include '''
''struct archive *''
'''archive_read_disk_new'''(''void'');
''int''
'''archive_read_disk_set_symlink_logical'''(''struct archive *'');
''int''
'''archive_read_disk_set_symlink_physical'''(''struct archive *'');
''int''
'''archive_read_disk_set_symlink_hybrid'''(''struct archive *'');
''int''
'''archive_read_disk_gname'''(''struct archive *'', ''gid_t'');
''int''
'''archive_read_disk_uname'''(''struct archive *'', ''uid_t'');
''int''
'''archive_read_disk_set_gname_lookup'''(''struct archive *'', ''void *'', ''const char *(*lookup)(void *, gid_t)'', ''void (*cleanup)(void *)'');
''int''
'''archive_read_disk_set_uname_lookup'''(''struct archive *'', ''void *'', ''const char *(*lookup)(void *, uid_t)'', ''void (*cleanup)(void *)'');
''int''
'''archive_read_disk_set_standard_lookup'''(''struct archive *'');
''int''
'''archive_read_disk_entry_from_file'''(''struct archive *'', ''struct archive_entry *'', ''int fd'', ''const struct stat *'');
''int''
'''archive_read_close'''(''struct archive *'');
''int''
'''archive_read_finish'''(''struct archive *'');
''int''
'''archive_read_free'''(''struct archive *'');
== DESCRIPTION ==
These functions provide an API for reading information about
objects on disk.
In particular, they provide an interface for populating
'''struct archive_entry'''
objects.
- '''archive_read_disk_new'''()
-
Allocates and initializes a
'''struct archive'''
object suitable for reading object information from disk.
-
'''archive_read_disk_set_symlink_logical'''(),
'''archive_read_disk_set_symlink_physical'''(),
'''archive_read_disk_set_symlink_hybrid'''()
-
This sets the mode used for handling symbolic links.
The
"logical"
mode follows all symbolic links.
The
"physical"
mode does not follow any symbolic links.
The
"hybrid"
mode currently behaves identically to the
"logical"
mode.
-
'''archive_read_disk_gname'''(),
'''archive_read_disk_uname'''()
-
Returns a user or group name given a gid or uid value.
By default, these always return a NULL string.
-
'''archive_read_disk_set_gname_lookup'''(),
'''archive_read_disk_set_uname_lookup'''()
-
These allow you to override the functions used for
user and group name lookups.
You may also provide a
'''void *'''
pointer to a private data structure and a cleanup function for
that data.
The cleanup function will be invoked when the
'''struct archive'''
object is destroyed or when new lookup functions are registered.
- '''archive_read_disk_set_standard_lookup'''()
-
This convenience function installs a standard set of user
and group name lookup functions.
These functions use
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
and
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]]
to convert ids to names, defaulting to NULL if the names cannot
be looked up.
These functions also implement a simple memory cache to reduce
the number of calls to
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
and
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]].
- '''archive_read_disk_entry_from_file'''()
-
Populates a
'''struct archive_entry'''
object with information about a particular file.
The
'''archive_entry'''
object must have already been created with
[[ManPagerchiventryew3]]
and at least one of the source path or path fields must already be set.
(If both are set, the source path will be used.)
d138 6
a143 6
Information is read from disk using the path name from the
'''struct archive_entry'''
object.
If a file descriptor is provided, some information will be obtained using
that file descriptor, on platforms that support the appropriate
system calls.
d145 9
a153 9
If a pointer to a
'''struct stat'''
is provided, information from that structure will be used instead
of reading from the disk where appropriate.
This can provide performance benefits in scenarios where
'''struct stat'''
information has already been read from the disk as a side effect
of some other operation.
(For example, directory traversal libraries often provide this information.)
d155 21
a175 26
Where necessary, user and group ids are converted to user and group names
using the currently registered lookup functions above.
This affects the file ownership fields and ACL values in the
'''struct archive_entry'''
object.
- '''archive_read_close'''()
-
Does nothing for
'''archive_read_disk'''
handles.
- '''archive_read_finish'''()
-
This is a deprecated synonym for
'''archive_read_free'''().
- '''archive_read_free'''()
-
Invokes
'''archive_read_close'''()
if it was not invoked manually, then releases all resources.
More information about the
''struct'' archive
object and the overall design of the library can be found in the
[[ManPageibarchive3]]
overview.
== EXAMPLE ==
The following illustrates basic usage of the library by
showing how to use it to copy an item on disk into an archive.
```text
d190 1
a190 1
archive_entry_copy_pathname(entry, name);
d196 1
a196 1
archive_read_free(ard);
d199 22
a220 13
```
== RETURN VALUES ==
Most functions return
'''ARCHIVE_OK'''
(zero) on success, or one of several negative
error codes for errors.
Specific error codes include:
'''ARCHIVE_RETRY'''
for operations that might succeed if retried,
'''ARCHIVE_WARN'''
for unusual conditions that do not prevent further operations, and
'''ARCHIVE_FATAL'''
for serious errors that make remaining operations impossible.
d222 4
a225 4
'''archive_read_disk_new'''()
returns a pointer to a newly-allocated
'''struct archive'''
object or NULL if the allocation failed for any reason.
d227 9
a235 48
'''archive_read_disk_gname'''()
and
'''archive_read_disk_uname'''()
return
'''const char *'''
pointers to the textual name or NULL if the lookup failed for any reason.
The returned pointer points to internal storage that
may be reused on the next call to either of these functions;
callers should copy the string if they need to continue accessing it.
== ERRORS ==
Detailed error codes and textual descriptions are available from the
'''archive_errno'''()
and
'''archive_error_string'''()
functions.
== SEE ALSO ==
[[ManPagerchiveead3]],
[[ManPagerchivetil3]],
[[ManPagerchiverite3]],
[[ManPagerchiveriteisk3]],
[[ManPageBsdtar1]],
[[ManPageibarchive3]]
== HISTORY ==
The
'''libarchive'''
library first appeared in
FreeBSD 5.3.
The
'''archive_read_disk'''
interface was added to
'''libarchive''' 2.6
and first appeared in
FreeBSD 8.0.
== AUTHORS ==
The
'''libarchive'''
library was written by
Tim Kientzle <kientzle@@FreeBSD.org.>
== BUGS ==
The
"standard"
user name and group name lookup functions are not the defaults because
[[getgrgid(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrgid&sektion=3]]
and
[[getpwuid(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwuid&sektion=3]]
are sometimes too large for particular applications.
The current design allows the application author to use a more
compact implementation when appropriate.
d237 32
a268 3
The full list of metadata read from disk by
'''archive_read_disk_entry_from_file'''()
is necessarily system-dependent.
d270 3
a272 6
The
'''archive_read_disk_entry_from_file'''()
function reads as much information as it can from disk.
Some method should be provided to limit this so that clients who
do not need ACLs, for instance, can avoid the extra work needed
to look up such information.
d274 14
a287 7
This API should provide a set of methods for walking a directory tree.
That would make it a direct parallel of the
[[ManPagerchiveead3]]
API.
When such methods are implemented, the
"hybrid"
symbolic link mode will make sense.
@
1.1.1.3
log
@Import libarchive-3.3.1.
@
text
@d38 1
a38 1
''const char *''
d42 1
a42 1
''const char *''
d141 1
a141 1
[[ManPageArchiveEntryNew3]]
d182 1
a182 1
[[ManPageLibarchive3]]
d246 4
a249 4
[[ManPageArchiveRead3]],
[[ManPageArchiveUtil3]],
[[ManPageArchiveWrite3]],
[[ManPageArchiveWriteDisk3]],
d251 1
a251 1
[[ManPageLibarchive3]]
d292 1
a292 1
[[ManPageArchiveRead3]]
@
1.1.1.4
log
@Import libarchive-3.3.2 + 9de5f3 + f9dacbf:
- Support NFS4 ACLs on Linux
- Bugfixes
@
text
@a3 1
'''archive_read_disk_set_behavior''',
d12 4
a15 1
'''archive_read_disk_set_standard_lookup'''
a27 4
'''archive_read_disk_set_behavior'''(''struct archive *'', ''int'');
''int''
d61 12
a83 45
'''archive_read_disk_set_behavior'''()
Configures various behavior options when reading entries from disk.
The flags field consists of a bitwise OR of one or more of the
following values:
- '''ARCHIVE_READDISK_HONOR_NODUMP'''
-
Skip files and directories with the nodump file attribute (file flag) set.
By default, the nodump file atrribute is ignored.
- '''ARCHIVE_READDISK_MAC_COPYFILE'''
-
Mac OS X specific. Read metadata (ACLs and extended attributes) with
[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
By default, metadata is read using
[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
- '''ARCHIVE_READDISK_NO_ACL'''
-
Do not read Access Control Lists.
By default, ACLs are read from disk.
- '''ARCHIVE_READDISK_NO_FFLAGS'''
-
Do not read file attributes (file flags).
By default, file attributes are read from disk.
See
[[chattr(1)|http://www.freebsd.org/cgi/man.cgi?query=chattr&sektion=1]]
(Linux)
or
[[chflags(1)|http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=1]]
(FreeBSD, Mac OS X)
for more information on file attributes.
- '''ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS'''
-
Do not traverse mount points.
By defaut, moint points are traversed.
- '''ARCHIVE_READDISK_NO_XATTR'''
-
Do not read extended file attributes (xattrs).
By default, extended file attributes are read from disk.
See
[[xattr(7)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=7]]
(Linux,)
[[xattr(2)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=2]]
(Mac OS X,)
or
[[getextattr(8)|http://www.freebsd.org/cgi/man.cgi?query=getextattr&sektion=8]]
(FreeBSD)
for more information on extended file attributes.
- '''ARCHIVE_READDISK_RESTORE_ATIME'''
-
Restore access time of traversed files.
By default, access time of traversed files is not restored.
d141 1
a141 1
[[ManPagerchiventryew3]]
d167 11
d182 1
a182 1
[[ManPageibarchive3]]
d246 4
a249 4
[[ManPagerchiveead3]],
[[ManPagerchivetil3]],
[[ManPagerchiverite3]],
[[ManPagerchiveriteisk3]],
d251 1
a251 1
[[ManPageibarchive3]]
d292 1
a292 1
[[ManPagerchiveead3]]
@
1.1.1.5
log
@Import libarchive 3.4.0
@
text
@d176 1
a176 1
[[ManPageArchiveEntryNew3]]
d206 1
a206 1
[[ManPageLibarchive3]]
d270 4
a273 4
[[ManPageArchiveRead3]],
[[ManPageArchiveUtil3]],
[[ManPageArchiveWrite3]],
[[ManPageArchiveWriteDisk3]],
d275 1
a275 1
[[ManPageLibarchive3]]
d316 1
a316 1
[[ManPageArchiveRead3]]
@
1.1.1.6
log
@Import libarchive 3.7.2
@
text
@a3 2
'''archive_read_disk_open''',
'''archive_read_disk_open_w''',
d13 1
a13 8
'''archive_read_disk_set_standard_lookup''',
'''archive_read_disk_descend''',
'''archive_read_disk_can_descend''',
'''archive_read_disk_current_filesystem''',
'''archive_read_disk_current_filesystem_is_synthetic''',
'''archive_read_disk_current_filesystem_is_remote''',
'''archive_read_disk_set_matching''',
'''archive_read_disk_set_metadata_filter_callback''',
a25 8
'''archive_read_disk_open'''(''struct archive *'', ''const char *'');
''int''
'''archive_read_disk_open_w'''(''struct archive *'', ''const wchar_t *'', '''');
''int''
a62 28
''int''
'''archive_read_disk_descend'''(''struct archive *'');
''int''
'''archive_read_disk_can_descend'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem_is_synthetic'''(''struct archive *'');
''int''
'''archive_read_disk_current_filesystem_is_remote'''(''struct archive *'');
''int''
'''archive_read_disk_set_matching'''(''struct archive *'', ''struct archive *'', ''void (*excluded_func)(struct archive *, void *, struct archive entry *)'', ''void *'');
''int''
'''archive_read_disk_set_metadata_filter_callback'''(''struct archive *'', ''int (*metadata_filter_func)(struct archive *, void*, struct archive_entry *)'', ''void *'');
a73 8
'''archive_read_disk_open'''()
Opens the file or directory from the given path and prepares the
'''struct archive'''
to read it from disk.
'''archive_read_disk_open_w'''()
Opens the file or directory from the given path as a wide character string and prepares the
'''struct archive'''
to read it from disk.
d81 1
a81 1
By default, the nodump file attribute is ignored.
d83 1
a83 2
Mac OS X specific.
Read metadata (ACLs and extended attributes) with
d102 1
a102 1
By default, mount points are traversed.
a117 3
'''ARCHIVE_READDISK_NO_SPARSE'''
Do not read sparse file information.
By default, sparse file information is read from disk.
d198 1
a198 1
using the currently-registered lookup functions above.
a201 31
'''archive_read_disk_descend'''()
If the current entry can be descended, this function will mark the directory as the next entry for
[[ManPageArchiveReadHeader3]]
to visit.
'''archive_read_disk_can_descend'''()
Returns 1 if the current entry is an unvisited directory and 0 otherwise.
'''archive_read_disk_current_filesystem'''()
Returns the index of the most recent filesystem entry that has been visited through archive_read_disk
'''archive_read_disk_current_filesystem_is_synthetic'''()
Returns 1 if the current filesystem is a virtual filesystem. Returns 0 if the current filesystem is not a virtual filesystem. Returns -1 if it is unknown.
'''archive_read_disk_current_filesystem_is_remote'''()
Returns 1 if the current filesystem is a remote filesystem. Returns 0 if the current filesystem is not a remote filesystem. Returns -1 if it is unknown.
'''archive_read_disk_set_matching'''()
Allows the caller to set
'''struct archive'''
*_ma to compare each entry during
[[ManPageArchiveReadHeader3]]
calls. If matched based on calls to
'''archive_match_path_excluded ,'''
'''archive_match_time_excluded ,'''
or
'''archive_match_owner_excluded ,'''
then the callback function specified by the _excluded_func parameter will execute. This function will recieve data provided to the fourth parameter, void *_client_data.
'''archive_read_disk_set_metadata_filter_callback'''()
Allows the caller to set a callback function during calls to
[[ManPageArchiveReadHeader3]]
to filter out metadata for each entry. The callback function recieves the
'''struct archive'''
object, void* custom filter data, and the
'''struct archive_entry .'''
If the callback function returns an error, ARCHIVE_RETRY will be returned and the entry will not be further processed.
d208 1
a208 1
== EXAMPLES ==
a269 1
[[ManPageBsdtar1]],
d274 1
@
1.1.1.7
log
@Libarchive 3.7.4 is a bugfix and security release
Security fixes:
rar: Fix OOB in rar e8 filter (CVE-2024-26256)
zip: Fix out of boundary access
Important bugfixes:
7zip: Limit amount of properties
bsdtar: Fix error handling around strtol() usages
passphrase: Improve newline handling on Windows
passphrase: Never allow empty passwords
rar: Fix "File CRC Error" when extracting specific rar4 archives
xar: Avoid infinite link loop
zip: Update AppleDouble support for directories
zstd: Implement core detection
@
text
@d281 1
a281 1
then the callback function specified by the _excluded_func parameter will execute. This function will receive data provided to the fourth parameter, void *_client_data.
d285 1
a285 1
to filter out metadata for each entry. The callback function receives the
@
1.1.1.8
log
@libarchive: import version 3.8.10
@
text
@d39 1
a39 1
'''archive_read_disk_open_w'''(''struct archive *'', ''const wchar_t *'');
d184 1
a184 3
mode follows all symbolic links, except that a symbolic link whose
target is an ancestor directory of the link is archived as a symbolic
link rather than being followed, to avoid loops.
d190 3
a192 5
mode follows symbolic links specified as the target of
'''archive_read_disk_open'''()
or
'''archive_read_disk_open_w'''()
but does not follow symbolic links anywhere else.
d260 1
a260 1
If the current entry can be descended, this function will mark the directory as the next entry for
d266 1
a266 1
Returns the index of the most recent filesystem entry that has been visited through archive_read_disk.
d287 1
a287 1
object, void* custom filter data, and the
a307 3
fd = open(name, O_RDONLY);
if (fd < 0)
return;
d311 3
@