head	1.11;
access;
symbols
	libarchive-3-8-10:1.1.1.12
	pkgsrc-2026Q3:1.10.0.16
	pkgsrc-2026Q3-base:1.10
	libarchive-3-8-9:1.1.1.11
	libarchive-3-8-8:1.1.1.11
	pkgsrc-2026Q2:1.10.0.14
	pkgsrc-2026Q2-base:1.10
	libarchive-3-8-7:1.1.1.11
	libarchive-3-8-6:1.1.1.11
	pkgsrc-2026Q1:1.10.0.12
	pkgsrc-2026Q1-base:1.10
	libarchive-3-8-5:1.1.1.11
	libarchive-3-8-4:1.1.1.11
	pkgsrc-2025Q4:1.10.0.10
	pkgsrc-2025Q4-base:1.10
	libarchive-3-8-3:1.1.1.11
	libarchive-3-8-2:1.1.1.11
	pkgsrc-2025Q3:1.10.0.8
	pkgsrc-2025Q3-base:1.10
	libarchive-3-8-1:1.1.1.11
	pkgsrc-2025Q2:1.10.0.6
	pkgsrc-2025Q2-base:1.10
	libarchive-3-8-0:1.1.1.11
	libarchive-3-7-9:1.1.1.11
	pkgsrc-2025Q1:1.10.0.4
	pkgsrc-2025Q1-base:1.10
	pkgsrc-2024Q4:1.10.0.2
	pkgsrc-2024Q4-base:1.10
	libarchive-3-7-7:1.1.1.11
	pkgsrc-2024Q3:1.9.0.4
	pkgsrc-2024Q3-base:1.9
	libarchive-3-7-5:1.1.1.10
	pkgsrc-2024Q2:1.9.0.2
	pkgsrc-2024Q2-base:1.9
	libarchive-3-7-4:1.1.1.10
	libarchive-3-7-3:1.1.1.9
	pkgsrc-2024Q1:1.8.0.2
	pkgsrc-2024Q1-base:1.8
	libarchive-3-7-2:1.1.1.9
	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.8
	libarchive-3-3-3:1.1.1.7
	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.7
	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.6
	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.5
	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.4.0.36
	pkgsrc-2014Q4-base:1.1.1.4
	pkgsrc-2014Q3:1.1.1.4.0.34
	pkgsrc-2014Q3-base:1.1.1.4
	pkgsrc-2014Q2:1.1.1.4.0.32
	pkgsrc-2014Q2-base:1.1.1.4
	pkgsrc-2014Q1:1.1.1.4.0.30
	pkgsrc-2014Q1-base:1.1.1.4
	pkgsrc-2013Q4:1.1.1.4.0.28
	pkgsrc-2013Q4-base:1.1.1.4
	pkgsrc-2013Q3:1.1.1.4.0.26
	pkgsrc-2013Q3-base:1.1.1.4
	pkgsrc-2013Q2:1.1.1.4.0.24
	pkgsrc-2013Q2-base:1.1.1.4
	pkgsrc-2013Q1:1.1.1.4.0.22
	pkgsrc-2013Q1-base:1.1.1.4
	pkgsrc-2012Q4:1.1.1.4.0.20
	pkgsrc-2012Q4-base:1.1.1.4
	pkgsrc-2012Q3:1.1.1.4.0.18
	pkgsrc-2012Q3-base:1.1.1.4
	pkgsrc-2012Q2:1.1.1.4.0.16
	pkgsrc-2012Q2-base:1.1.1.4
	pkgsrc-2012Q1:1.1.1.4.0.14
	pkgsrc-2012Q1-base:1.1.1.4
	pkgsrc-2011Q4:1.1.1.4.0.12
	pkgsrc-2011Q4-base:1.1.1.4
	pkgsrc-2011Q3:1.1.1.4.0.10
	pkgsrc-2011Q3-base:1.1.1.4
	pkgsrc-2011Q2:1.1.1.4.0.8
	pkgsrc-2011Q2-base:1.1.1.4
	pkgsrc-2011Q1:1.1.1.4.0.6
	pkgsrc-2011Q1-base:1.1.1.4
	pkgsrc-2010Q4:1.1.1.4.0.4
	pkgsrc-2010Q4-base:1.1.1.4
	pkgsrc-2010Q3:1.1.1.4.0.2
	pkgsrc-2010Q3-base:1.1.1.4
	libarchive-2-8-4:1.1.1.4
	pkgsrc-2010Q2:1.1.1.3.0.4
	pkgsrc-2010Q2-base:1.1.1.3
	pkgsrc-2010Q1:1.1.1.3.0.2
	pkgsrc-2010Q1-base:1.1.1.3
	libarchive-2-8-3:1.1.1.3
	libarchive-2-8-2:1.1.1.2
	libarchive-2-8-0:1.1.1.1
	KIENTZLE:1.1.1;
locks; strict;
comment	@# @;


1.11
date	2026.10.19.12.05.17;	author adam;	state Exp;
branches;
next	1.10;
commitid	R3KJfVxz3NuPb50H;

1.10
date	2024.10.19.05.39.57;	author adam;	state Exp;
branches;
next	1.9;
commitid	fYRSlpIWMYluweuF;

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.16;	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.50.02;	author joerg;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2010.02.20.03.50.02;	author joerg;	state Exp;
branches;
next	1.1.1.2;

1.1.1.2
date	2010.03.14.17.57.21;	author joerg;	state Exp;
branches;
next	1.1.1.3;

1.1.1.3
date	2010.03.16.17.07.32;	author joerg;	state Exp;
branches;
next	1.1.1.4;

1.1.1.4
date	2010.07.09.11.53.31;	author joerg;	state Exp;
branches;
next	1.1.1.5;

1.1.1.5
date	2016.06.20.17.12.01;	author joerg;	state Exp;
branches;
next	1.1.1.6;
commitid	rRgm3BqbmbI8aebz;

1.1.1.6
date	2017.02.25.20.54.13;	author joerg;	state Exp;
branches;
next	1.1.1.7;
commitid	ReqPI0ibLYjdmnHz;

1.1.1.7
date	2017.08.01.22.21.12;	author joerg;	state Exp;
branches;
next	1.1.1.8;
commitid	XQwPAFJku336Ny1A;

1.1.1.8
date	2019.09.22.09.51.33;	author joerg;	state Exp;
branches;
next	1.1.1.9;
commitid	5kDbfPbiV3INvZDB;

1.1.1.9
date	2024.01.18.17.37.46;	author adam;	state Exp;
branches;
next	1.1.1.10;
commitid	zDULEPUODGjTkXUE;

1.1.1.10
date	2024.04.30.05.50.49;	author adam;	state Exp;
branches;
next	1.1.1.11;
commitid	e4DnFoZdQV9Z688F;

1.1.1.11
date	2024.10.19.05.27.34;	author adam;	state Exp;
branches;
next	1.1.1.12;
commitid	v1iXM4j1Na52seuF;

1.1.1.12
date	2026.10.19.11.50.40;	author adam;	state Exp;
branches;
next	;
commitid	eS0MvMrTxXQX650H;


desc
@@


1.11
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
@4mARCHIVE_READ_DISK24m(3)	 Library Functions Manual      4mARCHIVE_READ_DISK24m(3)

1mNAME0m
       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

1mLIBRARY0m
       Streaming Archive Library (libarchive, -larchive)

