Blame doc/text/archive_entry_perms.3.txt

Packit 08bd4c
ARCHIVE_ENTRY_PERMS(3)	 BSD Library Functions Manual	ARCHIVE_ENTRY_PERMS(3)
Packit 08bd4c
Packit 08bd4c
NAME
Packit 08bd4c
     archive_entry_gid, archive_entry_set_gid, archive_entry_uid,
Packit 08bd4c
     archive_entry_set_uid, archive_entry_perm, archive_entry_set_perm,
Packit 08bd4c
     archive_entry_strmode, archive_entry_uname, archive_entry_uname_w,
Packit 08bd4c
     archive_entry_set_uname, archive_entry_copy_uname,
Packit 08bd4c
     archive_entry_copy_uname_w, archive_entry_update_uname_utf8,
Packit 08bd4c
     archive_entry_gname, archive_entry_gname_w, archive_entry_set_gname,
Packit 08bd4c
     archive_entry_copy_gname, archive_entry_copy_gname_w,
Packit 08bd4c
     archive_entry_update_gname_utf8, archive_entry_fflags,
Packit 08bd4c
     archive_entry_fflags_text, archive_entry_set_fflags,
Packit 08bd4c
     archive_entry_copy_fflags_text, archive_entry_copy_fflags_text_w — func‐
Packit 08bd4c
     tions for manipulating ownership and permissions in archive entry
Packit 08bd4c
     descriptions
Packit 08bd4c
Packit 08bd4c
LIBRARY
Packit 08bd4c
     Streaming Archive Library (libarchive, -larchive)
Packit 08bd4c
Packit 08bd4c
SYNOPSIS
Packit 08bd4c
     #include <archive_entry.h>
Packit 08bd4c
Packit 08bd4c
     gid_t
