pkg: parsers: add /etc/passwd and /etc/group parsers

This patch adds parsers for both /etc/passwd and /etc/group data which
allows for custom readers to be used in the exposed API. It also
includes a FindPasswd processor that allows for user references to be
searched using a custom reader in the exposed API.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
pkg: parsers: passwd: add unit tests for parsers

This patch adds unit tests for ParsePasswd, ParseGroup and FindPasswd
using custom readers.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
daemon: *: export GetResourcePath and GetRootResourcePath

This allows for external packages to *safely* attain the full path of
any resource in a container's rootfs or base.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
builder: allow the USER directive to modify the owner of COPY'd files

This patch ensures that the USER directive will change the owner of any
COPY'd files or directories to the user id and primary group id of the
user which the builder's run config currently runs as. The user and
primary group ids are ascertained by inspecting the latest container's
/etc/passwd and /etc/group file (which is parsed on each COPY directive).

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)
integration-cli: add tests for USER changing owner of COPY'd files

This patch adds integration-cli tests for a wide variety of USER
directives to ensure that they all act consistently with the RUN
directive in terms of the owner of COPY'd files.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> (github: cyphar)