AM_CONDITIONAL([HAVE_SUDO], [test "x$SUDO_BINARY" != "x" -o -w /])
-# test for nssdir
-AC_MSG_CHECKING(with nssdir)
-AC_ARG_WITH(nssdir,
- [ --with-nssdir=PATH where to install NSS plugins],
- [AC_MSG_RESULT("$with_nssdir")
- case $with_nssdir in
- no)
- NSS_DIR=
- install_nss=0
- ;;
- yes)
- NSS_DIR="/lib"
- install_nss=1
- ;;
- *)
- NSS_DIR=$with_nssdir
- install_nss=1
- ;;
- esac
- ],
- [
-# This test is inappropriate when installation with DESTDIR is
-# run much later and uid will be root when needed. Enabling this
-# code breaks the gnunet.ebuild for gentoo.
-#
-# if test "x$SUDO_BINARY" != "x" -o -w /
-# then
- NSS_DIR="/lib"
- install_nss=1
- AC_MSG_RESULT([yes, to /lib])
-# else
-# NSS_DIR=
-# install_nss=0
-# AC_MSG_RESULT([no])
-# fi
- ])
-AC_SUBST(NSS_DIR)
-AM_CONDITIONAL([INSTALL_NSS], [test "x$install_nss" != "x0"])
-
# test for gnunetdns group name
GNUNETDNS_GROUP=gnunetdns
AC_MSG_CHECKING(for gnunetdns group name)
AC_MSG_NOTICE([Mac OS X framework build enabled.])
fi
-if test "x$install_nss" = "x0"
-then
- AC_MSG_NOTICE([WARNING: Will not install GNS NSS library])
-else
- AC_MSG_NOTICE([NOTICE: Will install GNS NSS library to $NSS_DIR])
-fi
-
-
AC_MSG_NOTICE([********************************************
Please make sure NOW that you have created a user and group 'gnunet'
and additionally a group 'gnunetdns'. On Debian and Ubuntu GNU/Linux, type:
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
# USA.
-EXTRA_DIST = map-file \
- install-nss-plugin.sh \
- uninstall-nss-plugin.sh
+EXTRA_DIST = map-file
AM_LDFLAGS=-avoid-version -module -export-dynamic
-nssdir = $(NSS_DIR)
-
-LIBTOOL = $(LIBTOOL_SUDO_BINARY) $(SHELL) $(top_builddir)/libtool
+nssdir = $(libdir)/gnunet/nss
if !MINGW
-if INSTALL_NSS
nss_LTLIBRARIES = \
libnss_gns.la \
libnss_gns4.la \
libnss_gns6.la
-
-install-nssLTLIBRARIES:
- LIBTOOL_SUDO_BINARY=$(SUDO_BINARY)
-uninstall-nssLTLIBRARIES:
- LIBTOOL_SUDO_BINARY=$(SUDO_BINARY)
-endif
endif
sources = nss_gns_query.h nss_gns_query.c
libnss_gns6_la_CFLAGS=$(libnss_gns_la_CFLAGS) -DNSS_IPV6_ONLY=1
libnss_gns6_la_LDFLAGS=$(libnss_gns_la_LDFLAGS)
-if INSTALL_NSS
-if !MINGW
-install-data-hook:
- $(top_srcdir)/src/gns/nss/install-nss-plugin.sh $(SHELL) $(top_builddir) $(DESTDIR)$(nssdir) $(SUDO_BINARY)
-
-uninstall-hook:
- $(top_srcdir)/src/gns/nss/uninstall-nss-plugin.sh $(SHELL) $(top_builddir) "rm -f $(nssdir)/libnss_gns.so.2" $(SUDO_BINARY)
- $(top_srcdir)/src/gns/nss/uninstall-nss-plugin.sh $(SHELL) $(top_builddir) "rm -f $(nssdir)/libnss_gns4.so.2" $(SUDO_BINARY)
- $(top_srcdir)/src/gns/nss/uninstall-nss-plugin.sh $(SHELL) $(top_builddir) "rm -f $(nssdir)/libnss_gns6.so.2" $(SUDO_BINARY)
-endif
-endif
check_config ()
{
char *hostname;
- unsigned int i;
struct sockaddr_in v4;
struct sockaddr_in6 v6;
"resolver");
return GNUNET_SYSERR;
}
- if ((1 == inet_pton (AF_INET, hostname, &v4)) ||
- (1 == inet_pton (AF_INET6, hostname, &v6)))
+ if ( (1 == inet_pton (AF_INET, hostname, &v4)) ||
+ (1 == inet_pton (AF_INET6, hostname, &v6)) )
{
GNUNET_free (hostname);
return GNUNET_OK;
}
- i = 0;
- while (NULL != loopback[i])
- if (0 == strcasecmp (loopback[i++], hostname))
+ for (unsigned int i = 0;
+ NULL != loopback[i];
+ i++)
+ if (0 == strcasecmp (loopback[i], hostname))
{
GNUNET_free (hostname);
return GNUNET_OK;
static void
check_disconnect ()
{
- struct GNUNET_RESOLVER_RequestHandle *rh;
-
- for (rh = req_head; NULL != rh; rh = rh->next)
+ for (struct GNUNET_RESOLVER_RequestHandle *rh = req_head;
+ NULL != rh;
+ rh = rh->next)
if (GNUNET_SYSERR != rh->was_transmitted)
return;
if (NULL != r_task)
if (ip_len != sizeof (struct in_addr))
return NULL;
if (NULL ==
- inet_ntop (AF_INET, ip, buf, sizeof (buf)))
+ inet_ntop (AF_INET,
+ ip,
+ buf,
+ sizeof (buf)))
{
LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING,
"inet_ntop");
if (ip_len != sizeof (struct in6_addr))
return NULL;
if (NULL ==
- inet_ntop (AF_INET6, ip, buf, sizeof (buf)))
+ inet_ntop (AF_INET6,
+ ip,
+ buf,
+ sizeof (buf)))
{
LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING,
"inet_ntop");
msg->direction = htonl (rh->direction);
msg->af = htonl (rh->af);
GNUNET_memcpy (&msg[1],
- &rh[1],
- rh->data_len);
+ &rh[1],
+ rh->data_len);
LOG (GNUNET_ERROR_TYPE_DEBUG,
"Transmitting DNS resolution request to DNS service\n");
GNUNET_MQ_send (mq,
v6.sin6_len = sizeof (v6);
#endif
hostname = (const char *) &rh[1];
- if (((rh->af == AF_UNSPEC) || (rh->af == AF_INET)) &&
- (1 == inet_pton (AF_INET, hostname, &v4.sin_addr)))
+ if ( ( (rh->af == AF_UNSPEC) ||
+ (rh->af == AF_INET) ) &&
+ (1 == inet_pton (AF_INET,
+ hostname,
+ &v4.sin_addr)) )
{
rh->addr_callback (rh->cls,
(const struct sockaddr *) &v4,
sizeof (v4));
- if ((rh->af == AF_UNSPEC) &&
- (1 == inet_pton (AF_INET6, hostname, &v6.sin6_addr)))
+ if ( (rh->af == AF_UNSPEC) &&
+ (1 == inet_pton (AF_INET6,
+ hostname,
+ &v6.sin6_addr)) )
{
/* this can happen on some systems IF "hostname" is "localhost" */
rh->addr_callback (rh->cls,
{
struct GNUNET_RESOLVER_RequestHandle *rh;
size_t slen;
- unsigned int i;
struct in_addr v4;
struct in6_addr v6;
rh->timeout = GNUNET_TIME_relative_to_absolute (timeout);
rh->direction = GNUNET_NO;
/* first, check if this is a numeric address */
- if (((1 == inet_pton (AF_INET, hostname, &v4)) &&
- ((af == AF_INET) || (af == AF_UNSPEC))) ||
- ((1 == inet_pton (AF_INET6, hostname, &v6)) &&
- ((af == AF_INET6) || (af == AF_UNSPEC))))
+ if ( ( (1 == inet_pton (AF_INET,
+ hostname,
+ &v4)) &&
+ ( (af == AF_INET) ||
+ (af == AF_UNSPEC) ) ) ||
+ ( (1 == inet_pton (AF_INET6,
+ hostname,
+ &v6)) &&
+ ( (af == AF_INET6) ||
+ (af == AF_UNSPEC)) ) )
{
rh->task = GNUNET_SCHEDULER_add_now (&numeric_resolution,
rh);
return rh;
}
/* then, check if this is a loopback address */
- i = 0;
- while (NULL != loopback[i])
- if (0 == strcasecmp (loopback[i++],
+ for (unsigned int i = 0;
+ NULL != loopback[i];
+ i++)
+ if (0 == strcasecmp (loopback[i],
hostname))
{
rh->task = GNUNET_SCHEDULER_add_now (&loopback_resolution,
rh->af = sa->sa_family;
rh->timeout = GNUNET_TIME_relative_to_absolute (timeout);
GNUNET_memcpy (&rh[1],
- ip,
- ip_len);
+ ip,
+ ip_len);
rh->data_len = ip_len;
rh->direction = GNUNET_YES;
rh->received_response = GNUNET_NO;
{
char hostname[GNUNET_OS_get_hostname_max_length () + 1];
- if (0 != gethostname (hostname, sizeof (hostname) - 1))
+ if (0 != gethostname (hostname,
+ sizeof (hostname) - 1))
{
LOG_STRERROR (GNUNET_ERROR_TYPE_ERROR | GNUNET_ERROR_TYPE_BULK,
"gethostname");
int ret;
char *rval;
- if (0 != (ret = getaddrinfo (hostname, NULL, NULL, &ai)))
+ if (0 != (ret = getaddrinfo (hostname,
+ NULL,
+ NULL,
+ &ai)))
{
LOG (GNUNET_ERROR_TYPE_ERROR,
_("Could not resolve our FQDN: %s\n"),
{
struct hostent *host;
- host = gethostbyname2 (hostname, AF_INET);
+ host = gethostbyname2 (hostname,
+ AF_INET);
if (NULL == host)
- host = gethostbyname2 (hostname, AF_INET6);
+ host = gethostbyname2 (hostname,
+ AF_INET6);
if (NULL == host)
{
LOG (GNUNET_ERROR_TYPE_ERROR,