From patchwork Wed Jul 31 20:09:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Petr Vorel X-Patchwork-Id: 1140026 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="cU+RiWwX"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45zPfV28tVz9s7T for ; Thu, 1 Aug 2019 06:09:53 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4269B1FE0A; Wed, 31 Jul 2019 20:09:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G0FVM0zeeKkM; Wed, 31 Jul 2019 20:09:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0580A203E4; Wed, 31 Jul 2019 20:09:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 906F91BF319 for ; Wed, 31 Jul 2019 20:09:46 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 8CE96818B2 for ; Wed, 31 Jul 2019 20:09:46 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aRPlQhEVsixt for ; Wed, 31 Jul 2019 20:09:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-ed1-f51.google.com (mail-ed1-f51.google.com [209.85.208.51]) by whitealder.osuosl.org (Postfix) with ESMTPS id A92A381724 for ; Wed, 31 Jul 2019 20:09:45 +0000 (UTC) Received: by mail-ed1-f51.google.com with SMTP id m10so66914387edv.6 for ; Wed, 31 Jul 2019 13:09:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QgxmjwwQIZ+/qvYdaxgqF7A5ZMiRZbLjYZIsFqdY9wo=; b=cU+RiWwXktkP3LrLHtCRVlJFNgU6NlPCbW11XGukY/BVo5ru+hoNqobaEE/FeQczRx 5nPMoFAS8rGH9fafR1joS5bZmTigoEL/zNdEshdAxg+4fuVZrJFkJyeL0r2YWEU1j4qd VkZibTo4usnauArMhvpxM0OBPbROecx2x24TCJZPxxYLzc1rd7j/Crxe3g0AIvT39sq5 xr7YglNwKAgVJx3TrRVKIHLRe9S8ZYnqkMVXYCoSTnISozRpGx4WH8rvG/tF8INwTj/W fxZEK66ufJbGqi1hNLx6lDU7/eu9X05q3srpbGMb1xvjM+N2HmJSA1CeeHIm8SEsf5n/ wCGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QgxmjwwQIZ+/qvYdaxgqF7A5ZMiRZbLjYZIsFqdY9wo=; b=jPMpjyMCT07mF/eOD2PAzf+Bmdmv9bUH39xuoWf7RRssFUS7UPyTt+6Idx/xYxfr3P OJEZ4Ohmfe6d0S0SB8BsXz1bzOtznBRTffT6uRtzPpliMOMZNqUEBxSr90d8ePvny0x0 JjGpZgfNBhtprPey9BGiBiLz6vKLS7wbDOaNjUthAEjhTKr0fpQi4I3C4Okpl9A+2vyt t4A5mPJ7tEyY+JuKHj3O9TnaMwvldPM5/WOPDotk2olWvLhePNpP+Ru4vKRY+ig/oWS6 1Fw3PG3zi46gl0bdoYB9IBL7lIJjUZjpOR3R/mX5as39mI0OMdhBVsFQYseg+5QmNqEl QLtQ== X-Gm-Message-State: APjAAAVBeJMyQnjaDJB8Q3w5fXWST0Z/kJxbwlD1r9KXAi+CrwC2z+4N stFRFuWQZv/sFJwkIpuvmQ5CKl0u2sY= X-Google-Smtp-Source: APXvYqy/ryUheTpJs0sp1UHjK/IkrPpc7GQoBJeImhjtiPkBwlbPrqXeh1oi4S2mzAYwX/QG5kdglA== X-Received: by 2002:a17:906:a39a:: with SMTP id k26mr47542708ejz.82.1564603783667; Wed, 31 Jul 2019 13:09:43 -0700 (PDT) Received: from dell5510.arch.suse.de ([62.201.25.198]) by smtp.gmail.com with ESMTPSA id w6sm8946808edq.81.2019.07.31.13.09.42 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 31 Jul 2019 13:09:42 -0700 (PDT) From: Petr Vorel To: buildroot@buildroot.org Date: Wed, 31 Jul 2019 22:09:33 +0200 Message-Id: <20190731200933.3487-2-petr.vorel@gmail.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190731200933.3487-1-petr.vorel@gmail.com> References: <20190731200933.3487-1-petr.vorel@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [RFC PATCH v5 2/2] iputils: add capability for clockdiff, ping, traceroute6 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Korsgaard , "Yann E . MORIN" , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" and fallback to setuid if xattr not enabled. Not setting xattr on arping as it can be used for ARP Poisoning. 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 --- Changes v4->v5: * fallback to setuid if xattr (suggested by Yann by Yann) BTW I wasn't able to use ifeq.. ,y. Kind regards, Petr package/iputils/iputils.mk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/package/iputils/iputils.mk b/package/iputils/iputils.mk index 8e6a3e2fc5..e5a2690aac 100644 --- a/package/iputils/iputils.mk +++ b/package/iputils/iputils.mk @@ -73,11 +73,16 @@ IPUTILS_POST_INSTALL_TARGET_HOOKS += IPUTILS_CREATE_PING6_SYMLINK # handle permissions ourselves IPUTILS_CONF_OPTS += -DNO_SETCAP_OR_SUID=true +MAYBE_SUID = $(if $(BR2_ROOTFS_DEVICE_TABLE_SUPPORTS_EXTENDED_ATTRIBUTES),0,4) + define IPUTILS_PERMISSIONS - /usr/sbin/arping f 4755 0 0 - - - - - - /usr/bin/clockdiff f 4755 0 0 - - - - - - /bin/ping f 4755 0 0 - - - - - - /usr/bin/traceroute6 f 4755 0 0 - - - - - + /usr/sbin/arping f $(MAYBE_SUID)755 0 0 - - - - - + /usr/bin/clockdiff f $(MAYBE_SUID)755 0 0 - - - - - + |xattr cap_net_raw+p + /bin/ping f $(MAYBE_SUID)755 0 0 - - - - - + |xattr cap_net_raw+p + /usr/bin/traceroute6 f $(MAYBE_SUID)755 0 0 - - - - - + |xattr cap_net_raw+p endef $(eval $(meson-package))