packages/net/fping/Makefile
Henrique de Moraes Holschuh 958cbf5f45 fping: install fping SUID root
fping requires either root or CAP_NET_PING to work, otherwise it is
useless.  Use INSTALL_SUID so that fping will be setuid root, and thus
it will be usable by non-root users.

fping knows to drop root priviledges after it parses the command line
and creates the ping socket.  You actually get a lot less code running
as root when you make it setuid root and run it from an unprivileged
user.

This is the same way net/iputils already handles "ping", which has the
same requirements.

Signed-off-by: Henrique de Moraes Holschuh <henrique@nic.br>
2020-05-06 15:44:48 -03:00

52 lines
1.4 KiB
Makefile

#
# Copyright (C) 2016 Nikil Mehta <nikil.mehta@gmail.com>
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=fping
PKG_VERSION:=4.2
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://fping.org/dist/
PKG_HASH:=7d339674b6a95aae1d8ad487ff5056fd95b474c3650938268f6a905c3771b64a
PKG_MAINTAINER:=Nikil Mehta <nikil.mehta@gmail.com>
PKG_LICENSE:=BSD-4-Clause
PKG_LICENSE_FILES:=COPYING
PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk
define Package/fping
SECTION:=net
CATEGORY:=Network
TITLE:=sends ICMP ECHO_REQUEST packets to network hosts
URL:=https://fping.org/
endef
define Package/fping/description
fping is a ping like program which uses the Internet Control Message Protocol
(ICMP) echo request to determine if a target host is responding. fping
differs from ping in that you can specify any number of targets on the command
line, or specify a file containing the lists of targets to ping. Instead of
sending to one target until it times out or replies, fping will send out a
ping packet and move on to the next target in a round-robin fashion.
endef
CONFIGURE_ARGS+= \
--enable-ipv4 \
--enable-ipv6
define Package/fping/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_SUID) $(PKG_INSTALL_DIR)/usr/sbin/fping $(1)/usr/bin/
endef
$(eval $(call BuildPackage,fping))