diff options
author | Vincent Grande | 2021-01-12 13:57:50 -0500 |
---|---|---|
committer | Vincent Grande | 2021-01-12 13:57:50 -0500 |
commit | 52d363850382807b726682fdaf3994e3d36c6733 (patch) | |
tree | 3bf84bcc39e64010cdb93aea68133c87dd9cf1b4 | |
download | aur-52d363850382807b726682fdaf3994e3d36c6733.tar.gz |
initial upload
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 37 | ||||
-rw-r--r-- | fix-setuid-redeclared.patch | 48 | ||||
-rw-r--r-- | iputils.install | 9 | ||||
-rw-r--r-- | tftp.xinetd | 10 |
5 files changed, 126 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..3f6f5bf2be1b --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = iputils-minimal-git + pkgdesc = Network monitoring tools, including ping + pkgver = 20200821 + pkgrel = 1 + url = http://www.skbuff.net/iputils/ + arch = x86_64 + license = GPL + makedepends = git + makedepends = meson + depends = libcap + depends = libidn2 + provides = iputils + conflicts = netkit-base + conflicts = arping + conflicts = netkit-tftpd + conflicts = iputils + replaces = netkit-base + source = git+https://github.com/iputils/iputils.git + sha1sums = SKIP + +pkgname = iputils-minimal-git + diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..438a15591e37 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,37 @@ +# Maintainer: Vincent Grande <shoober420@gmail.com> +# Contributor: Stéphane Gaudreault <stephane@archlinux.org> +# Contributor: Tobias Powalowski <tpowa@archlinux.org> +# Contributor: Aaron Griffin <aaron@archlinux.org> + +pkgname=iputils-minimal-git +pkgver=20200821 +pkgrel=1 +pkgdesc="Network monitoring tools, including ping" +arch=('x86_64') +license=('GPL') +url="http://www.skbuff.net/iputils/" +depends=('libcap' 'libidn2') +makedepends=('git' 'meson') +provides=(iputils) +conflicts=('netkit-base' 'arping' 'netkit-tftpd' 'iputils') +replaces=('netkit-base') +source=("git+https://github.com/iputils/iputils.git") +sha1sums=('SKIP') + +pkgver() { + cd iputils + git describe --tags | sed 's/-/+/g' +} + +build() { + cd iputils + + arch-meson iputils -DBUILD_RARPD=false -DBUILD_TFTPD=false -DBUILD_ARPING=false -DBUILD_PING=false -DBUILD_RDISC=false -DENABLE_RDISC_SERVER=false -DBUILD_TRACEPATH=false -DBUILD_TRACEROUTE6=false -DBUILD_NINFOD=false -DNINFOD_MESSAGES=false -DBUILD_MANS=false -DBUILD_HTML_MANS=false + ninja $NINJAFLAGS +} + +package() { + cd iputils + + DESTDIR="$pkgdir" ninja $NINJAFLAGS install +} diff --git a/fix-setuid-redeclared.patch b/fix-setuid-redeclared.patch new file mode 100644 index 000000000000..21f697a32983 --- /dev/null +++ b/fix-setuid-redeclared.patch @@ -0,0 +1,48 @@ +From 18f9a84e0e702841d6cc4d5f593de4fbd1348e83 Mon Sep 17 00:00:00 2001 +From: Sami Kerola <kerolasa@iki.fi> +Date: Sat, 28 Dec 2019 17:16:27 +0000 +Subject: [PATCH] ninfod: change variable name to avoid colliding with function + name + +The sys/capability.h header has 'extern int cap_setuid(uid_t uid);' +function prototype. + +Addresses: https://github.com/iputils/iputils/issues/246 +Signed-off-by: Sami Kerola <kerolasa@iki.fi> +--- + ninfod/ninfod.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/ninfod/ninfod.c b/ninfod/ninfod.c +index 26112d0..95583de 100644 +--- a/ninfod/ninfod.c ++++ b/ninfod/ninfod.c +@@ -455,7 +455,7 @@ static void do_daemonize(void) + /* --------- */ + #ifdef HAVE_LIBCAP + static const cap_value_t cap_net_raw = CAP_NET_RAW; +-static const cap_value_t cap_setuid = CAP_SETUID; ++static const cap_value_t cap_setuserid = CAP_SETUID; + static cap_flag_value_t cap_ok; + #else + static uid_t euid; +@@ -487,7 +487,7 @@ static void limit_capabilities(void) + + cap_get_flag(cap_cur_p, CAP_SETUID, CAP_PERMITTED, &cap_ok); + if (cap_ok != CAP_CLEAR) +- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET); ++ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET); + + if (cap_set_proc(cap_p) < 0) { + DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno)); +@@ -520,8 +520,8 @@ static void drop_capabilities(void) + + /* setuid / setuid */ + if (cap_ok != CAP_CLEAR) { +- cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuid, CAP_SET); +- cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuid, CAP_SET); ++ cap_set_flag(cap_p, CAP_PERMITTED, 1, &cap_setuserid, CAP_SET); ++ cap_set_flag(cap_p, CAP_EFFECTIVE, 1, &cap_setuserid, CAP_SET); + + if (cap_set_proc(cap_p) < 0) { + DEBUG(LOG_ERR, "cap_set_proc: %s\n", strerror(errno)); diff --git a/iputils.install b/iputils.install new file mode 100644 index 000000000000..1684c2e72aea --- /dev/null +++ b/iputils.install @@ -0,0 +1,9 @@ +post_install() { + setcap cap_net_raw=ep usr/bin/ping 2>/dev/null || chmod +s usr/bin/ping +} + +post_upgrade() { + post_install "$1" +} + +# vim:set ts=2 sw=2 et: diff --git a/tftp.xinetd b/tftp.xinetd new file mode 100644 index 000000000000..26041a3f9082 --- /dev/null +++ b/tftp.xinetd @@ -0,0 +1,10 @@ +service tftp +{ + socket_type = dgram + protocol = udp + wait = yes + user = nobody + server = /usr/sbin/tftpd + server_args = /var/tftpboot + disable = yes +} |