1 |
From: Benda Xu <heroxbd@g.o> |
2 |
|
3 |
Gentoo Prefix runs with a normal user and cannot grant extra |
4 |
capabilities. Exit gracefully with a message. |
5 |
|
6 |
Closes: https://bugs.gentoo.org/699526 |
7 |
Signed-off-by: Benda Xu <heroxbd@g.o> |
8 |
--- |
9 |
eclass/fcaps.eclass | 5 +++++ |
10 |
1 file changed, 5 insertions(+) |
11 |
|
12 |
diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass |
13 |
index 467f955f5e9a..563d177c92d5 100644 |
14 |
--- a/eclass/fcaps.eclass |
15 |
+++ b/eclass/fcaps.eclass |
16 |
@@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )" |
17 |
fcaps() { |
18 |
debug-print-function ${FUNCNAME} "$@" |
19 |
|
20 |
+ if [[ ${EUID} != 0 ]] ; then |
21 |
+ einfo "Insufficient privileges to execute ${FUNCNAME[0]}" |
22 |
+ return 0 |
23 |
+ fi |
24 |
+ |
25 |
# Process the user options first. |
26 |
local owner='root' |
27 |
local group='0' |
28 |
-- |
29 |
2.25.0 |