contrib: Add nssswitch.conf as used by the Gentoo ebuild.
[oweals/gnunet.git] / contrib / gnunet-suidfix
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