aboutsummaryrefslogtreecommitdiff
path: root/contrib/scripts/gnunet-suidfix
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/scripts/gnunet-suidfix')
-rwxr-xr-xcontrib/scripts/gnunet-suidfix27
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/scripts/gnunet-suidfix b/contrib/scripts/gnunet-suidfix
new file mode 100755
index 000000000..992378966
--- /dev/null
+++ b/contrib/scripts/gnunet-suidfix
@@ -0,0 +1,27 @@
1#!/bin/sh
2#
3# "suidfix" is german and it means something like immediate suicide.
4
5# taken from dangole's lede config.. thx!
6suid_root_helpers="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
7libexec="${GNUNET_PREFIX}/lib/gnunet/libexec"
8
9chmodown_execbin() {
10 if [ -x $1 ]; then
11 if [ "$3" ]; then
12 chown $3 $1 2>/dev/null && chmod $2 $1
13 else
14 chmod $2 $1
15 fi
16 ls -l $1
17 else
18 echo "Missing: $1"
19 fi
20}
21
22for helper in $suid_root_helpers; do
23 chmodown_execbin ${libexec}/gnunet-helper-$helper u+s
24done
25chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns
26chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns
27