2
0

gnunet-suidfix 834 B

123456789101112131415161718192021222324252627282930
  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. suid_root_helpers="exit nat-server nat-client transport-bluetooth transport-wlan vpn"
  9. libexec="${GNUNET_PREFIX}/lib/gnunet/libexec"
  10. chmodown_execbin() {
  11. if [ -x $1 ]; then
  12. if [ "$3" ]; then
  13. chown $3 $1 2>/dev/null && chmod $2 $1
  14. else
  15. chmod $2 $1
  16. fi
  17. ls -l $1
  18. else
  19. echo "Missing: $1"
  20. fi
  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