Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] iputils: Add capability for clockdiff, ping, traceroute6
@ 2019-07-28 19:53 Petr Vorel
  2019-07-29  6:54 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Petr Vorel @ 2019-07-28 19:53 UTC (permalink / raw)
  To: buildroot

NOTE: not setting for arping as it can be used for ARP Poisoning

NOTE: use cap_net_raw+p (drop +e) as upstream sets that via
cap_set_flag(), see https://github.com/iputils/iputils/issues/194

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 package/iputils/iputils.mk | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk
index 8e6a3e2fc5..2ffa8da554 100644
--- a/package/iputils/iputils.mk
+++ b/package/iputils/iputils.mk
@@ -73,11 +73,17 @@ IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_CREATE_PING6_SYMLINK
 
 # handle permissions ourselves
 IPUTILS_CONF_OPTS += -DNO_SETCAP_OR_SUID=true
+ifeq ($(BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES),y)
+IPUTILS_CAPABILITY = |xattr cap_net_raw+p
+endif
 define IPUTILS_PERMISSIONS
 	/usr/sbin/arping      f 4755 0 0 - - - - -
 	/usr/bin/clockdiff    f 4755 0 0 - - - - -
+	$(IPUTILS_CAPABILITY)
 	/bin/ping             f 4755 0 0 - - - - -
+	$(IPUTILS_CAPABILITY)
 	/usr/bin/traceroute6  f 4755 0 0 - - - - -
+	$(IPUTILS_CAPABILITY)
 endef
 
 $(eval $(meson-package))
-- 
2.22.0

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

* [Buildroot] [PATCH 1/1] iputils: Add capability for clockdiff, ping, traceroute6
  2019-07-28 19:53 [Buildroot] [PATCH 1/1] iputils: Add capability for clockdiff, ping, traceroute6 Petr Vorel
@ 2019-07-29  6:54 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2019-07-29  6:54 UTC (permalink / raw)
  To: buildroot

Hello Petr,

+Yann in Cc.

On Sun, 28 Jul 2019 21:53:46 +0200
Petr Vorel <petr.vorel@gmail.com> wrote:

> NOTE: not setting for arping as it can be used for ARP Poisoning
> 
> NOTE: use cap_net_raw+p (drop +e) as upstream sets that via
> cap_set_flag(), see https://github.com/iputils/iputils/issues/194
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> ---
>  package/iputils/iputils.mk | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk
> index 8e6a3e2fc5..2ffa8da554 100644
> --- a/package/iputils/iputils.mk
> +++ b/package/iputils/iputils.mk
> @@ -73,11 +73,17 @@ IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_CREATE_PING6_SYMLINK
>  
>  # handle permissions ourselves
>  IPUTILS_CONF_OPTS += -DNO_SETCAP_OR_SUID=true
> +ifeq ($(BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES),y)
> +IPUTILS_CAPABILITY = |xattr cap_net_raw+p
> +endif
>  define IPUTILS_PERMISSIONS
>  	/usr/sbin/arping      f 4755 0 0 - - - - -
>  	/usr/bin/clockdiff    f 4755 0 0 - - - - -
> +	$(IPUTILS_CAPABILITY)

It looks a bit annoying to me that we have to add this
BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES conditional.
Indeed, every single place where a permission/device table will want to
use extended attributes, we will have to add such a conditional.

Shouldn't this logic be moved into the code that parses the
permission/device table, and simply discard the extended attributes if
BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES is disabled ?
(Possibly with a warning)

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

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

end of thread, other threads:[~2019-07-29  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-28 19:53 [Buildroot] [PATCH 1/1] iputils: Add capability for clockdiff, ping, traceroute6 Petr Vorel
2019-07-29  6:54 ` Thomas Petazzoni

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