summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBian Jiaping2018-07-31 10:37:27 +0800
committerBian Jiaping2018-07-31 10:37:27 +0800
commit43250ed5f0b492864195b1d6b5be830a20ce2e4f (patch)
treeffea7cc1a311e35f59054a2cd402adb223d06e67
parentbed9064c3d25e168f4d15860cbdb802379045a4e (diff)
downloadaur-43250ed5f0b492864195b1d6b5be830a20ce2e4f.tar.gz
Replace setuid with capabilities for better security
-rw-r--r--.SRCINFO3
-rw-r--r--PKGBUILD5
-rw-r--r--besttrace.install7
3 files changed, 12 insertions, 3 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 100c7fc1aeb..7a5931a097f 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,8 +1,9 @@
pkgbase = besttrace
pkgdesc = IPIP.net 开发的加强版 traceroute,附带链路可视化
pkgver = 1.2
- pkgrel = 1
+ pkgrel = 2
url = https://www.ipip.net/download.html
+ install = besttrace.install
arch = x86_64
arch = i686
license = custom
diff --git a/PKGBUILD b/PKGBUILD
index 34d73bb1118..35ca3cca672 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,11 +2,12 @@
pkgname=besttrace
pkgver=1.2
-pkgrel=1
+pkgrel=2
pkgdesc="IPIP.net 开发的加强版 traceroute,附带链路可视化"
arch=('x86_64' 'i686')
url="https://www.ipip.net/download.html"
license=('custom')
+install=besttrace.install
if [ "${CARCH}" = "i686" ]; then
_filename=besttrace32
@@ -20,5 +21,5 @@ md5sums=("e209a35be256e25289ac7c581d60028d")
package(){
mkdir -p "$pkgdir"/usr/bin/
- install -m4755 "$srcdir"/$_filename "$pkgdir"/usr/bin/besttrace
+ install -m755 "$srcdir"/$_filename "$pkgdir"/usr/bin/besttrace
}
diff --git a/besttrace.install b/besttrace.install
new file mode 100644
index 00000000000..34d40e69082
--- /dev/null
+++ b/besttrace.install
@@ -0,0 +1,7 @@
+post_install() {
+ setcap cap_net_raw=ep usr/bin/besttrace 2>/dev/null || chmod +s usr/bin/besttrace
+}
+
+post_upgrade() {
+ post_install "$1"
+}