public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] eclass/acct-user.eclass: disable fcaps() on Prefix.
@ 2020-03-08  4:20 heroxbd
  2020-03-08  6:22 ` Michał Górny
  0 siblings, 1 reply; 9+ messages in thread
From: heroxbd @ 2020-03-08  4:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Benda Xu

From: Benda Xu <heroxbd@gentoo.org>

  Gentoo Prefix runs with a normal user and cannot grant extra
  capabilities.  Exit gracefully with a message.

Closes: https://bugs.gentoo.org/699526
Signed-off-by: Benda Xu <heroxbd@gentoo.org>
---
 eclass/fcaps.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9a..563d177c92d5 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
 fcaps() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	if [[ ${EUID} != 0 ]] ; then
+		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
+		return 0
+	fi
+
 	# Process the user options first.
 	local owner='root'
 	local group='0'
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass/acct-user.eclass: disable fcaps() on Prefix.
  2020-03-08  4:20 [gentoo-dev] [PATCH] eclass/acct-user.eclass: disable fcaps() on Prefix heroxbd
@ 2020-03-08  6:22 ` Michał Górny
  2020-03-08  7:23   ` Benda Xu
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2020-03-08  6:22 UTC (permalink / raw
  To: gentoo-dev; +Cc: Benda Xu

[-- Attachment #1: Type: text/plain, Size: 991 bytes --]

^ wrong subject.

On Sun, 2020-03-08 at 12:20 +0800, heroxbd@gentoo.org wrote:
> From: Benda Xu <heroxbd@gentoo.org>
> 
>   Gentoo Prefix runs with a normal user and cannot grant extra
>   capabilities.  Exit gracefully with a message.

Please don't add this weird indent.

> 
> Closes: https://bugs.gentoo.org/699526
> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
> ---
>  eclass/fcaps.eclass | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
> index 467f955f5e9a..563d177c92d5 100644
> --- a/eclass/fcaps.eclass
> +++ b/eclass/fcaps.eclass
> @@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
>  fcaps() {
>  	debug-print-function ${FUNCNAME} "$@"
>  
> +	if [[ ${EUID} != 0 ]] ; then
> +		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
> +		return 0
> +	fi
> +
>  	# Process the user options first.
>  	local owner='root'
>  	local group='0'

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] eclass/acct-user.eclass: disable fcaps() on Prefix.
  2020-03-08  6:22 ` Michał Górny
@ 2020-03-08  7:23   ` Benda Xu
  2020-03-08  7:26     ` [gentoo-dev] [PATCH] fcaps.eclass: " heroxbd
  0 siblings, 1 reply; 9+ messages in thread
From: Benda Xu @ 2020-03-08  7:23 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-dev, Benda Xu

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

Michał Górny <mgorny@gentoo.org> writes:

> ^ wrong subject.

OK. should be `acct-user.eclass: disable fcaps() on Prefix.`

> On Sun, 2020-03-08 at 12:20 +0800, heroxbd@gentoo.org wrote:
>> From: Benda Xu <heroxbd@gentoo.org>
>> 
>>   Gentoo Prefix runs with a normal user and cannot grant extra
>>   capabilities.  Exit gracefully with a message.
>
> Please don't add this weird indent.

OK, thanks for pointing out.  Didn't notice that.

Benda

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH] fcaps.eclass: disable fcaps() on Prefix.
  2020-03-08  7:23   ` Benda Xu
@ 2020-03-08  7:26     ` heroxbd
  2020-03-08  7:29       ` Fabian Groffen
  2020-03-08  8:04       ` Ulrich Mueller
  0 siblings, 2 replies; 9+ messages in thread