Packit 08bd4c
     archive_entry_gid(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_gid(struct archive_entry *a, gid_t gid);
Packit 08bd4c
Packit 08bd4c
     uid_t
Packit 08bd4c
     archive_entry_uid(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_uid(struct archive_entry *a, uid_t uid);
Packit 08bd4c
Packit 08bd4c
     mode_t
Packit 08bd4c
     archive_entry_perm(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_perm(struct archive_entry *a, mode_t mode);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_entry_strmode(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_entry_gname(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     const wchar_t *
Packit 08bd4c
     archive_entry_gname_w(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_gname(struct archive_entry *a, const char *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_copy_gname(struct archive_entry *a, const char *name);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_copy_gname_w(struct archive_entry *a, const wchar_t *name);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_entry_update_gname_utf8(struct archive_entry *a,
Packit 08bd4c
	 const char *name);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_entry_uname(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     const wchar_t *
Packit 08bd4c
     archive_entry_uname_w(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_uname(struct archive_entry *a, const char *name);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_copy_uname(struct archive_entry *a, const char *name);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_copy_uname_w(struct archive_entry *a, const wchar_t *name);
Packit 08bd4c
Packit 08bd4c
     int
Packit 08bd4c
     archive_entry_update_uname_utf8(struct archive_entry *a,
Packit 08bd4c
	 const char *name);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_fflags(struct archive_entry *a, unsigned long *set_bits,
Packit 08bd4c
	 unsigned long *clear_bits);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_entry_fflags_text(struct archive_entry *a);
Packit 08bd4c
Packit 08bd4c
     void
Packit 08bd4c
     archive_entry_set_fflags(struct archive_entry *a, unsigned long set_bits,
Packit 08bd4c
	 unsigned long clear_bits);
Packit 08bd4c
Packit 08bd4c
     const char *
Packit 08bd4c
     archive_entry_copy_fflags_text(struct archive_entry *a,
Packit 08bd4c
	 const char *text);
Packit 08bd4c
Packit 08bd4c
     const wchar_t *
Packit 08bd4c
     archive_entry_copy_fflags_text_w(struct archive_entry *a,
Packit 08bd4c
	 const wchar_t *text);
Packit 08bd4c
Packit 08bd4c
DESCRIPTION
Packit 08bd4c
   User id, group id and mode
Packit 08bd4c
     The functions archive_entry_uid(), archive_entry_gid(), and
Packit 08bd4c
     archive_entry_perm() can be used to extract the user id, group id and
Packit 08bd4c
     permission from the given entry.  The corresponding functions
Packit 08bd4c
     archive_entry_set_uid(), archive_entry_set_gid(), and
Packit 08bd4c
     archive_entry_set_perm() store the given user id, group id and permission
Packit 08bd4c
     in the entry.  The permission is also set as side effect of calling
Packit 08bd4c
     archive_entry_set_mode().
Packit 08bd4c
Packit 08bd4c
     archive_entry_strmode() returns a string representation of the permission
Packit 08bd4c
     as used by the long mode of ls(1).
Packit 08bd4c
Packit 08bd4c
   User and group name
Packit 08bd4c
     User and group names can be provided in one of three different ways:
Packit 08bd4c
Packit 08bd4c
     char *	Multibyte strings in the current locale.
Packit 08bd4c
Packit 08bd4c
     wchar_t *	Wide character strings in the current locale.  The accessor
Packit 08bd4c
		functions are named XXX_w().
Packit 08bd4c
Packit 08bd4c
     UTF-8	Unicode strings encoded as UTF-8.  This are convience func‐
Packit 08bd4c
		tions to update both the multibyte and wide character strings
Packit 08bd4c
		at the same time.
Packit 08bd4c
Packit 08bd4c
     archive_entry_set_XXX() is an alias for archive_entry_copy_XXX().
Packit 08bd4c
Packit 08bd4c
   File Flags
Packit 08bd4c
     File flags are transparently converted between a bitmap representation
Packit 08bd4c
     and a textual format.  For example, if you set the bitmap and ask for
Packit 08bd4c
     text, the library will build a canonical text format.  However, if you
Packit 08bd4c
     set a text format and request a text format, you will get back the same
Packit 08bd4c
     text, even if it is ill-formed.  If you need to canonicalize a textual
Packit 08bd4c
     flags string, you should first set the text form, then request the bitmap
Packit 08bd4c
     form, then use that to set the bitmap form.  Setting the bitmap format
Packit 08bd4c
     will clear the internal text representation and force it to be recon‐
Packit 08bd4c
     structed when you next request the text form.
Packit 08bd4c
Packit 08bd4c
     The bitmap format consists of two integers, one containing bits that
Packit 08bd4c
     should be set, the other specifying bits that should be cleared.  Bits
Packit 08bd4c
     not mentioned in either bitmap will be ignored.  Usually, the bitmap of
Packit 08bd4c
     bits to be cleared will be set to zero.  In unusual circumstances, you
Packit 08bd4c
     can force a fully-specified set of file flags by setting the bitmap of
Packit 08bd4c
     flags to clear to the complement of the bitmap of flags to set.  (This
Packit 08bd4c
     differs from fflagstostr(3), which only includes names for set bits.)
Packit 08bd4c
     Converting a bitmap to a textual string is a platform-specific operation;
Packit 08bd4c
     bits that are not meaningful on the current platform will be ignored.
Packit 08bd4c
Packit 08bd4c
     The canonical text format is a comma-separated list of flag names.  The
Packit 08bd4c
     archive_entry_copy_fflags_text() and archive_entry_copy_fflags_text_w()
Packit 08bd4c
     functions parse the provided text and sets the internal bitmap values.
Packit 08bd4c
     This is a platform-specific operation; names that are not meaningful on
Packit 08bd4c
     the current platform will be ignored.  The function returns a pointer to
Packit 08bd4c
     the start of the first name that was not recognized, or NULL if every
Packit 08bd4c
     name was recognized.  Note that every name — including names that follow
Packit 08bd4c
     an unrecognized name — will be evaluated, and the bitmaps will be set to
Packit 08bd4c
     reflect every name that is recognized.  (In particular, this differs from
Packit 08bd4c
     strtofflags(3), which stops parsing at the first unrecognized name.)
Packit 08bd4c
Packit 08bd4c
SEE ALSO
Packit 08bd4c
     archive_entry(3), archive_entry_acl(3), archive_read_disk(3),
Packit 08bd4c
     archive_write_disk(3) libarchive(3),
Packit 08bd4c
Packit 08bd4c
BUGS
Packit 08bd4c
     The platform types uid_t and gid_t are often 16 or 32 bit wide.  In this
Packit 08bd4c
     case it is possible that the ids can not be correctly restored from ar‐
Packit 08bd4c
     chives and get truncated.
Packit 08bd4c
Packit 08bd4c
BSD			       February 2, 2012 			   BSD