1mSYNOPSIS0m
       1m#include <archive.h>0m

       4mstruct24m 4marchive24m 4m*0m
       1marchive_read_disk_new22m(4mvoid24m);

       4mint0m
       1marchive_read_disk_open22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*24m);

       4mint0m
       1marchive_read_disk_open_w22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mwchar_t24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_behavior22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);

       4mint0m
       1marchive_read_disk_set_symlink_logical22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_symlink_physical22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_symlink_hybrid22m(4mstruct24m 4marchive24m 4m*24m);

       4mconst24m 4mchar24m 4m*0m
       1marchive_read_disk_gname22m(4mstruct24m 4marchive24m 4m*24m, 4mgid_t24m);

       4mconst24m 4mchar24m 4m*0m
       1marchive_read_disk_uname22m(4mstruct24m 4marchive24m 4m*24m, 4muid_t24m);

       4mint0m
       1marchive_read_disk_set_gname_lookup22m(4mstruct24m 4marchive24m 4m*24m,		   4mvoid24m 4m*24m,
	   4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4mgid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);

       4mint0m
       1marchive_read_disk_set_uname_lookup22m(4mstruct24m 4marchive24m 4m*24m,		   4mvoid24m 4m*24m,
	   4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4muid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);

       4mint0m
       1marchive_read_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_entry_from_file22m(4mstruct24m 4marchive24m 4m*24m,
	   4mstruct24m 4marchive_entry24m 4m*24m, 4mint24m 4mfd24m, 4mconst24m 4mstruct24m 4mstat24m 4m*24m);

       4mint0m
       1marchive_read_disk_descend22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_can_descend22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem_is_synthetic22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem_is_remote22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_matching22m(4mstruct24m 4marchive24m 4m*24m,	 4mstruct24m 4marchive24m 4m*24m,
	   4mvoid24m 4m(*excluded_func)(struct24m 4marchive24m 4m*,24m 4mvoid24m 4m*,24m 4mstruct24m 4marchive24m 4mentry24m 4m*)24m,
	   4mvoid24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_metadata_filter_callback22m(4mstruct24m 4marchive24m 4m*24m,
	   4mint24m 4m(*metadata_filter_func)(struct24m 4marchive24m 4m*,24m 4mvoid*,24m 4mstruct24m 4marchive_entry24m 4m*)24m,
	   4mvoid24m 4m*24m);

1mDESCRIPTION0m
       These functions provide an API for reading information about objects on
       disk.  In particular, they provide an interface for  populating	struct
       archive_entry objects.

       1marchive_read_disk_new22m()
	       Allocates  and initializes a struct archive object suitable for
	       reading object information from disk.

       1marchive_read_disk_open22m()
	       Opens the file or directory from the given  path	 and  prepares
	       the struct archive to read it from disk.

       1marchive_read_disk_open_w22m()
	       Opens the file or directory from the given path as a wide char‐
	       acter  string  and  prepares the struct archive to read it from
	       disk.

       1marchive_read_disk_set_behavior22m()
	       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:
	       1mARCHIVE_READDISK_HONOR_NODUMP0m
		       Skip files and directories with	the  nodump  file  at‐
		       tribute	(file  flag) set.  By default, the nodump file
		       attribute is ignored.
	       1mARCHIVE_READDISK_MAC_COPYFILE0m
		       Mac OS X specific.  Read metadata  (ACLs	 and  extended
		       attributes)  with 4mcopyfile24m(3).  By default, metadata is
		       read using 4mcopyfile24m(3).
	       1mARCHIVE_READDISK_NO_ACL0m
		       Do not read Access Control Lists.  By default, ACLs are
		       read from disk.
	       1mARCHIVE_READDISK_NO_FFLAGS0m
		       Do not read file attributes (file flags).  By  default,
		       file  attributes	 are  read  from  disk.	 See 4mchattr24m(1)
		       (Linux) or 4mchflags24m(1) (FreeBSD, Mac OS X) for more	in‐
		       formation on file attributes.
	       1mARCHIVE_READDISK_NO_TRAVERSE_MOUNTS0m
		       Do not traverse mount points.  By default, mount points
		       are traversed.
	       1mARCHIVE_READDISK_NO_XATTR0m
		       Do  not read extended file attributes (xattrs).	By de‐
		       fault, extended file attributes	are  read  from	 disk.
		       See   4mxattr24m(7)   (Linux),	4mxattr24m(2)  (Mac  OS	 X),  or
		       4mgetextattr24m(8) (FreeBSD) for	 more  information  on	ex‐
		       tended file attributes.
	       1mARCHIVE_READDISK_RESTORE_ATIME0m
		       Restore	access	time  of traversed files.  By default,
		       access time of traversed files is not restored.
	       1mARCHIVE_READDISK_NO_SPARSE0m
		       Do not  read  sparse  file  information.	  By  default,
		       sparse file information is read from disk.

       1marchive_read_disk_set_symlink_logical22m(),
	       1marchive_read_disk_set_symlink_physical22m(),
	       1marchive_read_disk_set_symlink_hybrid22m()
	       This  sets  the	mode  used  for	 handling symbolic links.  The
	       “logical” mode follows all symbolic links, except that  a  sym‐
	       bolic 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	     1marchive_read_disk_open22m()	 or
	       1marchive_read_disk_open_w22m()	but  does not follow symbolic links
	       anywhere else.

       1marchive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
	       Returns a user or group name given a gid or uid value.  By  de‐
	       fault, these always return a NULL string.

       1marchive_read_disk_set_gname_lookup22m(),
	       1marchive_read_disk_set_uname_lookup22m()
	       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	regis‐
	       tered.

       1marchive_read_disk_set_standard_lookup22m()
	       This  convenience  function installs a standard set of user and
	       group name lookup functions.  These functions  use  4mgetpwuid24m(3)
	       and  4mgetgrgid24m(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
	       4mgetpwuid24m(3) and 4mgetgrgid24m(3).

       1marchive_read_disk_entry_from_file22m()
	       Populates a struct archive_entry object with information	 about
	       a  particular file.  The archive_entry object must have already
	       been created with 4marchive_entry_new24m(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.)

	       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 in‐
	       formation.)

	       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.

       1marchive_read_disk_descend22m()
	       If  the current entry can be descended, this function will mark
	       the directory as the next entry for  4marchive_read_header24m(3)	 to
	       visit.

       1marchive_read_disk_can_descend22m()
	       Returns	1 if the current entry is an unvisited directory and 0
	       otherwise.

       1marchive_read_disk_current_filesystem22m()
	       Returns the index of the most recent filesystem entry that  has
	       been visited through archive_read_disk.

       1marchive_read_disk_current_filesystem_is_synthetic22m()
	       Returns	1  if  the current filesystem is a virtual filesystem.
	       Returns 0 if the current filesystem is not a  virtual  filesys‐
	       tem. Returns -1 if it is unknown.

       1marchive_read_disk_current_filesystem_is_remote22m()
	       Returns 1 if the current filesystem is a remote filesystem. Re‐
	       turns  0	 if the current filesystem is not a remote filesystem.
	       Returns -1 if it is unknown.

       1marchive_read_disk_set_matching22m()
	       Allows the caller to set struct archive *_ma  to	 compare  each
	       entry  during 4marchive_read_header24m(3) 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  pa‐
	       rameter	will execute. This function will receive data provided
	       to the fourth parameter, void *_client_data.

       1marchive_read_disk_set_metadata_filter_callback22m()
	       Allows the caller to set a callback function  during  calls  to
	       4marchive_read_header24m(3)  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 call‐
	       back function returns an error, ARCHIVE_RETRY will be  returned
	       and the entry will not be further processed.
       More information about the 4mstruct24m 4marchive24m object and the overall design
       of the library can be found in the 4mlibarchive24m(3) overview.

1mEXAMPLES0m
       The  following illustrates basic usage of the library by showing how to
       use it to copy an item on disk into an archive.

	     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);
	     }

1mRETURN VALUES0m
       Most functions return 1mARCHIVE_OK 22m(zero) on success, or one	of  several
       negative	 error	codes  for  errors.   Specific	error  codes  include:
       1mARCHIVE_RETRY	22mfor	operations   that   might   succeed   if   retried,
       1mARCHIVE_WARN  22mfor unusual conditions that do not prevent further opera‐
       tions, and 1mARCHIVE_FATAL 22mfor serious errors that make remaining  opera‐
       tions impossible.

       1marchive_read_disk_new22m()  returns  a pointer to a newly-allocated struct
       archive object or NULL if the allocation failed for any reason.

       1marchive_read_disk_gname22m() and  1marchive_read_disk_uname22m()  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.

1mERRORS0m
       Detailed	 error	codes  and textual descriptions are available from the
       1marchive_errno22m() and 1marchive_error_string22m() functions.

1mSEE ALSO0m
       4mtar24m(1),	4marchive_read24m(3),	  4marchive_util24m(3),	    4marchive_write24m(3),
       4marchive_write_disk24m(3), 4mlibarchive24m(3)

1mHISTORY0m
       The   1mlibarchive   22mlibrary	 first	 appeared   in	FreeBSD	 5.3.	The
       1marchive_read_disk 22minterface was added to 1mlibarchive 2.6 22mand  first  ap‐
       peared in FreeBSD 8.0.

1mAUTHORS0m
       The    1mlibarchive    22mlibrary    was	   written    by    Tim	   Kientzle
       <kientzle@@FreeBSD.org>.

