deprecate ill-defined set_nick API
[oweals/gnunet.git] / contrib / scripts / gnunet-suidfix
1 #!/bin/sh
2 #
3 # "suidfix" - fix permissions and sticky bits for the binaries
4 # installed by GNUnet.
5 # Takes GNUNET_PREFIX from the environment.
6 #
7 # Taken from dangole's LEDE/OpenWRT config.. thx!
8
9 suid_root_helpers="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
10 libexec="${GNUNET_PREFIX}/lib/gnunet/libexec"
11
12 chmodown_execbin() {
13         if [ -x $1 ]; then
14                 if [ "$3" ]; then
15                         chown $3 $1 2>/dev/null && chmod $2 $1
16                 else
17                         chmod $2 $1
18                 fi
19                 ls -l $1
20         else
21                 echo "Missing: $1"
22         fi
23 }
24
25 for helper in $suid_root_helpers; do
26         chmodown_execbin ${libexec}/gnunet-helper-$helper u+s
27 done
28 chmodown_execbin ${libexec}/gnunet-helper-dns 4750 root:gnunetdns
29 chmodown_execbin ${libexec}/gnunet-service-dns 2750 gnunet:gnunetdns
30