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 0000000000..9923789662
--- /dev/null
+++ b/contrib/scripts/gnunet-suidfix
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# "suidfix" is german and it means something like immediate suicide.
+
+# taken from dangole's lede config.. thx!
+suid_root_helpers="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
+libexec="${GNUNET_PREFIX}/lib/gnunet/libexec"
+
+chmodown_execbin() {
+ if [ -x $1 ]; then
+ if [ "$3" ]; then
+ chown $3 $1 2>/dev/null && chmod $2 $1
+ else
+ chmod $2 $1
+ fi
+ ls -l $1
+ else
+ echo "Missing: $1"
+ fi
+}
+
+for helper in $suid_root_helpers; do
+ chmodown_execbin ${libexec}/gnunet-helper-$helper u+s
+done
+chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns
+chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns
+