eclass/fcaps: Sync with Gentoo

It's from Gentoo commit 619f45e405c8525af36c8b860df263838a26ab6e.
This commit is contained in:
Krzesimir Nowak 2022-10-19 11:00:31 +02:00
parent 1364673673
commit 43edca0383

View File

@ -46,7 +46,7 @@ case ${EAPI} in
*) IDEPEND="filecaps? ( sys-libs/libcap )" ;; *) IDEPEND="filecaps? ( sys-libs/libcap )" ;;
esac esac
# @ECLASS-VARIABLE: FILECAPS # @ECLASS_VARIABLE: FILECAPS
# @DEFAULT_UNSET # @DEFAULT_UNSET
# @DESCRIPTION: # @DESCRIPTION:
# An array of fcap arguments to use to automatically execute fcaps. See that # An array of fcap arguments to use to automatically execute fcaps. See that
@ -83,18 +83,18 @@ esac
# #
# If the system is unable to set capabilities, it will use the specified user, # If the system is unable to set capabilities, it will use the specified user,
# group, and mode (presumably to make the binary set*id). The defaults there # group, and mode (presumably to make the binary set*id). The defaults there
# are root:0 and 4711. Otherwise, the ownership and permissions will be # are 0:0 and 4711. Otherwise, the ownership and permissions will be
# unchanged. # unchanged.
fcaps() { fcaps() {
debug-print-function ${FUNCNAME} "$@" debug-print-function ${FUNCNAME} "$@"
if [[ ${EUID} != 0 ]] ; then if [[ ${EUID} -ne 0 ]] ; then
einfo "Insufficient privileges to execute ${FUNCNAME}, skipping." einfo "Insufficient privileges to execute ${FUNCNAME}, skipping."
return 0 return 0
fi fi
# Process the user options first. # Process the user options first.
local owner='root' local owner='0'
local group='0' local group='0'
local mode='4711' local mode='4711'
local caps_mode='711' local caps_mode='711'