From 934685cc74127d88bb1dd17a479ce50cca20427c Mon Sep 17 00:00:00 2001 From: Benda Xu Date: Sun, 8 Mar 2020 12:14:53 +0800 Subject: [PATCH] fcaps.eclass: skip fcaps() on Prefix. Gentoo Prefix runs with a normal user and cannot grant extra capabilities. Exit gracefully with a message. Reference: https://archives.gentoo.org/gentoo-dev/message/4207cffd6b875450bb2fdbcf1b076053 Signed-off-by: Benda Xu --- eclass/fcaps.eclass | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass index 2b6e5be4683d..0bb23f8cca70 100644 --- a/eclass/fcaps.eclass +++ b/eclass/fcaps.eclass @@ -81,6 +81,11 @@ esac fcaps() { debug-print-function ${FUNCNAME} "$@" + if [[ ${EUID} != 0 ]] ; then + einfo "Insufficient privileges to execute ${FUNCNAME}, skipping." + return 0 + fi + # Process the user options first. local owner='root' local group='0' -- 2.26.2