From: heroxbd @ 2020-03-08  7:26 UTC (permalink / raw
  To: gentoo-dev; +Cc: Benda Xu

From: Benda Xu <heroxbd@gentoo.org>

Gentoo Prefix runs with a normal user and cannot grant extra
capabilities.  Exit gracefully with a message.

Signed-off-by: Benda Xu <heroxbd@gentoo.org>
---
 eclass/fcaps.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9a..563d177c92d5 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
 fcaps() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	if [[ ${EUID} != 0 ]] ; then
+		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
+		return 0
+	fi
+
 	# Process the user options first.
 	local owner='root'
 	local group='0'
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: disable fcaps() on Prefix.
  2020-03-08  7:26     ` [gentoo-dev] [PATCH] fcaps.eclass: " heroxbd
@ 2020-03-08  7:29       ` Fabian Groffen
  2020-03-08  8:04       ` Ulrich Mueller
  1 sibling, 0 replies; 9+ messages in thread
From: Fabian Groffen @ 2020-03-08  7:29 UTC (permalink / raw
  To: heroxbd; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 1046 bytes --]

On 08-03-2020 15:26:50 +0800, heroxbd@gentoo.org wrote:
> From: Benda Xu <heroxbd@gentoo.org>
> 
> Gentoo Prefix runs with a normal user and cannot grant extra
> capabilities.  Exit gracefully with a message.
> 
> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
> ---
>  eclass/fcaps.eclass | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
> index 467f955f5e9a..563d177c92d5 100644
> --- a/eclass/fcaps.eclass
> +++ b/eclass/fcaps.eclass
> @@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
>  fcaps() {
>  	debug-print-function ${FUNCNAME} "$@"
>  
> +	if [[ ${EUID} != 0 ]] ; then
> +		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"
> +		return 0

Perhaps add "ignoring" or something in the message here to make it clear
this isn't treated as an error?

Thanks,
Fabian

> +	fi
> +
>  	# Process the user options first.
>  	local owner='root'
>  	local group='0'
> -- 
> 2.25.0
> 
> 

-- 
Fabian Groffen
Gentoo on a different level

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: disable fcaps() on Prefix.
  2020-03-08  7:26     ` [gentoo-dev] [PATCH] fcaps.eclass: " heroxbd
  2020-03-08  7:29       ` Fabian Groffen
@ 2020-03-08  8:04       ` Ulrich Mueller
  2020-03-08  9:20         ` [gentoo-dev] [PATCH] fcaps.eclass: skip " heroxbd
  1 sibling, 1 reply; 9+ messages in thread
From: Ulrich Mueller @ 2020-03-08  8:04 UTC (permalink / raw
  To: heroxbd; +Cc: gentoo-dev

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

>>>>> On Sun, 08 Mar 2020, heroxbd  wrote:
>  	debug-print-function ${FUNCNAME} "$@"
>  
> +	if [[ ${EUID} != 0 ]] ; then
> +		einfo "Insufficient privileges to execute ${FUNCNAME[0]}"

Just a small comment on style, maybe try to stay consistent with the
rest of the eclass? That is, either have just FUNCNAME here, or change
it to FUNCNAME[0] everywhere else.

Ulrich

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 507 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH] fcaps.eclass: skip fcaps() on Prefix.
  2020-03-08  8:04       ` Ulrich Mueller
@ 2020-03-08  9:20         ` heroxbd
  2020-03-08 15:41           ` Mike Gilbert
  0 siblings, 1 reply; 9+ messages in thread
From: heroxbd @ 2020-03-08  9:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: Benda Xu

From: Benda Xu <heroxbd@gentoo.org>

Gentoo Prefix runs with a normal user and cannot grant extra
capabilities.  Exit gracefully with a message.

Signed-off-by: Benda Xu <heroxbd@gentoo.org>
---
 eclass/fcaps.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9a..ddc4d3ccc6d8 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
 fcaps() {
 	debug-print-function ${FUNCNAME} "$@"
 
+	if [[ ${EUID} != 0 ]] ; then
+		einfo "Insufficient privileges to execute ${FUNCNAME}, skip."
+		return 0
+	fi
+
 	# Process the user options first.
 	local owner='root'
 	local group='0'
-- 
2.25.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [gentoo-dev] [PATCH] fcaps.eclass: skip fcaps() on Prefix.
  2020-03-08  9:20         ` [gentoo-dev] [PATCH] fcaps.eclass: skip " heroxbd
@ 2020-03-08 15:41           ` Mike Gilbert
  2020-03-09  1:46             ` heroxbd
  0 siblings, 1 reply; 9+ messages in thread
From: Mike Gilbert @ 2020-03-08 15:41 UTC (permalink / raw
  To: Gentoo Dev; +Cc: Benda Xu

On Sun, Mar 8, 2020 at 5:20 AM <heroxbd@gentoo.org> wrote:
>
> From: Benda Xu <heroxbd@gentoo.org>
>
> Gentoo Prefix runs with a normal user and cannot grant extra
> capabilities.  Exit gracefully with a message.
>
> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
> ---
>  eclass/fcaps.eclass | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
> index 467f955f5e9a..ddc4d3ccc6d8 100644
> --- a/eclass/fcaps.eclass
> +++ b/eclass/fcaps.eclass
> @@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
>  fcaps() {
>         debug-print-function ${FUNCNAME} "$@"
>
> +       if [[ ${EUID} != 0 ]] ; then
> +               einfo "Insufficient privileges to execute ${FUNCNAME}, skip."
> +               return 0
> +       fi
> +

It seems like you are commanding the user to skip.

s/skip/skipping/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [gentoo-dev] [PATCH] fcaps.eclass: skip fcaps() on Prefix.
  2020-03-08 15:41           ` Mike Gilbert
@ 2020-03-09  1:46             ` heroxbd
  0 siblings, 0 replies; 9+ messages in thread
From: heroxbd @ 2020-03-09  1:46 UTC (permalink / raw
  To: gentoo-dev; +Cc: Benda Xu

From: Benda Xu <heroxbd@gentoo.org>

Gentoo Prefix runs with a normal user and cannot grant extra
capabilities.  Exit gracefully with a message.

Signed-off-by: Benda Xu <heroxbd@gentoo.org>
---
 eclass/fcaps.eclass | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/eclass/fcaps.eclass b/eclass/fcaps.eclass
index 467f955f5e9a..fb0af8cbbde6 100644
--- a/eclass/fcaps.eclass
+++ b/eclass/fcaps.eclass
@@ -78,6 +78,11 @@ DEPEND="filecaps? ( sys-libs/libcap )"
 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.25.0



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-03-09  1:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-08  4:20 [gentoo-dev] [PATCH] eclass/acct-user.eclass: disable fcaps() on Prefix heroxbd
2020-03-08  6:22 ` Michał Górny
2020-03-08  7:23   ` Benda Xu
2020-03-08  7:26     ` [gentoo-dev] [PATCH] fcaps.eclass: " heroxbd
2020-03-08  7:29       ` Fabian Groffen
2020-03-08  8:04       ` Ulrich Mueller
2020-03-08  9:20         ` [gentoo-dev] [PATCH] fcaps.eclass: skip " heroxbd
2020-03-08 15:41           ` Mike Gilbert
2020-03-09  1:46             ` heroxbd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox