From: Petr Vorel <petr.vorel@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2 v7] package/iputils: use capabilities if possible
Date: Thu, 1 Aug 2019 19:26:55 +0200 [thread overview]
Message-ID: <20190801172654.GB27877@x230> (raw)
In-Reply-To: <7357ef816dae35990f461175f35135fb4996eb54.1564676540.git.yann.morin.1998@free.fr>
Hi Yann,
> From: Petr Vorel <petr.vorel@gmail.com>
> If support for extended attributes is enabled, then we can use them to
> store capabilities. If not, we keep using the setuid bit.
> arping does not get a capability, as it can be used for arp poisoning.
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
> [yann.morin.1998 at free.fr:
> - resort to using q full-fledged conditional block
> ]
> Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
> ---
> Changes v6 -> v7:
> - use a full if-block
> ---
> package/iputils/iputils.mk | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
> diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk
> index 7482bbdca1..cbcce89684 100644
> --- a/package/iputils/iputils.mk
> +++ b/package/iputils/iputils.mk
> @@ -79,11 +79,23 @@ 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)
> +define IPUTILS_PERMISSIONS
> + /usr/sbin/arping f 755 0 0 - - - - -
> + /usr/bin/clockdiff f 755 0 0 - - - - -
> + |xattr cap_net_raw+p
> + /bin/ping f 755 0 0 - - - - -
> + |xattr cap_net_raw+p
> + /usr/bin/traceroute6 f 755 0 0 - - - - -
> + |xattr cap_net_raw+p
> +endef
> +else
> define IPUTILS_PERMISSIONS
> /usr/sbin/arping f 755 0 0 - - - - -
> /usr/bin/clockdiff f 4755 0 0 - - - - -
> /bin/ping f 4755 0 0 - - - - -
> /usr/bin/traceroute6 f 4755 0 0 - - - - -
> endef
> +endif
I wanted to avoid duplicity, but this is really clearer to read!
Thanks for fixing arping setuid.
Kind regards,
Petr
> $(eval $(meson-package))
next prev parent reply other threads:[~2019-08-01 17:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 16:22 [Buildroot] [PATCH 0/2 v7] package/iputils: use capabilties (branch yem/iputils-caps) Yann E. MORIN
2019-08-01 16:22 ` [Buildroot] [PATCH 1/2 v7] package/iputils: drop setuid on arping Yann E. MORIN
2019-08-01 17:25 ` Petr Vorel
2019-08-01 18:21 ` Peter Korsgaard
2019-08-01 16:22 ` [Buildroot] [PATCH 2/2 v7] package/iputils: use capabilities if possible Yann E. MORIN
2019-08-01 17:26 ` Petr Vorel [this message]
2019-08-01 18:22 ` Peter Korsgaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190801172654.GB27877@x230 \
--to=petr.vorel@gmail.com \
--cc=buildroot@busybox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox