Manpages - archive_entry_acl.3

Streaming Archive Library (libarchive, -larchive)

The

extend the standard Unix permission model. The ACL interface of

supports both POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by various levels of ACL support in operating systems, file systems and archive formats.

A POSIX.1e ACL consists of a number of independent entries. Each entry specifies the permission set as a bitmask of basic permissions. Valid permissions in the

are:

The permissions correspond to the normal Unix permissions.

The

specifies the principal to which the permission applies. Valid values are:

The user specified by the name field.

The owner of the file.

The group specified by the name field.

The group which owns the file.

The maximum permissions to be obtained via group permissions.

Any principal who is not the file owner or a member of the owning group.

The principals

and

are equivalent to user, group and other in the classic Unix permission model and specify non-extended ACL entries.

All files have an access ACL

This specifies the permissions required for access to the file itself. Directories have an additional ACL

which controls the initial access ACL for newly-created directory entries.

A NFSv4 ACL consists of multiple individual entries called Access Control Entries (ACEs).

There are four possible types of a NFSv4 ACE:

Allow principal to perform actions requiring given permissions.

Prevent principal from performing actions requiring given permissions.

Log access attempts by principal which require given permissions.

Trigger a system alarm on access attempts by principal which require given permissions.

The

specifies the principal to which the permission applies. Valid values are:

The user specified by the name field.

The owner of the file.

The group specified by the name field.

The group which owns the file.

Any principal who is not the file owner or a member of the owning group.

Entries with the

or

tag store the user and group name in the

string and optionally the user or group ID in the

integer.

NFSv4 ACE permissions and flags are stored in the same

bitfield. Some permissions share the same constant and permission character but have different effect on directories than on files. The following ACE permissions are supported:

Read data (file).

List entries (directory).

Write data (file).

Create files (directory).

Execute file or change into a directory.

Append data (file).

Create subdirectories (directory).

Remove files and subdirectories inside a directory.

Remove file or directory.

Read file or directory attributes.

Write file or directory attributes.

Read named file or directory attributes.

Write named file or directory attributes.

Read file or directory ACL.

Write file or directory ACL.

Change owner of a file or directory.

Use synchronous I/O.

The following NFSv4 ACL inheritance flags are supported:

Inherit parent directory ACE to files.

Inherit parent directory ACE to subdirectories.

Only inherit, do not apply the permission on the directory itself.

Do not propagate inherit flags. Only first-level entries inherit ACLs.

Trigger alarm or audit on successful access.

Trigger alarm or audit on failed access.

Mark that ACE was inherited.

and

add a single ACL entry. For the access ACL and non-extended principals, the classic Unix permissions are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL entries.

removes all ACL entries and resets the enumeration pointer.

counts the ACL entries that have the given type mask.

can be the bitwise-or of

for POSIX.1e ACLs and

for NFSv4 ACLs. For POSIX.1e ACLs if

is included and at least one extended ACL entry is found, the three non-extended ACLs are added.

and

add new

ACL entries from

text. The argument

may take one of the following values:

Supports all formats that can be created with

or respectively

Existing ACL entries are preserved. To get a clean new ACL from text

must be called first. Entries prefixed with

are treated as

unless

is

Invalid entries, non-parseable ACL entries and entries beginning with the

character

are skipped.

return the next entry of the ACL list. This functions may only be called after

has indicated the presence of extended ACL entries.

prepare reading the list of ACL entries with

The function returns 0 if no non-extended ACLs are found. In this case, the access permissions should be obtained by

or set using

Otherwise, the function returns the same value as

and

convert the ACL entries for the given type into a

string of ACL entries separated by newline. If the pointer

is not NULL, then the function shall return the length of the string

in the location pointed to by

The

argument is a bitwise-or.

The following flags are effective only on POSIX.1e ACL:

Output access ACLs.

Output POSIX.1e default ACLs.

Prefix each default ACL entry with the word

The mask and other ACLs don not contain a double colon.

The following flags are effecive only on NFSv4 ACL:

Do not output minus characters for unset permissions and flags in NFSv4 ACL permission and flag fields.

The following flags are effective on both POSIX.1e and NFSv4 ACL:

Add an additional colon-separated field containing the user or group id.

Separate ACL entries with comma instead of newline.

If the archive entry contains NFSv4 ACLs, all types of NFSv4 ACLs are returned. It the entry contains POSIX.1e ACLs and none of the flags

or

are specified, both access and default entries are returned and default entries are prefixed with

get ACL entry types contained in an archive entry’s ACL. As POSIX.1e and NFSv4 ACL entries cannot be mixed, this function is a very efficient way to detect if an ACL already contains POSIX.1e or NFSv4 ACL entries.

and

returns the number of ACL entries that match the given type mask. For POSIX.1e ACLS if the type mask includes

and at least one extended ACL entry exists, the three classic Unix permissions are counted.

and

return

if all entries were successfully parsed and

if one or more entries were invalid or non-parseable.

returns

on success,

if no more ACL entries exist and

if

has not been called first.

returns a string representing the ACL entries matching the given type and flags on success or NULL on error.

returns a wide string representing the ACL entries matching the given type and flags on success or NULL on error.

returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries.

Author: dt

Created: 2022-02-20 Sun 14:43