1mBUGS0m
       The “standard” user name and group name lookup functions	 are  not  the
       defaults	 because  4mgetgrgid24m(3)  and 4mgetpwuid24m(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
       1marchive_read_disk_entry_from_file22m() is necessarily system-dependent.

       The 1marchive_read_disk_entry_from_file22m() function reads as much informa‐
       tion 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 4marchive_read24m(3) API.   When
       such methods are implemented, the “hybrid” symbolic link mode will make
       sense.

Debian				 April 3, 2017		  4mARCHIVE_READ_DISK24m(3)
@


1.10
log
@libarchive: updated to 3.7.7

Libarchive 3.7.7 is a bugfix and security release

Security fixes:

gzip: prevent a hang when processing a malformed gzip inside a gzip
tar: don't crash on truncated tar archives
tar: fix two leaks in tar header parsing

Important bugfixes:

7-zip: read/write symlink paths as UTF-8
cpio: exit with an error code if an entry could not be extracted
rar5: report encrypted entries
tar: fix truncation of entry pathnames in specific archives
windows: fix ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS


Libarchive 3.7.6 is a bugfix and security release.
This release fixes a tar regression introduced in libarchive 3.7.5

Important bugfixes.

tar: clean up linkpath between entries
tar: fix memory leaks when processing symlinks or parsing pax headers
iso: be more cautious about parsing ISO-9660 timestamps
@
text
@d151 8
a158 3
	       “logical” mode follows all symbolic links.  The “physical” mode
	       does not follow any symbolic links.   The  “hybrid”  mode  cur‐
	       rently behaves identically to the “logical” mode.
d161 1
a161 1
	       Returns	a user or group name given a gid or uid value.	By de‐
d166 1
a166 1
	       These allow you to override the functions  used	for  user  and
d168 3
a170 3
	       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 regis‐
d174 5
a178 5
	       This convenience function installs a standard set of  user  and
	       group  name  lookup functions.  These functions use 4mgetpwuid24m(3)
	       and 4mgetgrgid24m(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
d182 4
a185 4
	       Populates  a struct archive_entry object with information about
	       a particular file.  The archive_entry object must have  already
	       been  created with 4marchive_entry_new24m(3) and at least one of the
	       source path or path fields must already be set.	(If  both  are
d188 1
a188 1
	       Information  is	read  from  disk  using the path name from the
d190 1
a190 1
	       some information will be obtained using that  file  descriptor,
d193 6
a198 6
	       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  in‐
d201 3
a203 3
	       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
d207 2
a208 2
	       If the current entry can be descended, this function will  mark
	       the  directory  as the next entry for 4marchive_read_header24m(3) to
d212 1
a212 1
	       Returns 1 if the current entry is an unvisited directory and  0
d216 2
a217 2
	       Returns	the index of the most recent filesystem entry that has
	       been visited through archive_read_disk
d220 2
a221 2
	       Returns 1 if the current filesystem is  a  virtual  filesystem.
	       Returns	0  if the current filesystem is not a virtual filesys‐
d226 1
a226 1
	       turns 0 if the current filesystem is not a  remote  filesystem.
d230 2
a231 2
	       Allows  the  caller  to set struct archive *_ma to compare each
	       entry during 4marchive_read_header24m(3) calls. If matched based	 on
d234 2
a235 2
	       then  the callback function specified by the _excluded_func pa‐
	       rameter will execute. This function will receive data  provided
d239 2
a240 2
	       Allows  the  caller  to set a callback function during calls to
	       4marchive_read_header24m(3) to filter out metadata for  each  entry.
d243 1
a243 1
	       back  function returns an error, ARCHIVE_RETRY will be returned
d249 1
a249 1
       The following illustrates basic usage of the library by showing how  to
d261 3
a266 3
	       fd = open(name, O_RDONLY);
	       if (fd < 0)
		  return;
d278 1
a278 1
       Most  functions	return 1mARCHIVE_OK 22m(zero) on success, or one of several
d280 3
a282 3
       1mARCHIVE_RETRY	 22mfor	  operations   that   might   succeed  if  retried,
       1mARCHIVE_WARN 22mfor unusual conditions that do not prevent further  opera‐
       tions,  and 1mARCHIVE_FATAL 22mfor serious errors that make remaining opera‐
d285 1
a285 1
       1marchive_read_disk_new22m() returns a pointer to a  newly-allocated  struct
d288 3
a290 3
       1marchive_read_disk_gname22m()  and  1marchive_read_disk_uname22m()  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
d295 1
a295 1
       Detailed error codes and textual descriptions are  available  from  the
d303 2
a304 2
       The  1mlibarchive  22mlibrary  first   appeared	 in   FreeBSD	5.3.	The
       1marchive_read_disk  22minterface  was added to 1mlibarchive 2.6 22mand first ap‐
d312 2
a313 2
       The  “standard”	user  name and group name lookup functions are not the
       defaults because 4mgetgrgid24m(3) and 4mgetpwuid24m(3) are  sometimes  too  large
d317 1
a317 1
       The     full	list	 of	metadata    read    from    disk    by
d325 2
a326 2
       This API should provide a set of methods for walking a directory	 tree.
       That  would make it a direct parallel of the 4marchive_read24m(3) API.  When
@


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
@d1 1
a1 1
ARCHIVE_READ_DISK(3)	 BSD Library Functions Manual	  ARCHIVE_READ_DISK(3)
d3 321
a323 316
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 <archive.h>

     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 charac‐
	     ter 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 at‐
		     tributes) with copyfile(3).  By default, metadata is read
		     using copyfile(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)
		     (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor‐
		     mation 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 de‐
		     fault, extended file attributes are read from disk.  See
		     xattr(7) (Linux), xattr(2) (Mac OS X), or getextattr(8)
		     (FreeBSD) for more information on extended file at‐
		     tributes.
	     ARCHIVE_READDISK_RESTORE_ATIME
		     Restore access time of traversed files.  By default, ac‐
		     cess 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.	 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 de‐
	     fault, 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 de‐
	     stroyed 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) and
	     getgrgid(3) to convert ids to names, defaulting to NULL if the
	     names cannot be looked up.	 These functions also implement a sim‐
	     ple memory cache to reduce the number of calls to getpwuid(3) and
	     getgrgid(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.)

	     Information is read from disk using the path name from the struct
	     archive_entry object.  If a file descriptor is provided, some in‐
	     formation will be obtained using that file descriptor, on plat‐
	     forms 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 ap‐
	     propriate.	 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, direc‐
	     tory 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 archive_read_header(3) 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. Re‐
	     turns 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. Re‐
	     turns 0 if the current filesystem is not a remote filesystem. Re‐
	     turns -1 if it is unknown.

     archive_read_disk_set_matching()
	     Allows the caller to set struct archive *_ma to compare each en‐
	     try during archive_read_header(3) 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 param‐
	     eter 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
	     archive_read_header(3) to filter out metadata for each entry. The
	     callback function receives the struct archive object, void* cus‐
	     tom 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 libarchive(3) 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.

	   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;

	     ard = archive_read_disk_new();
	     archive_read_disk_set_standard_lookup(ard);
	     entry = archive_entry_new();
	     fd = open(name, O_RDONLY);
	     if (fd < 0)
		return;
	     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 impossi‐
     ble.

     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 rea‐
     son.  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
     tar(1), archive_read(3), archive_util(3), archive_write(3),
     archive_write_disk(3), 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 ap‐
     peared 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 de‐
     faults because getgrgid(3) and getpwuid(3) are sometimes too large for
     particular applications.  The current design allows the application au‐
     thor 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 informa‐
     tion 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.
d325 1
a325 1
BSD				 April 3, 2017				   BSD
@


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
@d225 1
a225 1
	     eter will execute. This function will recieve data provided to
d231 1
a231 1
	     callback function recieves the struct archive object, void* cus‐
@


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
a5 2
     archive_read_disk_new, archive_read_disk_set_behavior,
     archive_read_disk_set_symlink_logical,
d10 7
a16 2
     archive_read_disk_set_standard_lookup -- functions for reading objects
     from disk
d28 6
d66 25
d100 8
d117 3
a119 3
		     Mac OS X specific.  Read metadata (ACLs and extended
		     attributes) with copyfile(3).  By default, metadata is
		     read using copyfile(3).
d126 1
a126 1
		     (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor-
d132 5
a136 5
		     Do not read extended file attributes (xattrs).  By
		     default, extended file attributes are read from disk.
		     See xattr(7) (Linux), xattr(2) (Mac OS X), or
		     getextattr(8) (FreeBSD) for more information on extended
		     file attributes.
d138 5
a142 2
		     Restore access time of traversed files.  By default,
		     access time of traversed files is not restored.
d148 3
a150 3
	     ``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.
d153 2
a154 2
	     Returns a user or group name given a gid or uid value.  By
	     default, these always return a NULL string.
d161 2
a162 2
	     function will be invoked when the struct archive object is
	     destroyed or when new lookup functions are registered.
d168 1
a168 1
	     names cannot be looked up.  These functions also implement a sim-
d180 2
a181 2
	     archive_entry object.  If a file descriptor is provided, some
	     information will be obtained using that file descriptor, on plat-
d185 2
a186 2
	     structure will be used instead of reading from the disk where
	     appropriate.  This can provide performance benefits in scenarios
d188 1
a188 1
	     as a side effect of some other operation.	(For example, direc-
d195 40
d272 1
a272 1
     ARCHIVE_FATAL for serious errors that make remaining operations impossi-
d279 1
a279 1
     * pointers to the textual name or NULL if the lookup failed for any rea-
d294 2
a295 2
     archive_read_disk interface was added to libarchive 2.6 and first
     appeared in FreeBSD 8.0.
d302 4
a305 4
     The ``standard'' user name and group name lookup functions are not the
     defaults because getgrgid(3) and getpwuid(3) are sometimes too large for
     particular applications.  The current design allows the application
     author to use a more compact implementation when appropriate.
d310 1
a310 1
     The archive_read_disk_entry_from_file() function reads as much informa-
d317 1
a317 1
     such methods are implemented, the ``hybrid'' symbolic link mode will make
@


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
@d10 1
a10 1
     archive_read_disk_set_standard_lookup — functions for reading objects
d70 1
a70 1
		     (file flag) set.  By default, the nodump file atrribute
d73 3
a75 3
		     Mac OS X specific. Read metadata (ACLs and extended at‐
		     tributes) with copyfile(3).  By default, metadata is read
		     using copyfile(3).
d82 1
a82 1
		     (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor‐
d85 1
a85 1
		     Do not traverse mount points.  By defaut, moint points
d88 5
a92 5
		     Do not read extended file attributes (xattrs).  By de‐
		     fault, extended file attributes are read from disk.  See
		     xattr(7) (Linux), xattr(2) (Mac OS X), or getextattr(8)
		     (FreeBSD) for more information on extended file at‐
		     tributes.
d94 2
a95 2
		     Restore access time of traversed files.  By default, ac‐
		     cess time of traversed files is not restored.
d101 3
a103 3
	     “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.
d106 2
a107 2
	     Returns a user or group name given a gid or uid value.  By de‐
	     fault, these always return a NULL string.
d114 2
a115 2
	     function will be invoked when the struct archive object is de‐
	     stroyed or when new lookup functions are registered.
d121 1
a121 1
	     names cannot be looked up.  These functions also implement a sim‐
d133 2
a134 2
	     archive_entry object.  If a file descriptor is provided, some in‐
	     formation will be obtained using that file descriptor, on plat‐
d138 2
a139 2
	     structure will be used instead of reading from the disk where ap‐
	     propriate.  This can provide performance benefits in scenarios
d141 1
a141 1
	     as a side effect of some other operation.	(For example, direc‐
d145 1
a145 1
	     group names using the currently registered lookup functions
d151 1
a151 1
EXAMPLE
d185 1
a185 1
     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
d192 1
a192 1
     * pointers to the textual name or NULL if the lookup failed for any rea‐
d202 2
a203 2
     archive_read(3), archive_util(3), archive_write(3),
     archive_write_disk(3), tar(1), libarchive(3)
d207 2
a208 2
     archive_read_disk interface was added to libarchive 2.6 and first ap‐
     peared in FreeBSD 8.0.
d215 4
a218 4
     The “standard” user name and group name lookup functions are not the de‐
     faults because getgrgid(3) and getpwuid(3) are sometimes too large for
     particular applications.  The current design allows the application au‐
     thor to use a more compact implementation when appropriate.
d223 1
a223 1
     The archive_read_disk_entry_from_file() function reads as much informa‐
d230 1
a230 1
     such methods are implemented, the “hybrid” symbolic link mode will make
@


1.5
log
@Merge for libarchive-3.3.2.
@
text
@d73 3
a75 3
		     Mac OS X specific. Read metadata (ACLs and extended
		     attributes) with copyfile(3).  By default, metadata is
		     read using copyfile(3).
d88 5
a92 5
		     Do not read extended file attributes (xattrs).  By
		     default, extended file attributes are read from disk.
		     See xattr(7) (Linux), xattr(2) (Mac OS X), or
		     getextattr(8) (FreeBSD) for more information on extended
		     file attributes.
d94 2
a95 2
		     Restore access time of traversed files.  By default,
		     access time of traversed files is not restored.
d106 2
a107 2
	     Returns a user or group name given a gid or uid value.  By
	     default, these always return a NULL string.
d114 2
a115 2
	     function will be invoked when the struct archive object is
	     destroyed or when new lookup functions are registered.
d133 2
a134 2
	     archive_entry object.  If a file descriptor is provided, some
	     information will be obtained using that file descriptor, on plat‐
d138 2
a139 2
	     structure will be used instead of reading from the disk where
	     appropriate.  This can provide performance benefits in scenarios
d207 2
a208 2
     archive_read_disk interface was added to libarchive 2.6 and first
     appeared in FreeBSD 8.0.
d215 4
a218 4
     The “standard” user name and group name lookup functions are not the
     defaults because getgrgid(3) and getpwuid(3) are sometimes too large for
     particular applications.  The current design allows the application
     author to use a more compact implementation when appropriate.
@


1.4
log
@Merge libarchive-3.3.1.
@
text
@d3 8
a10 8
1mNAME0m
     1marchive_read_disk_new22m, 1marchive_read_disk_set_symlink_logical22m,
     1marchive_read_disk_set_symlink_physical22m,
     1marchive_read_disk_set_symlink_hybrid22m, 1marchive_read_disk_entry_from_file22m,
     1marchive_read_disk_gname22m, 1marchive_read_disk_uname22m,
     1marchive_read_disk_set_uname_lookup22m, 1marchive_read_disk_set_gname_lookup22m,
     1marchive_read_disk_set_standard_lookup22m, 1marchive_read_close22m,
     1marchive_read_finish22m, 1marchive_read_free 22m— functions for reading objects
d13 1
a13 1
1mLIBRARY0m
d16 2
a17 2
1mSYNOPSIS0m
     1m#include <archive.h>0m
d19 2
a20 2
     4mstruct24m 4marchive24m 4m*0m
     1marchive_read_disk_new22m(4mvoid24m);
d22 2
a23 2
     4mint0m
     1marchive_read_disk_set_symlink_logical22m(4mstruct24m 4marchive24m 4m*24m);
d25 2
a26 2
     4mint0m
     1marchive_read_disk_set_symlink_physical22m(4mstruct24m 4marchive24m 4m*24m);
d28 2
a29 2
     4mint0m
     1marchive_read_disk_set_symlink_hybrid22m(4mstruct24m 4marchive24m 4m*24m);
d31 2
a32 2
     4mconst24m 4mchar24m 4m*0m
     1marchive_read_disk_gname22m(4mstruct24m 4marchive24m 4m*24m, 4mgid_t24m);
d34 2
a35 2
     4mconst24m 4mchar24m 4m*0m
     1marchive_read_disk_uname22m(4mstruct24m 4marchive24m 4m*24m, 4muid_t24m);
d37 2
a38 3
     4mint0m
     1marchive_read_disk_set_gname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
	 4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4mgid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
d40 3
a42 3
     4mint0m
     1marchive_read_disk_set_uname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
	 4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4muid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
d44 3
a46 2
     4mint0m
     1marchive_read_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);
d48 2
a49 3
     4mint0m
     1marchive_read_disk_entry_from_file22m(4mstruct24m 4marchive24m 4m*24m,
	 4mstruct24m 4marchive_entry24m 4m*24m, 4mint24m 4mfd24m, 4mconst24m 4mstruct24m 4mstat24m 4m*24m);
d51 3
a53 2
     4mint0m
     1marchive_read_close22m(4mstruct24m 4marchive24m 4m*24m);
d55 1
a55 7
     4mint0m
     1marchive_read_finish22m(4mstruct24m 4marchive24m 4m*24m);

     4mint0m
     1marchive_read_free22m(4mstruct24m 4marchive24m 4m*24m);

1mDESCRIPTION0m
d60 1
a60 1
     1marchive_read_disk_new22m()
d64 36
a99 3
     1marchive_read_disk_set_symlink_logical22m(),
	     1marchive_read_disk_set_symlink_physical22m(),
	     1marchive_read_disk_set_symlink_hybrid22m()
d105 1
a105 1
     1marchive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
d109 2
a110 2
     1marchive_read_disk_set_gname_lookup22m(),
	     1marchive_read_disk_set_uname_lookup22m()
d117 1
a117 1
     1marchive_read_disk_set_standard_lookup22m()
d125 1
a125 1
     1marchive_read_disk_entry_from_file22m()
d148 1
a148 11

     1marchive_read_close22m()
	     Does nothing for archive_read_disk handles.

     1marchive_read_finish22m()
	     This is a deprecated synonym for 1marchive_read_free22m().

     1marchive_read_free22m()
	     Invokes 1marchive_read_close22m() if it was not invoked manually, then
	     releases all resources.
     More information about the 4mstruct24m 4marchive24m object and the overall design
d151 1
a151 1
1mEXAMPLE0m
d180 2
a181 2
1mRETURN VALUES0m
     Most functions return 1mARCHIVE_OK 22m(zero) on success, or one of several
d183 1
a183 1
     1mARCHIVE_RETRY 22mfor operations that might succeed if retried, 1mARCHIVE_WARN0m
d185 1
a185 1
     1mARCHIVE_FATAL 22mfor serious errors that make remaining operations impossi‐
d188 1
a188 1
     1marchive_read_disk_new22m() returns a pointer to a newly-allocated struct
d191 1
a191 1
     1marchive_read_disk_gname22m() and 1marchive_read_disk_uname22m() return const char
d197 1
a197 1
1mERRORS0m
d199 1
a199 1
     1marchive_errno22m() and 1marchive_error_string22m() functions.
d201 1
a201 1
1mSEE ALSO0m
d205 3
a207 3
1mHISTORY0m
     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.  The
     1marchive_read_disk 22minterface was added to 1mlibarchive 2.6 22mand first
d210 2
a211 2
1mAUTHORS0m
     The 1mlibarchive 22mlibrary was written by Tim Kientzle
d214 1
a214 1
1mBUGS0m
d221 1
a221 1
     1marchive_read_disk_entry_from_file22m() is necessarily system-dependent.
d223 1
a223 1
     The 1marchive_read_disk_entry_from_file22m() function reads as much informa‐
d233 1
a233 1
BSD			       December 30, 2016			   BSD
@


1.3
log
@Update for libarchive 3.2.1.
@
text
@d3 8
a10 8
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
d13 1
a13 1
LIBRARY
d16 2
a17 2
SYNOPSIS
     #include <archive.h>
d19 2
a20 2
     struct archive *
     archive_read_disk_new(void);
d22 2
a23 2
     int
     archive_read_disk_set_symlink_logical(struct archive *);
d25 2
a26 2
     int
     archive_read_disk_set_symlink_physical(struct archive *);
d28 2
a29 2
     int
     archive_read_disk_set_symlink_hybrid(struct archive *);
d31 2
a32 2
     int
     archive_read_disk_gname(struct archive *, gid_t);
d34 2
a35 2
     int
     archive_read_disk_uname(struct archive *, uid_t);
d37 3
a39 3
     int
     archive_read_disk_set_gname_lookup(struct archive *, void *,
	 const char *(*lookup)(void *, gid_t), void (*cleanup)(void *));
d41 3
a43 3
     int
     archive_read_disk_set_uname_lookup(struct archive *, void *,
	 const char *(*lookup)(void *, uid_t), void (*cleanup)(void *));
d45 2
a46 2
     int
     archive_read_disk_set_standard_lookup(struct archive *);
d48 3
a50 3
     int
     archive_read_disk_entry_from_file(struct archive *,
	 struct archive_entry *, int fd, const struct stat *);
d52 2
a53 2
     int
     archive_read_close(struct archive *);
d55 2
a56 2
     int
     archive_read_finish(struct archive *);
d58 2
a59 2
     int
     archive_read_free(struct archive *);
d61 1
a61 1
DESCRIPTION
d66 1
a66 1
     archive_read_disk_new()
d70 3
a72 3
     archive_read_disk_set_symlink_logical(),
	     archive_read_disk_set_symlink_physical(),
	     archive_read_disk_set_symlink_hybrid()
d78 1
a78 1
     archive_read_disk_gname(), archive_read_disk_uname()
d82 2
a83 2
     archive_read_disk_set_gname_lookup(),
	     archive_read_disk_set_uname_lookup()
d90 1
a90 1
     archive_read_disk_set_standard_lookup()
d98 1
a98 1
     archive_read_disk_entry_from_file()
d122 1
a122 1
     archive_read_close()
d125 2
a126 2
     archive_read_finish()
	     This is a deprecated synonym for archive_read_free().
d128 2
a129 2
     archive_read_free()
	     Invokes archive_read_close() if it was not invoked manually, then
d131 1
a131 1
     More information about the struct archive object and the overall design
d134 1
a134 1
EXAMPLE
d163 2
a164 2
RETURN VALUES
     Most functions return ARCHIVE_OK (zero) on success, or one of several
d166 1
a166 1
     ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
d168 1
a168 1
     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
d171 1
a171 1
     archive_read_disk_new() returns a pointer to a newly-allocated struct
d174 1
a174 1
     archive_read_disk_gname() and archive_read_disk_uname() return const char
d180 1
a180 1
ERRORS
d182 1
a182 1
     archive_errno() and archive_error_string() functions.
d184 1
a184 1
SEE ALSO
d188 3
a190 3
HISTORY
     The libarchive library first appeared in FreeBSD 5.3.  The
     archive_read_disk interface was added to libarchive 2.6 and first
d193 2
a194 2
AUTHORS
     The libarchive library was written by Tim Kientzle
d197 1
a197 1
BUGS
d204 1
a204 1
     archive_read_disk_entry_from_file() is necessarily system-dependent.
d206 1
a206 1
     The archive_read_disk_entry_from_file() function reads as much informa‐
d216 1
a216 1
BSD			       February 2, 2012 			   BSD
@


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
@d195 1
a195 1
     ⟨kientzle@@FreeBSD.org⟩.
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
archive_read_disk(3)   FreeBSD Library Functions Manual   archive_read_disk(3)
d10 5
a14 1
     archive_read_finish -- functions for reading objects from disk
d58 3
d74 3
a76 3
	     ``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.
d92 5
a96 5
	     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 sim-
	     ple memory cache to reduce the number of calls to getpwid(3) and
	     getgrid(3).
d107 1
a107 1
	     information will be obtained using that file descriptor, on plat-
d114 1
a114 1
	     as a side effect of some other operation.	(For example, direc-
d123 1
a123 1
	     This currently does nothing.
d125 6
a130 3
     archive_write_finish()
	     Invokes archive_write_close() if it was not invoked manually,
	     then releases all resources.
d153 1
a153 1
	     archive_entry_copy_sourcepath(entry, name);
d159 1
a159 1
	     archive_read_finish(ard);
d168 2
a169 4
     ARCHIVE_FATAL for serious errors that make remaining operations impossi-
     ble.  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.)
d175 1
a175 1
     * pointers to the textual name or NULL if the lookup failed for any rea-
d180 4
d185 2
a186 2
     archive_read(3), archive_write(3), archive_write_disk(3), tar(1),
     libarchive(3)
d195 1
a195 1
     <kientzle@@freebsd.org>.
d198 2
a199 2
     The ``standard'' user name and group name lookup functions are not the
     defaults because getgrid(3) and getpwid(3) are sometimes too large for
d206 1
a206 1
     The archive_read_disk_entry_from_file() function reads as much informa-
d213 1
a213 1
     such methods are implemented, the ``hybrid'' symbolic link mode will make
d216 1
a216 1
FreeBSD 8.0			March 10, 2009			   FreeBSD 8.0
@


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
@libarchive-2.8.2:
- Fix NULL deference for short self-extracting zip archives
- Don't dereference symlinks on Linux when reading ACLs
- Better detection of SHA2 support for old OpenSSL versions
- Fix parsing of input files for bsdtar -T
- Do not leak setup_xattr into the global namespace
- Fix build when an older libarchive is already installed
- Use O_BINARY opening files in bsdtar
- Include missing archive_crc32.h
- Correctly include iconv.h required by libxml2
@
text
@d1 1
a1 1
archive_read_disk(3)	NetBSD Library Functions Manual	  archive_read_disk(3)
d87 1
a87 1
	     names cannot be looked up.	 These functions also implement a sim-
d204 1
a204 1
NetBSD 5.0			March 10, 2009			    NetBSD 5.0
@


1.1.1.3
log
@libarchive-2.8.3: Build fix for Linux
@
text
@d1 1
a1 1
archive_read_disk(3)   FreeBSD Library Functions Manual   archive_read_disk(3)
d87 1
a87 1
	     names cannot be looked up.  These functions also implement a sim-
d204 1
a204 1
FreeBSD 9.0			March 10, 2009			   FreeBSD 9.0
@


1.1.1.4
log
@Import libarchive-2.8.4:
- Improved reliability of hash function detection
- Fix issues on ancient FreeBSD, QNX, ancient NetBSD and Minix
@
text
@d1 1
a1 1
archive_read_disk(3)	NetBSD Library Functions Manual	  archive_read_disk(3)
d87 1
a87 1
	     names cannot be looked up.	 These functions also implement a sim-
d204 1
a204 1
NetBSD 5.0			March 10, 2009			    NetBSD 5.0
@


1.1.1.5
log
@Import libarchive-3.2.1:
- security fixes and other bugfixes
- support for multhreading in xz 5.2+
@
text
@d1 1
a1 1
ARCHIVE_READ_DISK(3)	 BSD Library Functions Manual	  ARCHIVE_READ_DISK(3)
d10 1
a10 5
     archive_read_finish, archive_read_free — functions for reading objects
     from disk

LIBRARY
     Streaming Archive Library (libarchive, -larchive)
a53 3
     int
     archive_read_free(struct archive *);

d67 3
a69 3
	     “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.
d85 5
a89 5
	     group name lookup functions.  These functions use getpwuid(3) and
	     getgrgid(3) to convert ids to names, defaulting to NULL if the
	     names cannot be looked up.  These functions also implement a sim‐
	     ple memory cache to reduce the number of calls to getpwuid(3) and
	     getgrgid(3).
d100 1
a100 1
	     information will be obtained using that file descriptor, on plat‐
d107 1
a107 1
	     as a side effect of some other operation.	(For example, direc‐
d116 1
a116 1
	     Does nothing for archive_read_disk handles.
d118 3
a120 6
     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.
d143 1
a143 1
	     archive_entry_copy_pathname(entry, name);
d149 1
a149 1
	     archive_read_free(ard);
d158 4
a161 2
     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
     ble.
d167 1
a167 1
     * pointers to the textual name or NULL if the lookup failed for any rea‐
a171 4
ERRORS
     Detailed error codes and textual descriptions are available from the
     archive_errno() and archive_error_string() functions.

d173 2
a174 2
     archive_read(3), archive_util(3), archive_write(3),
     archive_write_disk(3), tar(1), libarchive(3)
d183 1
a183 1
     <kientzle@@FreeBSD.org>.
d186 2
a187 2
     The “standard” user name and group name lookup functions are not the
     defaults because getgrgid(3) and getpwuid(3) are sometimes too large for
d194 1
a194 1
     The archive_read_disk_entry_from_file() function reads as much informa‐
d201 1
a201 1
     such methods are implemented, the “hybrid” symbolic link mode will make
d204 1
a204 1
BSD			       February 2, 2012 			   BSD
@


1.1.1.6
log
@Import libarchive-3.3.1.
@
text
@d3 8
a10 8
1mNAME0m
     1marchive_read_disk_new22m, 1marchive_read_disk_set_symlink_logical22m,
     1marchive_read_disk_set_symlink_physical22m,
     1marchive_read_disk_set_symlink_hybrid22m, 1marchive_read_disk_entry_from_file22m,
     1marchive_read_disk_gname22m, 1marchive_read_disk_uname22m,
     1marchive_read_disk_set_uname_lookup22m, 1marchive_read_disk_set_gname_lookup22m,
     1marchive_read_disk_set_standard_lookup22m, 1marchive_read_close22m,
     1marchive_read_finish22m, 1marchive_read_free 22m— functions for reading objects
d13 1
a13 1
1mLIBRARY0m
d16 2
a17 2
1mSYNOPSIS0m
     1m#include <archive.h>0m
d19 2
a20 2
     4mstruct24m 4marchive24m 4m*0m
     1marchive_read_disk_new22m(4mvoid24m);
d22 2
a23 2
     4mint0m
     1marchive_read_disk_set_symlink_logical22m(4mstruct24m 4marchive24m 4m*24m);
d25 2
a26 2
     4mint0m
     1marchive_read_disk_set_symlink_physical22m(4mstruct24m 4marchive24m 4m*24m);
d28 2
a29 2
     4mint0m
     1marchive_read_disk_set_symlink_hybrid22m(4mstruct24m 4marchive24m 4m*24m);
d31 2
a32 2
     4mconst24m 4mchar24m 4m*0m
     1marchive_read_disk_gname22m(4mstruct24m 4marchive24m 4m*24m, 4mgid_t24m);
d34 2
a35 2
     4mconst24m 4mchar24m 4m*0m
     1marchive_read_disk_uname22m(4mstruct24m 4marchive24m 4m*24m, 4muid_t24m);
d37 3
a39 3
     4mint0m
     1marchive_read_disk_set_gname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
	 4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4mgid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
d41 3
a43 3
     4mint0m
     1marchive_read_disk_set_uname_lookup22m(4mstruct24m 4marchive24m 4m*24m, 4mvoid24m 4m*24m,
	 4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4muid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);
d45 2
a46 2
     4mint0m
     1marchive_read_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);
d48 3
a50 3
     4mint0m
     1marchive_read_disk_entry_from_file22m(4mstruct24m 4marchive24m 4m*24m,
	 4mstruct24m 4marchive_entry24m 4m*24m, 4mint24m 4mfd24m, 4mconst24m 4mstruct24m 4mstat24m 4m*24m);
d52 2
a53 2
     4mint0m
     1marchive_read_close22m(4mstruct24m 4marchive24m 4m*24m);
d55 2
a56 2
     4mint0m
     1marchive_read_finish22m(4mstruct24m 4marchive24m 4m*24m);
d58 2
a59 2
     4mint0m
     1marchive_read_free22m(4mstruct24m 4marchive24m 4m*24m);
d61 1
a61 1
1mDESCRIPTION0m
d66 1
a66 1
     1marchive_read_disk_new22m()
d70 3
a72 3
     1marchive_read_disk_set_symlink_logical22m(),
	     1marchive_read_disk_set_symlink_physical22m(),
	     1marchive_read_disk_set_symlink_hybrid22m()
d78 1
a78 1
     1marchive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
d82 2
a83 2
     1marchive_read_disk_set_gname_lookup22m(),
	     1marchive_read_disk_set_uname_lookup22m()
d90 1
a90 1
     1marchive_read_disk_set_standard_lookup22m()
d98 1
a98 1
     1marchive_read_disk_entry_from_file22m()
d122 1
a122 1
     1marchive_read_close22m()
d125 2
a126 2
     1marchive_read_finish22m()
	     This is a deprecated synonym for 1marchive_read_free22m().
d128 2
a129 2
     1marchive_read_free22m()
	     Invokes 1marchive_read_close22m() if it was not invoked manually, then
d131 1
a131 1
     More information about the 4mstruct24m 4marchive24m object and the overall design
d134 1
a134 1
1mEXAMPLE0m
d163 2
a164 2
1mRETURN VALUES0m
     Most functions return 1mARCHIVE_OK 22m(zero) on success, or one of several
d166 1
a166 1
     1mARCHIVE_RETRY 22mfor operations that might succeed if retried, 1mARCHIVE_WARN0m
d168 1
a168 1
     1mARCHIVE_FATAL 22mfor serious errors that make remaining operations impossi‐
d171 1
a171 1
     1marchive_read_disk_new22m() returns a pointer to a newly-allocated struct
d174 1
a174 1
     1marchive_read_disk_gname22m() and 1marchive_read_disk_uname22m() return const char
d180 1
a180 1
1mERRORS0m
d182 1
a182 1
     1marchive_errno22m() and 1marchive_error_string22m() functions.
d184 1
a184 1
1mSEE ALSO0m
d188 3
a190 3
1mHISTORY0m
     The 1mlibarchive 22mlibrary first appeared in FreeBSD 5.3.  The
     1marchive_read_disk 22minterface was added to 1mlibarchive 2.6 22mand first
d193 2
a194 2
1mAUTHORS0m
     The 1mlibarchive 22mlibrary was written by Tim Kientzle
d197 1
a197 1
1mBUGS0m
d204 1
a204 1
     1marchive_read_disk_entry_from_file22m() is necessarily system-dependent.
d206 1
a206 1
     The 1marchive_read_disk_entry_from_file22m() function reads as much informa‐
d216 1
a216 1
BSD			       December 30, 2016			   BSD
@


1.1.1.7
log
@Import libarchive-3.3.2 + 9de5f3 + f9dacbf:
- Support NFS4 ACLs on Linux
- Bugfixes
@
text
@d3 8
a10 8
NAME
     archive_read_disk_new, 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 — functions for reading objects
d13 1
a13 1
LIBRARY
d16 2
a17 2
SYNOPSIS
     #include <archive.h>
d19 2
a20 2
     struct archive *
     archive_read_disk_new(void);
d22 2
a23 2
     int
     archive_read_disk_set_behavior(struct archive *, int);
d25 2
a26 2
     int
     archive_read_disk_set_symlink_logical(struct archive *);
d28 2
a29 2
     int
     archive_read_disk_set_symlink_physical(struct archive *);
d31 2
a32 2
     int
     archive_read_disk_set_symlink_hybrid(struct archive *);
d34 2
a35 2
     const char *
     archive_read_disk_gname(struct archive *, gid_t);
d37 3
a39 2
     const char *
     archive_read_disk_uname(struct archive *, uid_t);
d41 3
a43 3
     int
     archive_read_disk_set_gname_lookup(struct archive *, void *,
	 const char *(*lookup)(void *, gid_t), void (*cleanup)(void *));
d45 2
a46 3
     int
     archive_read_disk_set_uname_lookup(struct archive *, void *,
	 const char *(*lookup)(void *, uid_t), void (*cleanup)(void *));
d48 3
a50 2
     int
     archive_read_disk_set_standard_lookup(struct archive *);
d52 2
a53 3
     int
     archive_read_disk_entry_from_file(struct archive *,
	 struct archive_entry *, int fd, const struct stat *);
d55 7
a61 1
DESCRIPTION
d66 1
a66 1
     archive_read_disk_new()
d70 3
a72 36
     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).  By default, metadata is
		     read using copyfile(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)
		     (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor‐
		     mation 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) (Linux), xattr(2) (Mac OS X), or
		     getextattr(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_read_disk_set_symlink_logical(),
	     archive_read_disk_set_symlink_physical(),
	     archive_read_disk_set_symlink_hybrid()
d78 1
a78 1
     archive_read_disk_gname(), archive_read_disk_uname()
d82 2
a83 2
     archive_read_disk_set_gname_lookup(),
	     archive_read_disk_set_uname_lookup()
d90 1
a90 1
     archive_read_disk_set_standard_lookup()
d98 1
a98 1
     archive_read_disk_entry_from_file()
d121 11
a131 1
     More information about the struct archive object and the overall design
d134 1
a134 1
EXAMPLE
d163 2
a164 2
RETURN VALUES
     Most functions return ARCHIVE_OK (zero) on success, or one of several
d166 1
a166 1
     ARCHIVE_RETRY for operations that might succeed if retried, ARCHIVE_WARN
d168 1
a168 1
     ARCHIVE_FATAL for serious errors that make remaining operations impossi‐
d171 1
a171 1
     archive_read_disk_new() returns a pointer to a newly-allocated struct
d174 1
a174 1
     archive_read_disk_gname() and archive_read_disk_uname() return const char
d180 1
a180 1
ERRORS
d182 1
a182 1
     archive_errno() and archive_error_string() functions.
d184 1
a184 1
SEE ALSO
d188 3
a190 3
HISTORY
     The libarchive library first appeared in FreeBSD 5.3.  The
     archive_read_disk interface was added to libarchive 2.6 and first
d193 2
a194 2
AUTHORS
     The libarchive library was written by Tim Kientzle
d197 1
a197 1
BUGS
d204 1
a204 1
     archive_read_disk_entry_from_file() is necessarily system-dependent.
d206 1
a206 1
     The archive_read_disk_entry_from_file() function reads as much informa‐
d216 1
a216 1
BSD				 April 3, 2017				   BSD
@


1.1.1.8
log
@Import libarchive 3.4.0
@
text
@d73 3
a75 3
		     Mac OS X specific. Read metadata (ACLs and extended at‐
		     tributes) with copyfile(3).  By default, metadata is read
		     using copyfile(3).
d88 5
a92 5
		     Do not read extended file attributes (xattrs).  By de‐
		     fault, extended file attributes are read from disk.  See
		     xattr(7) (Linux), xattr(2) (Mac OS X), or getextattr(8)
		     (FreeBSD) for more information on extended file at‐
		     tributes.
d94 2
a95 2
		     Restore access time of traversed files.  By default, ac‐
		     cess time of traversed files is not restored.
d106 2
a107 2
	     Returns a user or group name given a gid or uid value.  By de‐
	     fault, these always return a NULL string.
d114 2
a115 2
	     function will be invoked when the struct archive object is de‐
	     stroyed or when new lookup functions are registered.
d133 2
a134 2
	     archive_entry object.  If a file descriptor is provided, some in‐
	     formation will be obtained using that file descriptor, on plat‐
d138 2
a139 2
	     structure will be used instead of reading from the disk where ap‐
	     propriate.  This can provide performance benefits in scenarios
d207 2
a208 2
     archive_read_disk interface was added to libarchive 2.6 and first ap‐
     peared in FreeBSD 8.0.
d215 4
a218 4
     The “standard” user name and group name lookup functions are not the de‐
     faults because getgrgid(3) and getpwuid(3) are sometimes too large for
     particular applications.  The current design allows the application au‐
     thor to use a more compact implementation when appropriate.
@


1.1.1.9
log
@Import libarchive 3.7.2
@
text
@d4 2
a5 2
     archive_read_disk_new, archive_read_disk_open, archive_read_disk_open_w,
     archive_read_disk_set_behavior, archive_read_disk_set_symlink_logical,
d10 2
a11 7
     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
a22 6
     archive_read_disk_open(struct archive *, const char *);

     int
     archive_read_disk_open_w(struct archive *, const wchar_t *);

     int
a54 25
     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 *);

a63 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 charac‐
	     ter string and prepares the struct archive to read it from disk.

d70 1
a70 1
		     (file flag) set.  By default, the nodump file attribute
d73 1
a73 1
		     Mac OS X specific.	 Read metadata (ACLs and extended at‐
d85 1
a85 1
		     Do not traverse mount points.  By default, mount points
a95 3
	     ARCHIVE_READDISK_NO_SPARSE
		     Do not read sparse file information.  By default, sparse
		     file information is read from disk.
d101 1
a101 1
	     “logical” mode follows all symbolic links.	 The “physical” mode
d121 1
a121 1
	     names cannot be looked up.	 These functions also implement a sim‐
d139 1
a139 1
	     propriate.	 This can provide performance benefits in scenarios
d145 1
a145 1
	     group names using the currently-registered lookup functions
a147 40

     archive_read_disk_descend()
	     If the current entry can be descended, this function will mark
	     the directory as the next entry for archive_read_header(3) 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. Re‐
	     turns 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. Re‐
	     turns 0 if the current filesystem is not a remote filesystem. Re‐
	     turns -1 if it is unknown.

     archive_read_disk_set_matching()
	     Allows the caller to set struct archive *_ma to compare each en‐
	     try during archive_read_header(3) 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 param‐
	     eter 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
	     archive_read_header(3) to filter out metadata for each entry. The
	     callback function recieves the struct archive object, void* cus‐
	     tom 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.
d151 1
a151 1
EXAMPLES
d202 2
a203 2
     tar(1), archive_read(3), archive_util(3), archive_write(3),
     archive_write_disk(3), libarchive(3)
@


1.1.1.10
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
@d225 1
a225 1
	     eter will execute. This function will receive data provided to
d231 1
a231 1
	     callback function receives the struct archive object, void* cus‐
@


1.1.1.11
log
@libarchove: import version 3.7.7
@
text
@d1 1
a1 1
4mARCHIVE_READ_DISK24m(3)	 Library Functions Manual      4mARCHIVE_READ_DISK24m(3)
d3 316
a318 321
1mNAME0m
       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

1mLIBRARY0m
       Streaming Archive Library (libarchive, -larchive)

1mSYNOPSIS0m
       1m#include <archive.h>0m

       4mstruct24m 4marchive24m 4m*0m
       1marchive_read_disk_new22m(4mvoid24m);

       4mint0m
       1marchive_read_disk_open22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mchar24m 4m*24m);

       4mint0m
       1marchive_read_disk_open_w22m(4mstruct24m 4marchive24m 4m*24m, 4mconst24m 4mwchar_t24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_behavior22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);

       4mint0m
       1marchive_read_disk_set_symlink_logical22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_symlink_physical22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_symlink_hybrid22m(4mstruct24m 4marchive24m 4m*24m);

       4mconst24m 4mchar24m 4m*0m
       1marchive_read_disk_gname22m(4mstruct24m 4marchive24m 4m*24m, 4mgid_t24m);

       4mconst24m 4mchar24m 4m*0m
       1marchive_read_disk_uname22m(4mstruct24m 4marchive24m 4m*24m, 4muid_t24m);

       4mint0m
       1marchive_read_disk_set_gname_lookup22m(4mstruct24m 4marchive24m 4m*24m,		   4mvoid24m 4m*24m,
	   4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4mgid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);

       4mint0m
       1marchive_read_disk_set_uname_lookup22m(4mstruct24m 4marchive24m 4m*24m,		   4mvoid24m 4m*24m,
	   4mconst24m 4mchar24m 4m*(*lookup)(void24m 4m*,24m 4muid_t)24m, 4mvoid24m 4m(*cleanup)(void24m 4m*)24m);

       4mint0m
       1marchive_read_disk_set_standard_lookup22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_entry_from_file22m(4mstruct24m 4marchive24m 4m*24m,
	   4mstruct24m 4marchive_entry24m 4m*24m, 4mint24m 4mfd24m, 4mconst24m 4mstruct24m 4mstat24m 4m*24m);

       4mint0m
       1marchive_read_disk_descend22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_can_descend22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem_is_synthetic22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_current_filesystem_is_remote22m(4mstruct24m 4marchive24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_matching22m(4mstruct24m 4marchive24m 4m*24m,	 4mstruct24m 4marchive24m 4m*24m,
	   4mvoid24m 4m(*excluded_func)(struct24m 4marchive24m 4m*,24m 4mvoid24m 4m*,24m 4mstruct24m 4marchive24m 4mentry24m 4m*)24m,
	   4mvoid24m 4m*24m);

       4mint0m
       1marchive_read_disk_set_metadata_filter_callback22m(4mstruct24m 4marchive24m 4m*24m,
	   4mint24m 4m(*metadata_filter_func)(struct24m 4marchive24m 4m*,24m 4mvoid*,24m 4mstruct24m 4marchive_entry24m 4m*)24m,
	   4mvoid24m 4m*24m);

1mDESCRIPTION0m
       These functions provide an API for reading information about objects on
       disk.  In particular, they provide an interface for  populating	struct
       archive_entry objects.

       1marchive_read_disk_new22m()
	       Allocates  and initializes a struct archive object suitable for
	       reading object information from disk.

       1marchive_read_disk_open22m()
	       Opens the file or directory from the given  path	 and  prepares
	       the struct archive to read it from disk.

       1marchive_read_disk_open_w22m()
	       Opens the file or directory from the given path as a wide char‐
	       acter  string  and  prepares the struct archive to read it from
	       disk.

       1marchive_read_disk_set_behavior22m()
	       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:
	       1mARCHIVE_READDISK_HONOR_NODUMP0m
		       Skip files and directories with	the  nodump  file  at‐
		       tribute	(file  flag) set.  By default, the nodump file
		       attribute is ignored.
	       1mARCHIVE_READDISK_MAC_COPYFILE0m
		       Mac OS X specific.  Read metadata  (ACLs	 and  extended
		       attributes)  with 4mcopyfile24m(3).  By default, metadata is
		       read using 4mcopyfile24m(3).
	       1mARCHIVE_READDISK_NO_ACL0m
		       Do not read Access Control Lists.  By default, ACLs are
		       read from disk.
	       1mARCHIVE_READDISK_NO_FFLAGS0m
		       Do not read file attributes (file flags).  By  default,
		       file  attributes	 are  read  from  disk.	 See 4mchattr24m(1)
		       (Linux) or 4mchflags24m(1) (FreeBSD, Mac OS X) for more	in‐
		       formation on file attributes.
	       1mARCHIVE_READDISK_NO_TRAVERSE_MOUNTS0m
		       Do not traverse mount points.  By default, mount points
		       are traversed.
	       1mARCHIVE_READDISK_NO_XATTR0m
		       Do  not read extended file attributes (xattrs).	By de‐
		       fault, extended file attributes	are  read  from	 disk.
		       See   4mxattr24m(7)   (Linux),	4mxattr24m(2)  (Mac  OS	 X),  or
		       4mgetextattr24m(8) (FreeBSD) for	 more  information  on	ex‐
		       tended file attributes.
	       1mARCHIVE_READDISK_RESTORE_ATIME0m
		       Restore	access	time  of traversed files.  By default,
		       access time of traversed files is not restored.
	       1mARCHIVE_READDISK_NO_SPARSE0m
		       Do not  read  sparse  file  information.	  By  default,
		       sparse file information is read from disk.

       1marchive_read_disk_set_symlink_logical22m(),
	       1marchive_read_disk_set_symlink_physical22m(),
	       1marchive_read_disk_set_symlink_hybrid22m()
	       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  cur‐
	       rently behaves identically to the “logical” mode.

       1marchive_read_disk_gname22m(), 1marchive_read_disk_uname22m()
	       Returns	a user or group name given a gid or uid value.	By de‐
	       fault, these always return a NULL string.

       1marchive_read_disk_set_gname_lookup22m(),
	       1marchive_read_disk_set_uname_lookup22m()
	       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 regis‐
	       tered.

       1marchive_read_disk_set_standard_lookup22m()
	       This convenience function installs a standard set of  user  and
	       group  name  lookup functions.  These functions use 4mgetpwuid24m(3)
	       and 4mgetgrgid24m(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
	       4mgetpwuid24m(3) and 4mgetgrgid24m(3).

       1marchive_read_disk_entry_from_file22m()
	       Populates  a struct archive_entry object with information about
	       a particular file.  The archive_entry object must have  already
	       been  created with 4marchive_entry_new24m(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.)

	       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  in‐
	       formation.)

	       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.

       1marchive_read_disk_descend22m()
	       If the current entry can be descended, this function will  mark
	       the  directory  as the next entry for 4marchive_read_header24m(3) to
	       visit.

       1marchive_read_disk_can_descend22m()
	       Returns 1 if the current entry is an unvisited directory and  0
	       otherwise.

       1marchive_read_disk_current_filesystem22m()
	       Returns	the index of the most recent filesystem entry that has
	       been visited through archive_read_disk

       1marchive_read_disk_current_filesystem_is_synthetic22m()
	       Returns 1 if the current filesystem is  a  virtual  filesystem.
	       Returns	0  if the current filesystem is not a virtual filesys‐
	       tem. Returns -1 if it is unknown.

       1marchive_read_disk_current_filesystem_is_remote22m()
	       Returns 1 if the current filesystem is a remote filesystem. Re‐
	       turns 0 if the current filesystem is not a  remote  filesystem.
	       Returns -1 if it is unknown.

       1marchive_read_disk_set_matching22m()
	       Allows  the  caller  to set struct archive *_ma to compare each
	       entry during 4marchive_read_header24m(3) 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 pa‐
	       rameter will execute. This function will receive data  provided
	       to the fourth parameter, void *_client_data.

       1marchive_read_disk_set_metadata_filter_callback22m()
	       Allows  the  caller  to set a callback function during calls to
	       4marchive_read_header24m(3) 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 call‐
	       back  function returns an error, ARCHIVE_RETRY will be returned
	       and the entry will not be further processed.
       More information about the 4mstruct24m 4marchive24m object and the overall design
       of the library can be found in the 4mlibarchive24m(3) overview.

1mEXAMPLES0m
       The following illustrates basic usage of the library by showing how  to
       use it to copy an item on disk into an archive.

	     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;

	       ard = archive_read_disk_new();
	       archive_read_disk_set_standard_lookup(ard);
	       entry = archive_entry_new();
	       fd = open(name, O_RDONLY);
	       if (fd < 0)
		  return;
	       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);
	     }

1mRETURN VALUES0m
       Most  functions	return 1mARCHIVE_OK 22m(zero) on success, or one of several
       negative	 error	codes  for  errors.   Specific	error  codes  include:
       1mARCHIVE_RETRY	 22mfor	  operations   that   might   succeed  if  retried,
       1mARCHIVE_WARN 22mfor unusual conditions that do not prevent further  opera‐
       tions,  and 1mARCHIVE_FATAL 22mfor serious errors that make remaining opera‐
       tions impossible.

       1marchive_read_disk_new22m() returns a pointer to a  newly-allocated  struct
       archive object or NULL if the allocation failed for any reason.

       1marchive_read_disk_gname22m()  and  1marchive_read_disk_uname22m()  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.

1mERRORS0m
       Detailed error codes and textual descriptions are  available  from  the
       1marchive_errno22m() and 1marchive_error_string22m() functions.

1mSEE ALSO0m
       4mtar24m(1),	4marchive_read24m(3),	  4marchive_util24m(3),	    4marchive_write24m(3),
       4marchive_write_disk24m(3), 4mlibarchive24m(3)

1mHISTORY0m
       The  1mlibarchive  22mlibrary  first   appeared	 in   FreeBSD	5.3.	The
       1marchive_read_disk  22minterface  was added to 1mlibarchive 2.6 22mand first ap‐
       peared in FreeBSD 8.0.

1mAUTHORS0m
       The    1mlibarchive    22mlibrary    was	   written    by    Tim	   Kientzle
       <kientzle@@FreeBSD.org>.

1mBUGS0m
       The  “standard”	user  name and group name lookup functions are not the
       defaults because 4mgetgrgid24m(3) and 4mgetpwuid24m(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
       1marchive_read_disk_entry_from_file22m() is necessarily system-dependent.

       The 1marchive_read_disk_entry_from_file22m() function reads as much informa‐
       tion 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 4marchive_read24m(3) API.  When
       such methods are implemented, the “hybrid” symbolic link mode will make
       sense.
d320 1
a320 1
Debian				 April 3, 2017		  4mARCHIVE_READ_DISK24m(3)
@


1.1.1.12
log
@libarchive: import version 3.8.10
@
text
@d151 3
a153 8
	       “logical” mode follows all symbolic links, except that  a  sym‐
	       bolic 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	     1marchive_read_disk_open22m()	 or
	       1marchive_read_disk_open_w22m()	but  does not follow symbolic links
	       anywhere else.
d156 1
a156 1
	       Returns a user or group name given a gid or uid value.  By  de‐
d161 1
a161 1
	       These  allow  you  to  override the functions used for user and
d163 3
a165 3
	       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	regis‐
d169 5
a173 5
	       This  convenience  function installs a standard set of user and
	       group name lookup functions.  These functions  use  4mgetpwuid24m(3)
	       and  4mgetgrgid24m(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
d177 4
a180 4
	       Populates a struct archive_entry object with information	 about
	       a  particular file.  The archive_entry object must have already
	       been created with 4marchive_entry_new24m(3) and at least one of	the
	       source  path  or path fields must already be set.  (If both are
d183 1
a183 1
	       Information is read from disk using  the	 path  name  from  the
d185 1
a185 1
	       some  information  will be obtained using that file descriptor,
d188 6
a193 6
	       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 in‐
d196 3
a198 3
	       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
d202 2
a203 2
	       If  the current entry can be descended, this function will mark
	       the directory as the next entry for  4marchive_read_header24m(3)	 to
d207 1
a207 1
	       Returns	1 if the current entry is an unvisited directory and 0
d211 2
a212 2
	       Returns the index of the most recent filesystem entry that  has
	       been visited through archive_read_disk.
d215 2
a216 2
	       Returns	1  if  the current filesystem is a virtual filesystem.
	       Returns 0 if the current filesystem is not a  virtual  filesys‐
d221 1
a221 1
	       turns  0	 if the current filesystem is not a remote filesystem.
d225 2
a226 2
	       Allows the caller to set struct archive *_ma  to	 compare  each
	       entry  during 4marchive_read_header24m(3) calls. If matched based on
d229 2
a230 2
	       then the callback function specified by the _excluded_func  pa‐
	       rameter	will execute. This function will receive data provided
d234 2
a235 2
	       Allows the caller to set a callback function  during  calls  to
	       4marchive_read_header24m(3)  to	filter out metadata for each entry.
d238 1
a238 1
	       back function returns an error, ARCHIVE_RETRY will be  returned
d244 1
a244 1
       The  following illustrates basic usage of the library by showing how to
a255 3
	       fd = open(name, O_RDONLY);
	       if (fd < 0)
		 return;
d259 3
d273 1
a273 1
       Most functions return 1mARCHIVE_OK 22m(zero) on success, or one	of  several
d275 3
a277 3
       1mARCHIVE_RETRY	22mfor	operations   that   might   succeed   if   retried,
       1mARCHIVE_WARN  22mfor unusual conditions that do not prevent further opera‐
       tions, and 1mARCHIVE_FATAL 22mfor serious errors that make remaining  opera‐
d280 1
a280 1
       1marchive_read_disk_new22m()  returns  a pointer to a newly-allocated struct
d283 3
a285 3
       1marchive_read_disk_gname22m() and  1marchive_read_disk_uname22m()  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
d290 1
a290 1
       Detailed	 error	codes  and textual descriptions are available from the
d298 2
a299 2
       The   1mlibarchive   22mlibrary	 first	 appeared   in	FreeBSD	 5.3.	The
       1marchive_read_disk 22minterface was added to 1mlibarchive 2.6 22mand  first  ap‐
d307 2
a308 2
       The “standard” user name and group name lookup functions	 are  not  the
       defaults	 because  4mgetgrgid24m(3)  and 4mgetpwuid24m(3) are sometimes too large
d312 1
a312 1
       The    full    list    of    metadata	 read	  from	   disk	    by
d320 2
a321 2
       This  API should provide a set of methods for walking a directory tree.
       That would make it a direct parallel of the 4marchive_read24m(3) API.   When
@


