Skip to contentSkip to conversation

iputils: Add capability for clockdiff, ping, traceroute6

PATCH Superseded Petr Vorel 2 participants 2 messages Jul 28, 2019 – Jul 29, 2019

v1 of 6 Superseded Latest is v6 →

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

PATCH 1/1 iputils: Add capability for clockdiff, ping, traceroute6

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

---
 package/iputils/iputils.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/iputils/iputils.mk +6 -0
index 8e6a3e2fc5..2ffa8da554 100644
@@ -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))
Signature · 1 line
2.22.0
#1 lore raw

PATCH 1/1 iputils: Add capability for clockdiff, ping, traceroute6

Hello Petr,

+Yann in Cc.

Quoted 15 lines · On Sun, 28 Jul 2019 21:53:46 +0200 Petr Vorel <[email protected]> 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

---
 package/iputils/iputils.mk | 6 ++++++
 1 file changed, 6 insertions(+)
package/iputils/iputils.mk +0 -0
index 8e6a3e2fc5..2ffa8da554 100644

package/iputils/iputils.mk IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_CREATE_PING6_SYMLINK · line 82

Quoted 10 lines
package/iputils/iputils.mk +4 -0
@@ -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

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com