From b7ca6765f707bdf074b948d17ce9e458f0bd680d Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 1 Aug 2012 07:20:37 +0000 Subject: [PATCH] -fixing installation scripts for suid binaries --- src/dns/Makefile.am | 2 +- src/dns/install-dns-helper.sh | 16 ++++++++-------- src/exit/Makefile.am | 2 +- src/exit/install-exit-helper.sh | 10 +++++----- src/nat/Makefile.am | 8 +------- src/nat/install-nat-helper.sh | 9 ++++----- src/transport/Makefile.am | 2 +- src/transport/install-wlan-helper.sh | 8 ++++---- src/vpn/Makefile.am | 2 +- src/vpn/install-vpn-helper.sh | 8 ++++---- 10 files changed, 30 insertions(+), 37 deletions(-) diff --git a/src/dns/Makefile.am b/src/dns/Makefile.am index 59395700a..8a102c414 100644 --- a/src/dns/Makefile.am +++ b/src/dns/Makefile.am @@ -18,7 +18,7 @@ pkgcfg_DATA = \ if LINUX HIJACKBIN = gnunet-helper-dns install-exec-hook: - $(top_srcdir)/src/dns/install-dns-helper.sh $(SUDO_BINARY) $(bindir) $(GNUNETDNS_GROUP) || true + $(top_srcdir)/src/dns/install-dns-helper.sh $(bindir) $(GNUNETDNS_GROUP) $(SUDO_BINARY) || true else install-exec-hook: endif diff --git a/src/dns/install-dns-helper.sh b/src/dns/install-dns-helper.sh index ac42e1f29..bf2dd427d 100644 --- a/src/dns/install-dns-helper.sh +++ b/src/dns/install-dns-helper.sh @@ -1,9 +1,9 @@ #!/bin/bash -# $1 - sudo binary -# $2 - bindir -# $3 - gnunetdns group -$1 chown root $2/gnunet-helper-dns || true -$1 chgrp $3 $2/gnunet-helper-dns || true -$1 chmod 4750 $2/gnunet-helper-dns || true -$1 chown gnunet:$3 $2/gnunet-service-dns || true -$1 chmod 2750 $2/gnunet-service-dns || true +# $1 - bindir +# $2 - gnunetdns group +# $3 - sudo binary (optional) +$3 chown root $1/gnunet-helper-dns || true +$3 chgrp $2 $1/gnunet-helper-dns || true +$3 chmod 4750 $1/gnunet-helper-dns || true +$3 chown gnunet:$2 $1/gnunet-service-dns || true +$3 chmod 2750 $1/gnunet-service-dns || true diff --git a/src/exit/Makefile.am b/src/exit/Makefile.am index b0b36c661..bc41e5c2c 100644 --- a/src/exit/Makefile.am +++ b/src/exit/Makefile.am @@ -18,7 +18,7 @@ dist_pkgcfg_DATA = \ if LINUX EXITBIN = gnunet-helper-exit install-exec-hook: - $(top_srcdir)/src/exit/install-exit-helper.sh $(SUDO_BINARY) $(bindir) || true + $(top_srcdir)/src/exit/install-exit-helper.sh $(bindir) $(SUDO_BINARY) || true else install-exec-hook: endif diff --git a/src/exit/install-exit-helper.sh b/src/exit/install-exit-helper.sh index afe37ec5e..76af4efa7 100644 --- a/src/exit/install-exit-helper.sh +++ b/src/exit/install-exit-helper.sh @@ -1,5 +1,5 @@ -#!/bin/bash -# $1 - sudo binary -# $2 - bindir -$1 chown root:root $2/gnunet-helper-exit || true -$1 chmod u+s $2/gnunet-helper-exit || true +#!/bin/bash +# $1 - bindir +# $2 - sudo binary (optional) +$2 chown root:root $1/gnunet-helper-exit || true +$2 chmod u+s $1/gnunet-helper-exit || true diff --git a/src/nat/Makefile.am b/src/nat/Makefile.am index e706a3a00..e4b36caa2 100644 --- a/src/nat/Makefile.am +++ b/src/nat/Makefile.am @@ -12,18 +12,12 @@ pkgcfgdir= $(pkgdatadir)/config.d/ dist_pkgcfg_DATA = \ nat.conf - -if ENABLE_TEST_RUN - nattest = $(bindir)/gnunet-nat-server -endif - - if LINUX NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client NATSERVER = gnunet-helper-nat-server.c NATCLIENT = gnunet-helper-nat-client.c install-exec-hook: - $(top_srcdir)/src/nat/install-nat-helper.sh $(SUDO_BINARY) $(bindir) $(nattest) || true + $(top_srcdir)/src/nat/install-nat-helper.sh $(bindir) $(SUDO_BINARY) || true else install-exec-hook: endif diff --git a/src/nat/install-nat-helper.sh b/src/nat/install-nat-helper.sh index 158c9fb15..502aa71f1 100644 --- a/src/nat/install-nat-helper.sh +++ b/src/nat/install-nat-helper.sh @@ -1,6 +1,5 @@ #!/bin/bash -# $1 - sudo binary -# $2 - bindir -# $3 - nattest -$1 chown root:root $2/gnunet-helper-nat-server $2/gnunet-helper-nat-client $3 || true -$1 chmod u+s $2/gnunet-helper-nat-server $2/gnunet-helper-nat-client $3 || true +# $1 - bindir +# $2 - sudo binary (optional) +$2 chown root:root $1/gnunet-helper-nat-server $1/gnunet-helper-nat-client || true +$2 chmod u+s $1/gnunet-helper-nat-server $1/gnunet-helper-nat-client || true diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index afbd10932..bee00d354 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -47,7 +47,7 @@ endif if LINUX install-exec-hook: - $(top_srcdir)/src/transport/install-wlan-helper.sh $(SUDO_BINARY) $(bindir) || true + $(top_srcdir)/src/transport/install-wlan-helper.sh $(bindir) $(SUDO_BINARY) || true else install-exec-hook: endif diff --git a/src/transport/install-wlan-helper.sh b/src/transport/install-wlan-helper.sh index 30258b8ce..54b3360be 100644 --- a/src/transport/install-wlan-helper.sh +++ b/src/transport/install-wlan-helper.sh @@ -1,5 +1,5 @@ #!/bin/bash -# $1 - sudo binary -# $2 - bindir -$1 chown root:root $2/gnunet-helper-transport-wlan || true -$1 chmod u+s $2/gnunet-helper-transport-wlan || true +# $1 - bindir +# $2 - sudo binary (optional) +$2 chown root:root $1/gnunet-helper-transport-wlan || true +$2 chmod u+s $1/gnunet-helper-transport-wlan || true diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index 2826028e8..e7802bc9a 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am @@ -18,7 +18,7 @@ pkgcfg_DATA = \ if LINUX VPNBIN = gnunet-helper-vpn install-exec-hook: - $(top_srcdir)/src/nat/install-vpn-helper.sh $(SUDO_BINARY) $(bindir) || true + $(top_srcdir)/src/vpn/install-vpn-helper.sh $(bindir) $(SUDO_BINARY) || true else install-exec-hook: endif diff --git a/src/vpn/install-vpn-helper.sh b/src/vpn/install-vpn-helper.sh index fbef41c7e..0996e7839 100644 --- a/src/vpn/install-vpn-helper.sh +++ b/src/vpn/install-vpn-helper.sh @@ -1,5 +1,5 @@ #!/bin/bash -# $1 - sudo binary -# $2 - bindir -$1 chown root:root $2/gnunet-helper-vpn || true -$1 chmod u+s $2/gnunet-helper-vpn || true +# $1 - bindir +# $2 - sudo binary (optional) +$2 chown root:root $1/gnunet-helper-vpn || true +$2 chmod u+s $1/gnunet-helper-vpn || true -- 2.25.1