diff options
Diffstat (limited to 'contrib/gnunet-suidfix')
-rwxr-xr-x | contrib/gnunet-suidfix | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/contrib/gnunet-suidfix b/contrib/gnunet-suidfix new file mode 100755 index 000000000..992378966 --- /dev/null +++ b/contrib/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! | ||
6 | suid_root_helpers="exit nat-server nat-client transport-bluetooth transport-wlan vpn" | ||
7 | libexec="${GNUNET_PREFIX}/lib/gnunet/libexec" | ||
8 | |||
9 | chmodown_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 | |||
22 | for helper in $suid_root_helpers; do | ||
23 | chmodown_execbin ${libexec}/gnunet-helper-$helper u+s | ||
24 | done | ||
25 | chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns | ||
26 | chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns | ||
27 | |||