From: Christian Grothoff Date: Wed, 2 Nov 2011 15:37:42 +0000 (+0000) Subject: fixing #1820 X-Git-Tag: initial-import-from-subversion-38251~16096 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=d825f9ccd99b0b74278c8773ee6fba2d7974a1a9;p=oweals%2Fgnunet.git fixing #1820 --- diff --git a/README b/README index ce7393ba8..978ae2916 100644 --- a/README +++ b/README @@ -84,6 +84,13 @@ configuration file slightly so that data can be stored in "/var/lib/gnunet"; you may also want to use "/etc/gnunet.conf" for the location of the configuration file in this case. +You can avoid running 'make install' as root if you run configure +with the "--with-sudo=yes" option and have extensive sudo rights +(can run chmod +s and chown via sudo). If you run 'make install' +as a normal user without sudo rights (or the configure option), +certain binaries that require additional priviledges will not be +installed properly (and NAT traversal, WLAN and VPN will not work). + Note that additional, per-user configuration files (~/.gnunet/gnunet.conf) need to be created by each user (for example, by running gnunet-setup). Note that gnunet-setup is a separate diff --git a/configure.ac b/configure.ac index c12b2f414..148c827bc 100644 --- a/configure.ac +++ b/configure.ac @@ -676,6 +676,27 @@ AC_SUBST(DLLDIR) AC_SUBST(EXT_LIB_PATH) +# test for sudo +AC_MSG_CHECKING(for sudo) +AC_ARG_WITH(sudo, + [ --with-sudo=PATH path to sudo binary (or just yes)], + [AC_MSG_RESULT("$with_sudo") + case $with_sudo in + no) + SUDO_BINARY= + ;; + yes) + SUDO_BINARY=sudo + ;; + *) + SUDO_BINARY=$with_sudo + ;; + esac + ], + [AC_MSG_RESULT([no])]) +AC_SUBST(SUDO_BINARY) + + # should 'make check' run tests? AC_MSG_CHECKING(whether to run tests) AC_ARG_ENABLE([testruns], diff --git a/src/nat/Makefile.am b/src/nat/Makefile.am index 97758df62..5adab1ae5 100644 --- a/src/nat/Makefile.am +++ b/src/nat/Makefile.am @@ -18,8 +18,8 @@ NATBIN = gnunet-helper-nat-server gnunet-helper-nat-client NATSERVER = gnunet-helper-nat-server.c NATCLIENT = gnunet-helper-nat-client.c install-exec-hook: - chown root:root $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true - chmod u+s $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true + $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true + $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-nat-server $(bindir)/gnunet-helper-nat-client $(nattest) || true else install-exec-hook: endif diff --git a/src/transport/Makefile.am b/src/transport/Makefile.am index 2b86a05ba..06bea95ba 100644 --- a/src/transport/Makefile.am +++ b/src/transport/Makefile.am @@ -40,8 +40,8 @@ endif if LINUX install-exec-hook: - chown root:root $(bindir)/gnunet-transport-wlan-helper || true - chmod u+s $(bindir)/gnunet-transport-wlan-helper || true + $(SUDO_BINARY) chown root:root $(bindir)/gnunet-transport-wlan-helper || true + $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-transport-wlan-helper || true else install-exec-hook: endif diff --git a/src/vpn/Makefile.am b/src/vpn/Makefile.am index 0c61aa904..d0abc6522 100644 --- a/src/vpn/Makefile.am +++ b/src/vpn/Makefile.am @@ -12,10 +12,10 @@ if LINUX VPNBIN = gnunet-helper-vpn HIJACKBIN = gnunet-helper-hijack-dns install-exec-hook: - chown root:root $(bindir)/gnunet-helper-vpn || true - chmod u+s $(bindir)/gnunet-helper-vpn || true - chown root:root $(bindir)/gnunet-helper-hijack-dns || true - chmod u+s $(bindir)/gnunet-helper-hijack-dns || true + $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-vpn || true + $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-vpn || true + $(SUDO_BINARY) chown root:root $(bindir)/gnunet-helper-hijack-dns || true + $(SUDO_BINARY) chmod u+s $(bindir)/gnunet-helper-hijack-dns || true else install-exec-hook: endif