From c682cce27c2d949f2b2cabe04b8edb7e0b626846 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Mon, 2 Jun 2008 12:08:05 +0000 Subject: [PATCH] nss-ldap overlay, built with nss-ldapd-0.6.2 --- contrib/slapd-modules/nssov/Makefile | 49 + contrib/slapd-modules/nssov/README | 82 + contrib/slapd-modules/nssov/alias.c | 114 + contrib/slapd-modules/nssov/ether.c | 165 + contrib/slapd-modules/nssov/group.c | 335 + contrib/slapd-modules/nssov/host.c | 159 + contrib/slapd-modules/nssov/netgroup.c | 197 + contrib/slapd-modules/nssov/network.c | 159 + contrib/slapd-modules/nssov/nss-ldapd/AUTHORS | 76 + contrib/slapd-modules/nssov/nss-ldapd/COPYING | 504 + .../slapd-modules/nssov/nss-ldapd/ChangeLog | 3854 +++++ contrib/slapd-modules/nssov/nss-ldapd/HACKING | 154 + contrib/slapd-modules/nssov/nss-ldapd/INSTALL | 237 + .../slapd-modules/nssov/nss-ldapd/Makefile.am | 93 + .../slapd-modules/nssov/nss-ldapd/Makefile.in | 713 + contrib/slapd-modules/nssov/nss-ldapd/NEWS | 2002 +++ contrib/slapd-modules/nssov/nss-ldapd/README | 317 + contrib/slapd-modules/nssov/nss-ldapd/TODO | 59 + .../slapd-modules/nssov/nss-ldapd/aclocal.m4 | 903 + .../nssov/nss-ldapd/common/Makefile.am | 28 + .../nssov/nss-ldapd/common/Makefile.in | 447 + .../nssov/nss-ldapd/common/dict.c | 267 + .../nssov/nss-ldapd/common/dict.h | 75 + .../nssov/nss-ldapd/common/set.c | 64 + .../nssov/nss-ldapd/common/set.h | 65 + .../nssov/nss-ldapd/common/tio.c | 488 + .../nssov/nss-ldapd/common/tio.h | 81 + .../nssov/nss-ldapd/compat/Makefile.am | 31 + .../nssov/nss-ldapd/compat/Makefile.in | 445 + .../nssov/nss-ldapd/compat/attrs.h | 91 + .../nssov/nss-ldapd/compat/daemon.c | 71 + .../nssov/nss-ldapd/compat/daemon.h | 31 + .../nssov/nss-ldapd/compat/ether.c | 52 + .../nssov/nss-ldapd/compat/ether.h | 49 + .../nssov/nss-ldapd/compat/getopt_long.c | 92 + .../nssov/nss-ldapd/compat/getopt_long.h | 50 + .../nssov/nss-ldapd/compat/getpeercred.c | 106 + .../nssov/nss-ldapd/compat/getpeercred.h | 35 + .../nssov/nss-ldapd/compat/pagectrl.c | 217 + .../nssov/nss-ldapd/compat/pagectrl.h | 45 + contrib/slapd-modules/nssov/nss-ldapd/compile | 142 + .../nssov/nss-ldapd/config.guess | 1526 ++ .../slapd-modules/nssov/nss-ldapd/config.h.in | 338 + .../slapd-modules/nssov/nss-ldapd/config.sub | 1658 ++ .../slapd-modules/nssov/nss-ldapd/configure | 13713 ++++++++++++++++ .../nssov/nss-ldapd/configure.ac | 350 + contrib/slapd-modules/nssov/nss-ldapd/depcomp | 589 + .../slapd-modules/nssov/nss-ldapd/install-sh | 519 + .../nssov/nss-ldapd/m4/acx_pthread.m4 | 279 + .../nssov/nss-ldapd/man/Makefile.am | 35 + .../nssov/nss-ldapd/man/Makefile.in | 450 + .../slapd-modules/nssov/nss-ldapd/man/nslcd.8 | 54 + .../nssov/nss-ldapd/man/nslcd.8.xml | 132 + .../nssov/nss-ldapd/man/nss-ldapd.conf.5 | 282 + .../nssov/nss-ldapd/man/nss-ldapd.conf.5.xml | 652 + contrib/slapd-modules/nssov/nss-ldapd/missing | 367 + .../nssov/nss-ldapd/mkinstalldirs | 161 + .../nssov/nss-ldapd/nslcd-common.h | 305 + contrib/slapd-modules/nssov/nss-ldapd/nslcd.h | 204 + .../nssov/nss-ldapd/nslcd/Makefile.am | 36 + .../nssov/nss-ldapd/nslcd/Makefile.in | 490 + .../nssov/nss-ldapd/nslcd/alias.c | 146 + .../nssov/nss-ldapd/nslcd/attmap.c | 208 + .../nssov/nss-ldapd/nslcd/attmap.h | 86 + .../slapd-modules/nssov/nss-ldapd/nslcd/cfg.c | 839 + .../slapd-modules/nssov/nss-ldapd/nslcd/cfg.h | 140 + .../nssov/nss-ldapd/nslcd/common.c | 139 + .../nssov/nss-ldapd/nslcd/common.h | 162 + .../nssov/nss-ldapd/nslcd/ether.c | 203 + .../nssov/nss-ldapd/nslcd/group.c | 384 + .../nssov/nss-ldapd/nslcd/host.c | 191 + .../slapd-modules/nssov/nss-ldapd/nslcd/log.c | 193 + .../slapd-modules/nssov/nss-ldapd/nslcd/log.h | 63 + .../nssov/nss-ldapd/nslcd/myldap.c | 1521 ++ .../nssov/nss-ldapd/nslcd/myldap.h | 125 + .../nssov/nss-ldapd/nslcd/netgroup.c | 240 + .../nssov/nss-ldapd/nslcd/network.c | 190 + .../nssov/nss-ldapd/nslcd/nslcd.c | 634 + .../nssov/nss-ldapd/nslcd/passwd.c | 520 + .../nssov/nss-ldapd/nslcd/protocol.c | 180 + .../slapd-modules/nssov/nss-ldapd/nslcd/rpc.c | 181 + .../nssov/nss-ldapd/nslcd/service.c | 235 + .../nssov/nss-ldapd/nslcd/shadow.c | 284 + .../nssov/nss-ldapd/nss-ldapd.conf | 138 + .../nssov/nss-ldapd/nss/Makefile.am | 50 + .../nssov/nss-ldapd/nss/Makefile.in | 473 + .../nssov/nss-ldapd/nss/aliases.c | 73 + .../nssov/nss-ldapd/nss/common.c | 85 + .../nssov/nss-ldapd/nss/common.h | 211 + .../nssov/nss-ldapd/nss/ethers.c | 83 + .../nssov/nss-ldapd/nss/exports.linux | 85 + .../slapd-modules/nssov/nss-ldapd/nss/group.c | 159 + .../slapd-modules/nssov/nss-ldapd/nss/hosts.c | 233 + .../nssov/nss-ldapd/nss/netgroup.c | 123 + .../nssov/nss-ldapd/nss/networks.c | 142 + .../nssov/nss-ldapd/nss/passwd.c | 83 + .../nssov/nss-ldapd/nss/protocols.c | 76 + .../nssov/nss-ldapd/nss/prototypes.h | 169 + .../slapd-modules/nssov/nss-ldapd/nss/rpc.c | 76 + .../nssov/nss-ldapd/nss/services.c | 81 + .../nssov/nss-ldapd/nss/shadow.c | 75 + .../nssov/nss-ldapd/tests/Makefile.am | 90 + .../nssov/nss-ldapd/tests/Makefile.in | 930 ++ .../nssov/nss-ldapd/tests/nss-ldapd-test.conf | 28 + .../nssov/nss-ldapd/tests/test_aliases.c | 94 + .../nssov/nss-ldapd/tests/test_cfg.c | 245 + .../nssov/nss-ldapd/tests/test_dict.c | 198 + .../nssov/nss-ldapd/tests/test_ethers.c | 98 + .../nssov/nss-ldapd/tests/test_group.c | 119 + .../nssov/nss-ldapd/tests/test_hosts.c | 163 + .../nssov/nss-ldapd/tests/test_myldap.c | 425 + .../nssov/nss-ldapd/tests/test_myldap.sh | 42 + .../nssov/nss-ldapd/tests/test_netgroup.c | 99 + .../nssov/nss-ldapd/tests/test_networks.c | 113 + .../nssov/nss-ldapd/tests/test_nslcd_group.c | 135 + .../nssov/nss-ldapd/tests/test_nsscmds.sh | 379 + .../nssov/nss-ldapd/tests/test_passwd.c | 112 + .../nssov/nss-ldapd/tests/test_protocols.c | 102 + .../nssov/nss-ldapd/tests/test_rpc.c | 102 + .../nssov/nss-ldapd/tests/test_services.c | 104 + .../nssov/nss-ldapd/tests/test_set.c | 66 + .../nssov/nss-ldapd/tests/test_shadow.c | 97 + .../nssov/nss-ldapd/tests/test_tio.c | 303 + .../nssov/nss-ldapd/tests/usernames.txt | 2500 +++ contrib/slapd-modules/nssov/nssov.c | 755 + contrib/slapd-modules/nssov/nssov.h | 284 + contrib/slapd-modules/nssov/passwd.c | 432 + contrib/slapd-modules/nssov/protocol.c | 153 + contrib/slapd-modules/nssov/rpc.c | 156 + contrib/slapd-modules/nssov/service.c | 248 + contrib/slapd-modules/nssov/shadow.c | 255 + 131 files changed, 53390 insertions(+) create mode 100644 contrib/slapd-modules/nssov/Makefile create mode 100644 contrib/slapd-modules/nssov/README create mode 100644 contrib/slapd-modules/nssov/alias.c create mode 100644 contrib/slapd-modules/nssov/ether.c create mode 100644 contrib/slapd-modules/nssov/group.c create mode 100644 contrib/slapd-modules/nssov/host.c create mode 100644 contrib/slapd-modules/nssov/netgroup.c create mode 100644 contrib/slapd-modules/nssov/network.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/AUTHORS create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/COPYING create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/ChangeLog create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/HACKING create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/INSTALL create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/NEWS create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/README create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/TODO create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/aclocal.m4 create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/dict.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/dict.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/set.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/set.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/tio.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/common/tio.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/attrs.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/ether.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/ether.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/getopt_long.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/getopt_long.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/getpeercred.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/getpeercred.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.h create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/compile create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/config.guess create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/config.h.in create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/config.sub create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/configure create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/configure.ac create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/depcomp create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/install-sh create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/m4/acx_pthread.m4 create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8 create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8.xml create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5 create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5.xml create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/missing create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/mkinstalldirs create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd-common.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/alias.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/ether.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/group.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/host.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/log.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/log.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/netgroup.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/network.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/nslcd.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/passwd.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/protocol.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/rpc.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/service.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nslcd/shadow.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss-ldapd.conf create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/aliases.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/common.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/common.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/ethers.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/exports.linux create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/group.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/hosts.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/netgroup.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/networks.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/passwd.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/protocols.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/prototypes.h create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/rpc.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/services.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/nss/shadow.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.am create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.in create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/nss-ldapd-test.conf create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_aliases.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_cfg.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_dict.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_ethers.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_group.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_hosts.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.c create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.sh create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_netgroup.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_networks.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_nslcd_group.c create mode 100755 contrib/slapd-modules/nssov/nss-ldapd/tests/test_nsscmds.sh create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_passwd.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_protocols.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_rpc.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_services.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_set.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_shadow.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/test_tio.c create mode 100644 contrib/slapd-modules/nssov/nss-ldapd/tests/usernames.txt create mode 100644 contrib/slapd-modules/nssov/nssov.c create mode 100644 contrib/slapd-modules/nssov/nssov.h create mode 100644 contrib/slapd-modules/nssov/passwd.c create mode 100644 contrib/slapd-modules/nssov/protocol.c create mode 100644 contrib/slapd-modules/nssov/rpc.c create mode 100644 contrib/slapd-modules/nssov/service.c create mode 100644 contrib/slapd-modules/nssov/shadow.c diff --git a/contrib/slapd-modules/nssov/Makefile b/contrib/slapd-modules/nssov/Makefile new file mode 100644 index 0000000000..1d231ef57d --- /dev/null +++ b/contrib/slapd-modules/nssov/Makefile @@ -0,0 +1,49 @@ +# $OpenLDAP$ +# Copyright 2008 Howard Chu, Symas Corp. All Rights Reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted only as authorized by the OpenLDAP +# Public License. +# +# A copy of this license is available in the file LICENSE in the +# top-level directory of the distribution or, alternatively, at +# . + +# Path to the OpenLDAP source tree +LDAPSRC=../../.. + +# Path to the OpenLDAP object tree - same as above unless +# you're doing out-of-tree builds. +LDAPOBJ=../../.. + +LIBTOOL=$(LDAPOBJ)/libtool +OPT=-g -O2 +CC=gcc + +LDAP_INC=-I$(LDAPOBJ)/include -I$(LDAPSRC)/include -I$(LDAPSRC)/servers/slapd +NLDAPD_INC=-Inss-ldapd +INCS=$(LDAP_INC) $(NLDAPD_INC) + +LDAP_LIB=-lldap_r -llber +LIBS=$(LDAP_LIB) + +all: nssov.la + +XOBJS = tio.lo + +OBJS = alias.lo ether.lo group.lo host.lo netgroup.lo network.lo \ + nssov.lo passwd.lo protocol.lo rpc.lo service.lo shadow.lo + +.SUFFIXES: .c .o .lo + +.c.lo: + $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(INCS) -c $? + +tio.lo: nss-ldapd/common/tio.c + $(LIBTOOL) --mode=compile $(CC) $(OPT) $(DEFS) $(NLDAPD_INC) -c $? + +$(OBJS): nssov.h + +nssov.la: $(OBJS) $(XOBJS) + $(LIBTOOL) --mode=link $(CC) $(OPT) -version-info 0:0:0 \ + -rpath /usr/local/libexec/openldap -module -o $@ $(OBJS) $(XOBJS) $(LIBS) diff --git a/contrib/slapd-modules/nssov/README b/contrib/slapd-modules/nssov/README new file mode 100644 index 0000000000..f0c60aa59e --- /dev/null +++ b/contrib/slapd-modules/nssov/README @@ -0,0 +1,82 @@ +Copyright 2008 Howard Chu, Symas Corp. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted only as authorized by the OpenLDAP +Public License. + +A copy of this license is available in the file LICENSE in the +top-level directory of the distribution or, alternatively, at +. + +This directory contains a slapd overlay, nssov, that handles +NSS lookup requests through a local Unix Domain socket. It uses the +same IPC protocol as Arthur de Jong's nss-ldapd, and a complete +copy of the nss-ldapd source is included here. + +To use this code, you will need the client-side stub library from +nss-ldapd (which resides in nss-ldapd/nss). You will not need the +nslcd daemon; this overlay replaces that part. You should already +be familiar with the RFC2307 and RFC2307bis schema to use this +overlay. See the nss-ldapd/README for more information on the +schema and which features are supported. + +To use the overlay, add: + + include nis.schema + + moduleload nssov.so + ... + + database hdb + ... + overlay nssov + +to your slapd configuration file. (The nis.schema file contains +the original RFC2307 schema. Some modifications will be needed to +use RFC2307bis.) + +The overlay must be configured with Service Search Descriptors (SSDs) +for each NSS service that will be used. SSDs are configured using + + nssov-svc + +where the may be one of + alias + ether + group + host + netgroup + network + passwd + protocol + rpc + service + shadow + +and the must be of the form + ldap:///[][??[][?]] + +The will default to the first suffix of the current database. +The defaults to "subtree". The default depends on which +service is being used. + +If the local database is actually a proxy to a foreign LDAP server, some +mapping of schema may be needed. Some simple attribute substitutions may +be performed using + + nssov-map + +See the nss-ldapd/README for the original attribute names used in this code. + +The overlay also supports dynamic configuration in cn=config. The layout +of the config entry is + + dn: olcOverlay={0}nssov,ocDatabase={1}hdb,cn=config + objectClass: olcOverlayConfig + objectClass: olcNssOvConfig + olcOverlay: {0}nssov + olcNssSvc: passwd ldap:///ou=users,dc=example,dc=com??one + olcNssMap: passwd uid accountName + +which enables the passwd service, and uses the accountName attribute to +fetch what is usually retrieved from the uid attribute. diff --git a/contrib/slapd-modules/nssov/alias.c b/contrib/slapd-modules/nssov/alias.c new file mode 100644 index 0000000000..7ff83034ba --- /dev/null +++ b/contrib/slapd-modules/nssov/alias.c @@ -0,0 +1,114 @@ +/* alias.c - mail alias lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* Vendor-specific attributes and object classes. + * (Mainly from Sun.) + * ( 1.3.6.1.4.1.42.2.27.1.2.5 NAME 'nisMailAlias' SUP top STRUCTURAL + * DESC 'NIS mail alias' + * MUST cn + * MAY rfc822MailMember ) + */ + +/* the basic search filter for searches */ +static struct berval alias_filter = BER_BVC("(objectClass=nisMailAlias)"); + +/* the attributes to request with searches */ +static struct berval alias_keys[] = { + BER_BVC("cn"), + BER_BVC("rfc822MailMember"), + BER_BVNULL +}; + +NSSOV_INIT(alias) + +NSSOV_CBPRIV(alias, + struct berval name; + char buf[256];); + +static int write_alias(nssov_alias_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + struct berval tmparr[2], empty; + struct berval *names, *members; + Attribute *a; + int i; + + /* get the name of the alias */ + if (BER_BVISNULL(&cbp->name)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[0].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"alias entry %s does not contain %s value", + entry->e_name.bv_val,cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val,0 ); + return 0; + } + names = a->a_vals; + } + else + { + names=tmparr; + names[0]=cbp->name; + BER_BVZERO(&names[1]); + } + /* get the members of the alias */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[1].an_desc); + if ( !a ) { + BER_BVZERO( &empty ); + members = ∅ + } else { + members = a->a_vals; + } + /* for each name, write an entry */ + for (i=0;!BER_BVISNULL(&names[i]);i++) + { + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&names[i]); + WRITE_BVARRAY(cbp->fp,members); + } + return 0; +} + +NSSOV_CB(alias) + +NSSOV_HANDLE( + alias,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_alias_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_ALIAS_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + alias,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name);, + Debug(LDAP_DEBUG,"nssov_alias_all()",0,0,0);, + NSLCD_ACTION_ALIAS_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/ether.c b/contrib/slapd-modules/nssov/ether.c new file mode 100644 index 0000000000..3055a2aaa0 --- /dev/null +++ b/contrib/slapd-modules/nssov/ether.c @@ -0,0 +1,165 @@ +/* ether.c - ethernet address lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +struct ether_addr { + uint8_t ether_addr_octet[6]; +}; + +/* ( nisSchema.2.11 NAME 'ieee802Device' SUP top AUXILIARY + * DESC 'A device with a MAC address; device SHOULD be + * used as a structural class' + * MAY macAddress ) + */ + +/* the basic search filter for searches */ +static struct berval ether_filter = BER_BVC("(objectClass=ieee802Device)"); + +/* the attributes to request with searches */ +static struct berval ether_keys[] = { + BER_BVC("cn"), + BER_BVC("macAddress"), + BER_BVNULL +}; + +NSSOV_INIT(ether) + +NSSOV_CBPRIV(ether, + char buf[256]; + struct berval name; + struct berval addr;); + +#define WRITE_ETHER(fp,addr) \ + {int ao[6]; \ + sscanf(addr.bv_val,"%02x:%02x:%02x:%02x:%02x:%02x", \ + &ao[0], &ao[1], &ao[2], &ao[3], &ao[4], &ao[5] );\ + tmpaddr.ether_addr_octet[0] = ao[0]; \ + tmpaddr.ether_addr_octet[1] = ao[1]; \ + tmpaddr.ether_addr_octet[2] = ao[2]; \ + tmpaddr.ether_addr_octet[3] = ao[3]; \ + tmpaddr.ether_addr_octet[4] = ao[4]; \ + tmpaddr.ether_addr_octet[5] = ao[5]; } \ + WRITE_TYPE(fp,tmpaddr,uint8_t[6]); + +static int write_ether(nssov_ether_cbp *cbp,Entry *entry) +{ + int32_t tmpint32; + struct ether_addr tmpaddr; + struct berval tmparr[2], empty; + struct berval *names,*ethers; + Attribute *a; + int i,j; + + /* get the name of the ether entry */ + if (BER_BVISNULL(&cbp->name)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[0].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"ether entry %s does not contain %s value", + entry->e_name.bv_val,cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val,0 ); + return 0; + } + names = a->a_vals; + } + else + { + names=tmparr; + names[0]=cbp->name; + BER_BVZERO(&names[1]); + } + /* get the addresses */ + if (BER_BVISNULL(&cbp->addr)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[1].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"ether entry %s does not contain %s value", + entry->e_name.bv_val,cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val,0 ); + return 0; + } + ethers = a->a_vals; + /* TODO: move parsing of addresses up here */ + } + else + { + ethers=tmparr; + ethers[0]=cbp->addr; + BER_BVZERO(ðers[1]); + } + /* write entries for all names and addresses */ + for (i=0;!BER_BVISNULL(&names[i]);i++) + for (j=0;!BER_BVISNULL(ðers[j]);j++) + { + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&names[i]); + WRITE_ETHER(cbp->fp,ethers[j]); + } + return 0; +} + +NSSOV_CB(ether) + +NSSOV_HANDLE( + ether,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.addr); + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_ether_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_ETHER_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + ether,byether, + struct ether_addr addr; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.name); + READ_TYPE(fp,addr,uint8_t[6]); + cbp.addr.bv_len = snprintf(cbp.buf,sizeof(cbp.buf), "%x:%x:%x:%x:%x:%x", + addr.ether_addr_octet[0], + addr.ether_addr_octet[1], + addr.ether_addr_octet[2], + addr.ether_addr_octet[3], + addr.ether_addr_octet[4], + addr.ether_addr_octet[5]); + cbp.addr.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_ether_byether(%s)",cbp.addr.bv_val,0,0);, + NSLCD_ACTION_ETHER_BYETHER, + nssov_filter_byid(cbp.mi,1,&cbp.addr,&filter) +) + +NSSOV_HANDLE( + ether,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.addr);, + Debug(LDAP_DEBUG_TRACE,"nssov_ether_all()",0,0,0);, + NSLCD_ACTION_ETHER_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/group.c b/contrib/slapd-modules/nssov/group.c new file mode 100644 index 0000000000..4cbdf7b4af --- /dev/null +++ b/contrib/slapd-modules/nssov/group.c @@ -0,0 +1,335 @@ +/* group.c - group lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* for gid_t */ +#include + +/* ( nisSchema.2.2 NAME 'posixGroup' SUP top STRUCTURAL + * DESC 'Abstraction of a group of accounts' + * MUST ( cn $ gidNumber ) + * MAY ( userPassword $ memberUid $ description ) ) + * + * apart from that the above the uniqueMember attributes may be + * supported in a coming release (they map to DNs, which is an extra + * lookup step) + * + * using nested groups (groups that are member of a group) is currently + * not supported, this may be added in a later release + */ + +/* the basic search filter for searches */ +static struct berval group_filter = BER_BVC("(objectClass=posixGroup)"); + +/* the attributes to request with searches */ +static struct berval group_keys[] = { + BER_BVC("cn"), + BER_BVC("userPassword"), + BER_BVC("gidNumber"), + BER_BVC("memberUid"), + BER_BVC("uniqueMember"), + BER_BVNULL +}; + +#define CN_KEY 0 +#define PWD_KEY 1 +#define GID_KEY 2 +#define UID_KEY 3 +#define MEM_KEY 4 + +/* default values for attributes */ +static struct berval default_group_userPassword = BER_BVC("*"); /* unmatchable */ + +NSSOV_CBPRIV(group, + nssov_info *ni; + char buf[256]; + struct berval name; + struct berval gidnum; + struct berval user; + int wantmembers;); + +/* create a search filter for searching a group entry + by member uid, return -1 on errors */ +static int mkfilter_group_bymember(nssov_group_cbp *cbp,struct berval *buf) +{ + struct berval dn; + /* try to translate uid to DN */ + nssov_uid2dn(cbp->op,cbp->ni,&cbp->user,&dn); + if (BER_BVISNULL(&dn)) { + if (cbp->user.bv_len + cbp->mi->mi_filter.bv_len + cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_len + 6 > + buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s))", + cbp->mi->mi_filter.bv_val, cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_val, + cbp->user.bv_val ); + } else { /* also lookup using user DN */ + if (cbp->user.bv_len + cbp->mi->mi_filter.bv_len + cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_len + + dn.bv_len + cbp->mi->mi_attrs[MEM_KEY].an_desc->ad_cname.bv_len + 12 > buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(|(%s=%s)(%s=%s)))", + cbp->mi->mi_filter.bv_val, + cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_val, cbp->user.bv_val, + cbp->mi->mi_attrs[MEM_KEY].an_desc->ad_cname.bv_val, dn.bv_val ); + } + return 0; +} + +NSSOV_INIT(group) + +/* + Checks to see if the specified name is a valid group name. + + This test is based on the definition from POSIX (IEEE Std 1003.1, 2004, + 3.189 Group Name and 3.276 Portable Filename Character Set): + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_189 + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276 + + The standard defines group names valid if they only contain characters from + the set [A-Za-z0-9._-] where the hyphen should not be used as first + character. +*/ +static int isvalidgroupname(struct berval *name) +{ + int i; + + if ( !name->bv_val || !name->bv_len ) + return 0; + /* check first character */ + if ( ! ( (name->bv_val[0]>='A' && name->bv_val[0] <= 'Z') || + (name->bv_val[0]>='a' && name->bv_val[0] <= 'z') || + (name->bv_val[0]>='0' && name->bv_val[0] <= '9') || + name->bv_val[0]=='.' || name->bv_val[0]=='_' ) ) + return 0; + /* check other characters */ + for (i=1;ibv_len;i++) + { + if ( ! ( (name->bv_val[i]>='A' && name->bv_val[i] <= 'Z') || + (name->bv_val[i]>='a' && name->bv_val[i] <= 'z') || + (name->bv_val[i]>='0' && name->bv_val[i] <= '9') || + name->bv_val[i]=='.' || name->bv_val[i]=='_' || name->bv_val[i]=='-') ) + return 0; + } + /* no test failed so it must be good */ + return -1; +} + +static int write_group(nssov_group_cbp *cbp,Entry *entry) +{ + struct berval tmparr[2], tmpgid[2]; + struct berval *names,*gids,*members; + struct berval passwd = {0}; + Attribute *a; + int i,j,nummembers,rc; + + /* get group name (cn) */ + if (BER_BVISNULL(&cbp->name)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[CN_KEY].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"group entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[CN_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + names = a->a_vals; + } + else + { + names=tmparr; + names[0]=cbp->name; + BER_BVZERO(&names[1]); + } + /* get the group id(s) */ + if (BER_BVISNULL(&cbp->gidnum)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[GID_KEY].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"group entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[GID_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + gids = a->a_vals; + } + else + { + gids=tmpgid; + gids[0]=cbp->gidnum; + BER_BVZERO(&gids[1]); + } + /* get group passwd (userPassword) (use only first entry) */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[PWD_KEY].an_desc); + if (a) + get_userpassword(&a->a_vals[0], &passwd); + if (BER_BVISNULL(&passwd)) + passwd=default_group_userPassword; + /* get group members (memberUid&uniqueMember) */ + if (cbp->wantmembers) { + Attribute *b; + i = 0; j = 0; + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[UID_KEY].an_desc); + b = attr_find(entry->e_attrs, cbp->mi->mi_attrs[MEM_KEY].an_desc); + if ( a ) + i += a->a_numvals; + if ( b ) + i += b->a_numvals; + if ( i ) + members = cbp->op->o_tmpalloc( (i+1) * sizeof(struct berval), cbp->op->o_tmpmemctx ); + + if ( a ) { + for (i=0; ia_numvals; i++) { + if (isvalidusername(&a->a_vals[i])) { + ber_dupbv_x(&members[j],&a->a_vals[i],cbp->op->o_tmpmemctx); + j++; + } + } + } + a = b; + if ( a ) { + for (i=0; ia_numvals; i++) { + if (nssov_dn2uid(cbp->op,cbp->ni,&a->a_nvals[i],&members[j])) + j++; + } + } + nummembers = j; + BER_BVZERO(&members[j]); + } else { + members=NULL; + nummembers = 0; + } + /* write entries for all names and gids */ + for (i=0;!BER_BVISNULL(&names[i]);i++) + { + if (!isvalidgroupname(&names[i])) + { + Debug(LDAP_DEBUG_ANY,"nssov: group entry %s contains invalid group name: \"%s\"", + entry->e_name.bv_val,names[i].bv_val,0); + } + else + { + for (j=0;!BER_BVISNULL(&gids[j]);j++) + { + char *tmp; + int tmpint32; + gid_t gid; + gid = strtol(gids[j].bv_val, &tmp, 0); + if ( *tmp ) { + Debug(LDAP_DEBUG_ANY,"nssov: group entry %s contains non-numeric %s value: \"%s\"", + entry->e_name.bv_val, cbp->mi->mi_attrs[GID_KEY].an_desc->ad_cname.bv_val, + names[i].bv_val); + continue; + } + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&names[i]); + WRITE_BERVAL(cbp->fp,&passwd); + WRITE_TYPE(cbp->fp,gid,gid_t); + /* write a list of values */ + WRITE_INT32(cbp->fp,nummembers); + if (nummembers) + { + int k; + for (k=0;kfp,&members[k]); + } + } + } + } + } + /* free and return */ + if (members!=NULL) + ber_bvarray_free_x( members, cbp->op->o_tmpmemctx ); + return rc; +} + +NSSOV_CB(group) + +NSSOV_HANDLE( + group,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf; + if (!isvalidgroupname(&cbp.name)) { + Debug(LDAP_DEBUG_ANY,"nssov_group_byname(%s): invalid group name",cbp.name.bv_val,0,0); + return -1; + } + cbp.wantmembers = 1; + cbp.ni = ni; + BER_BVZERO(&cbp.gidnum); + BER_BVZERO(&cbp.user);, + Debug(LDAP_DEBUG_TRACE,"nslcd_group_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_GROUP_BYNAME, + nssov_filter_byname(cbp.mi,CN_KEY,&cbp.name,&filter) +) + +NSSOV_HANDLE( + group,bygid, + gid_t gid; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_TYPE(fp,gid,gid_t); + cbp.gidnum.bv_val = cbp.buf; + cbp.gidnum.bv_len = snprintf(cbp.buf,sizeof(cbp.buf),"%d",gid); + cbp.wantmembers = 1; + cbp.ni = ni; + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.user);, + Debug(LDAP_DEBUG_TRACE,"nssov_group_bygid(%s)",cbp.gidnum.bv_val,0,0);, + NSLCD_ACTION_GROUP_BYGID, + nssov_filter_byid(cbp.mi,GID_KEY,&cbp.gidnum,&filter) +) + +NSSOV_HANDLE( + group,bymember, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.user.bv_len = tmpint32; + cbp.user.bv_val = cbp.buf; + if (!isvalidusername(&cbp.user)) { + Debug(LDAP_DEBUG_ANY,"nssov_group_bymember(%s): invalid user name",cbp.user.bv_val,0,0); + return -1; + } + cbp.wantmembers = 0; + cbp.ni = ni; + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.gidnum);, + Debug(LDAP_DEBUG_TRACE,"nssov_group_bymember(%s)",cbp.user.bv_val,0,0);, + NSLCD_ACTION_GROUP_BYMEMBER, + mkfilter_group_bymember(&cbp,&filter) +) + +NSSOV_HANDLE( + group,all, + struct berval filter; + /* no parameters to read */ + cbp.wantmembers = 1; + cbp.ni = ni; + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.gidnum);, + Debug(LDAP_DEBUG_TRACE,"nssov_group_all()",0,0,0);, + NSLCD_ACTION_GROUP_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/host.c b/contrib/slapd-modules/nssov/host.c new file mode 100644 index 0000000000..7ccf8247bb --- /dev/null +++ b/contrib/slapd-modules/nssov/host.c @@ -0,0 +1,159 @@ +/* host.c - host lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.6 NAME 'ipHost' SUP top AUXILIARY + * DESC 'Abstraction of a host, an IP device. The distinguished + * value of the cn attribute denotes the host's canonical + * name. Device SHOULD be used as a structural class' + * MUST ( cn $ ipHostNumber ) + * MAY ( l $ description $ manager ) ) + */ + +/* the basic search filter for searches */ +static struct berval host_filter = BER_BVC("(objectClass=ipHost)"); + +/* the attributes to request with searches */ +static struct berval host_keys[] = { + BER_BVC("cn"), + BER_BVC("ipHostNumber"), + BER_BVNULL +}; + +NSSOV_INIT(host) + +NSSOV_CBPRIV(host, + char buf[1024]; + struct berval name; + struct berval addr;); + +/* write a single host entry to the stream */ +static int write_host(nssov_host_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int numaddr,i,numname,dupname; + struct berval name,*names,*addrs; + Attribute *a; + + /* get the most canonical name */ + nssov_find_rdnval( &entry->e_nname, cbp->mi->mi_attrs[0].an_desc, &name ); + /* get the other names for the host */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[0].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"host entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + names = a->a_vals; + numname = a->a_numvals; + /* if the name is not yet found, get the first entry from names */ + if (BER_BVISNULL(&name)) { + name=names[0]; + dupname = 0; + } else { + dupname = -1; + for (i=0; ia_nvals[i])) { + dupname = i; + break; + } + } + } + /* get the addresses */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[1].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"host entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + addrs = a->a_vals; + numaddr = a->a_numvals; + /* write the entry */ + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&name); + if ( dupname >= 0 ) { + WRITE_INT32(cbp->fp,numname-1); + } else { + WRITE_INT32(cbp->fp,numname); + } + for (i=0;ifp,&names[i]); + } + WRITE_INT32(cbp->fp,numaddr); + for (i=0;ifp,&addrs[i]); + } + return 0; +} + +NSSOV_CB(host) + +NSSOV_HANDLE( + host,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.addr); + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_host_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_HOST_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + host,byaddr, + int af; + char addr[64]; + int len=sizeof(addr); + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.name); + READ_ADDRESS(fp,addr,len,af); + /* translate the address to a string */ + if (inet_ntop(af,addr,cbp.buf,sizeof(cbp.buf))==NULL) + { + Debug(LDAP_DEBUG_ANY,"nssov: unable to convert address to string",0,0,0); + return -1; + } + cbp.addr.bv_val = cbp.buf; + cbp.addr.bv_len = strlen(cbp.buf);, + Debug(LDAP_DEBUG_TRACE,"nssov_host_byaddr(%s)",cbp.addr.bv_val,0,0);, + NSLCD_ACTION_HOST_BYADDR, + nssov_filter_byid(cbp.mi,1,&cbp.addr,&filter) +) + +NSSOV_HANDLE( + host,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.addr);, + Debug(LDAP_DEBUG_TRACE,"nssov_host_all()",0,0,0);, + NSLCD_ACTION_HOST_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/netgroup.c b/contrib/slapd-modules/nssov/netgroup.c new file mode 100644 index 0000000000..7fe781e37a --- /dev/null +++ b/contrib/slapd-modules/nssov/netgroup.c @@ -0,0 +1,197 @@ +/* netgroup.c - netgroup lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" +#include + +/* ( nisSchema.2.8 NAME 'nisNetgroup' SUP top STRUCTURAL + * DESC 'Abstraction of a netgroup. May refer to other netgroups' + * MUST cn + * MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) ) + */ + +/* the basic search filter for searches */ +static struct berval netgroup_filter = BER_BVC("(objectClass=nisNetgroup)"); + +/* the attributes to request with searches */ +static struct berval netgroup_keys[] = { + BER_BVC("cn"), + BER_BVC("nisNetgroupTriple"), + BER_BVC("memberNisNetgroup"), + BER_BVNULL +}; + +NSSOV_INIT(netgroup) + +NSSOV_CBPRIV(netgroup, + char buf[256]; + struct berval name;); + +static int write_string_stripspace_len(TFILE *fp,const char *str,int len) +{ + int32_t tmpint32; + int i,j; + DEBUG_PRINT("WRITE_STRING: var="__STRING(str)" string=\"%s\"",str); + if (str==NULL) + { + WRITE_INT32(fp,0); + } + else + { + /* skip leading spaces */ + for (i=0;(str[i]!='\0')&&(isspace(str[i]));i++) + /* nothing else to do */ ; + /* skip trailing spaces */ + for (j=len;(j>i)&&(isspace(str[j-1]));j--) + /* nothing else to do */ ; + /* write length of string */ + WRITE_INT32(fp,j-i); + /* write string itself */ + if (j>i) + { + WRITE(fp,str+i,j-i); + } + } + /* we're done */ + return 0; +} + +#define WRITE_STRING_STRIPSPACE_LEN(fp,str,len) \ + if (write_string_stripspace_len(fp,str,len)) \ + return -1; + +#define WRITE_STRING_STRIPSPACE(fp,str) \ + WRITE_STRING_STRIPSPACE_LEN(fp,str,strlen(str)) + +static int write_netgroup_triple(TFILE *fp,const char *triple) +{ + int32_t tmpint32; + int i; + int hostb,hoste,userb,usere,domainb,domaine; + /* skip leading spaces */ + for (i=0;(triple[i]!='\0')&&(isspace(triple[i]));i++) + /* nothing else to do */ ; + /* we should have a bracket now */ + if (triple[i]!='(') + { + Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): entry does not begin with '(' (entry skipped)",0,0,0); + return 0; + } + i++; + hostb=i; + /* find comma (end of host string) */ + for (;(triple[i]!='\0')&&(triple[i]!=',');i++) + /* nothing else to do */ ; + if (triple[i]!=',') + { + Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)",0,0,0); + return 0; + } + hoste=i; + i++; + userb=i; + /* find comma (end of user string) */ + for (;(triple[i]!='\0')&&(triple[i]!=',');i++) + /* nothing else to do */ ; + if (triple[i]!=',') + { + Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ',' (entry skipped)",0,0,0); + return 0; + } + usere=i; + i++; + domainb=i; + /* find closing bracket (end of domain string) */ + for (;(triple[i]!='\0')&&(triple[i]!=')');i++) + /* nothing else to do */ ; + if (triple[i]!=')') + { + Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): missing ')' (entry skipped)",0,0,0); + return 0; + } + domaine=i; + i++; + /* skip trailing spaces */ + for (;(triple[i]!='\0')&&(isspace(triple[i]));i++) + /* nothing else to do */ ; + /* if anything is left in the string we have a problem */ + if (triple[i]!='\0') + { + Debug(LDAP_DEBUG_ANY,"write_netgroup_triple(): string contains trailing data (entry skipped)",0,0,0); + return 0; + } + /* write strings */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_INT32(fp,NETGROUP_TYPE_TRIPLE); + WRITE_STRING_STRIPSPACE_LEN(fp,triple+hostb,hoste-hostb) + WRITE_STRING_STRIPSPACE_LEN(fp,triple+userb,usere-userb) + WRITE_STRING_STRIPSPACE_LEN(fp,triple+domainb,domaine-domainb) + /* we're done */ + return 0; +} + +static int write_netgroup(nssov_netgroup_cbp *cbp,Entry *entry) +{ + int32_t tmpint32; + int i; + Attribute *a; + + /* get the netgroup triples and member */ + a = attr_find(entry->e_attrs,cbp->mi->mi_attrs[1].an_desc); + if ( a ) { + /* write the netgroup triples */ + for (i=0;ia_numvals;i++) + { + if (write_netgroup_triple(cbp->fp, a->a_vals[i].bv_val)) + return -1; + } + } + a = attr_find(entry->e_attrs,cbp->mi->mi_attrs[2].an_desc); + if ( a ) { + /* write netgroup members */ + for (i=0;ia_numvals;i++) + { + /* write the result code */ + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + /* write triple indicator */ + WRITE_INT32(cbp->fp,NETGROUP_TYPE_NETGROUP); + /* write netgroup name */ + if (write_string_stripspace_len(cbp->fp,a->a_vals[i].bv_val,a->a_vals[i].bv_len)) + return -1; + } + } + /* we're done */ + return 0; +} + +NSSOV_CB(netgroup) + +NSSOV_HANDLE( + netgroup,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf));, + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf; + Debug(LDAP_DEBUG_TRACE,"nssov_netgroup_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_NETGROUP_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) diff --git a/contrib/slapd-modules/nssov/network.c b/contrib/slapd-modules/nssov/network.c new file mode 100644 index 0000000000..4a6260179f --- /dev/null +++ b/contrib/slapd-modules/nssov/network.c @@ -0,0 +1,159 @@ +/* network.c - network address lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +#include + +/* ( nisSchema.2.7 NAME 'ipNetwork' SUP top STRUCTURAL + * DESC 'Abstraction of a network. The distinguished value of + * MUST ( cn $ ipNetworkNumber ) + * MAY ( ipNetmaskNumber $ l $ description $ manager ) ) + */ + +/* the basic search filter for searches */ +static struct berval network_filter = BER_BVC("(objectClass=ipNetwork)"); + +/* the attributes used in searches */ +static struct berval network_keys[] = { + BER_BVC("cn"), + BER_BVC("ipNetworkNumber"), + BER_BVNULL +}; + +NSSOV_INIT(network) + +NSSOV_CBPRIV(network, + char buf[1024]; + struct berval name; + struct berval addr;); + +/* write a single network entry to the stream */ +static int write_network(nssov_network_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int numaddr,i,numname,dupname; + struct berval name, *names, *addrs; + Attribute *a; + + /* get the most canonical name */ + nssov_find_rdnval( &entry->e_nname, cbp->mi->mi_attrs[0].an_desc, &name); + /* get the other names for the network */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[0].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"network entry %s does not contain %s value", + entry->e_name.bv_val,cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val,0); + return 0; + } + names = a->a_vals; + numname = a->a_numvals; + /* if the name is not yet found, get the first entry from names */ + if (BER_BVISNULL(&name)) { + name=names[0]; + dupname = 0; + } else { + dupname = -1; + for (i=0; ia_nvals[i])) { + dupname = i; + break; + } + } + } + /* get the addresses */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[1].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"network entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + addrs = a->a_vals; + numaddr = a->a_numvals; + /* write the entry */ + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&name); + if ( dupname >= 0 ) { + WRITE_INT32(cbp->fp,numname-1); + } else { + WRITE_INT32(cbp->fp,numname); + } + for (i=0;ifp,&names[i]); + } + WRITE_INT32(cbp->fp,numaddr); + for (i=0;ifp,&addrs[i]); + } + return 0; +} + +NSSOV_CB(network) + +NSSOV_HANDLE( + network,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.addr); + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_network_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_NETWORK_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + network,byaddr, + int af; + char addr[64]; + int len=sizeof(addr); + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.name); + READ_ADDRESS(fp,addr,len,af); + /* translate the address to a string */ + if (inet_ntop(af,addr,cbp.buf,sizeof(cbp.buf))==NULL) + { + Debug(LDAP_DEBUG_ANY,"nssov: unable to convert address to string",0,0,0); + return -1; + } + cbp.addr.bv_val = cbp.buf; + cbp.addr.bv_len = strlen(cbp.buf);, + Debug(LDAP_DEBUG_TRACE,"nslcd_network_byaddr(%s)",cbp.addr.bv_val,0,0);, + NSLCD_ACTION_NETWORK_BYADDR, + nssov_filter_byid(cbp.mi,1,&cbp.addr,&filter) +) + +NSSOV_HANDLE( + network,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.addr);, + Debug(LDAP_DEBUG_TRACE,"nssov_network_all()",0,0,0);, + NSLCD_ACTION_NETWORK_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/AUTHORS b/contrib/slapd-modules/nssov/nss-ldapd/AUTHORS new file mode 100644 index 0000000000..e4fe33f802 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/AUTHORS @@ -0,0 +1,76 @@ +The original nss_ldap library was written by Luke Howard of PADL Software Pty +Ltd. In 2006 Arthur de Jong of West Consuling forked the library to split it +into a thin NSS part and a server part. The copyright holders of most of the +code are: + +Luke Howard +West Consulting +Arthur de Jong + +The following people (in no particular order) have also volunteered their +time, effort, and ideas to make this software available. If you feel you are +unjustly left out of this list, please send an email. + +Steven Barrus +David Begley +Maxim Batourine +Michael Brownea +Max Caines +Carlos Celso +Peter Cherny +Howard Chu +Ben Collins +Stephan Cremer +Alejandro Forero Cuervo +Guenther Deschner +Luca Filipozzi +Andrew Findlay +Cristian Gafton +Gabor Gombas +DJ Gregor +Bob Guo +Daniel Hanks +Leif Hedstrom +Emile Heitor +Geert Jansen +Szymon Juraszczyk +Anselm Kruis +Thorsten Kukuk +Steve Langasek +Joe Little +Phillip Liu +Larry Lile +Jeff Mandel +Peter Marschall +Michael Mattice +Dejan Muhamedagic +Doug Nazar +Frode Nordahl +Lars Oergel +Fredrik Ohrn +Rakesh Patel +Nathan Hawkins +Andrew Rechenberg +Greg Retowski +Alain Richard +Michael Shuey +Oliver Schulze L. +Alexander Spannagel +Scott M. Stone +Gero Treuner +Jarkko Turkulainen +Stein Vrale +Simon Wilkinson +Davide Puricelli +Sami Haahtinen +Stephen Frost +Américo Monteiro +Cyril Brulebois +Kenshi Muto +Andreas Schneider +Ralf Haferkamp +Michael Calmer +Erik Schanze +Bart Cornelis +Rudy Godoy Guillén +Petter Reinholdtsen diff --git a/contrib/slapd-modules/nssov/nss-ldapd/COPYING b/contrib/slapd-modules/nssov/nss-ldapd/COPYING new file mode 100644 index 0000000000..5ab7695ab8 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/COPYING @@ -0,0 +1,504 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/ChangeLog b/contrib/slapd-modules/nssov/nss-ldapd/ChangeLog new file mode 100644 index 0000000000..cac95b3abd --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/ChangeLog @@ -0,0 +1,3854 @@ +2008-05-04 15:47 arthur + + * [r727] HACKING, README: some documentation cleanups and updates + +2008-05-04 12:06 arthur + + * [r726] tests/test_nslcd_group.c: add some tests for + isvalidgroupname() + +2008-05-04 10:15 arthur + + * [r725] man/nss-ldapd.conf.5.xml, nslcd/cfg.c, nslcd/cfg.h, + nslcd/nslcd.c: make number of threads configurable with the + threads keyword + +2008-05-04 09:39 arthur + + * [r724] nslcd/myldap.h: add reference to note about + thread-safeness of OpenLDAP + +2008-05-04 09:38 arthur + + * [r723] nslcd/nslcd.c: fix copyright year + +2008-05-03 15:30 arthur + + * [r722] nslcd/passwd.c: implement a cache for dn2uid() lookups + that saves some time doing LDAP searches for groups with a lot of + members, based on a patch by Petter Reinholdtsen + + +2008-05-03 12:04 arthur + + * [r721] debian/libnss-ldapd.nslcd.init: add soft dependency on + slapd, simplify network and file system dependencies and add + reverse dependencies on some common daemons that may want to do + NSS lookups + +2008-05-02 20:52 arthur + + * [r720] nss/netgroup.c, nss/prototypes.h: remove checking for + first entry and always return NSS_STATUS_RETURN when no more data + is available in the netgroup (this has the side effect of not + returning NSS_STATUS_NOTFOUND for non-existing netgroups but + seems to be what other NSS modules do) to properly handle empty + netgroups + +2008-05-02 15:57 arthur + + * [r719] tests, tests/Makefile.am, tests/test_nslcd_group.c: add + file for testing nslcd/group.c + +2008-05-02 15:55 arthur + + * [r718] tests/Makefile.am: don't even compile the test programs on + make check + +2008-05-02 15:39 arthur + + * [r717] tests/Makefile.am: don't compile test code on every build + and fix LDADD lists to include correct objects + +2008-05-02 14:53 arthur + + * [r716] nslcd/cfg.c, nslcd/cfg.h, nslcd/myldap.c: only support + tls-related options if LDAP library supports TLS, only add rebind + code if ldap_set_rebind_proc() is found and only set + LDAP_X_OPT_CONNECT_TIMEOUT if that option is supported + +2008-05-01 07:26 arthur + + * [r715] nslcd/myldap.c: support ranged attribute values + +2008-05-01 06:32 arthur + + * [r714] nss/common.h: fix comment of return value of + NSS_STATUS_TRYAGAIN + +2008-05-01 06:25 arthur + + * [r713] tests/test_myldap.c: fix a warning + +2008-05-01 06:22 arthur + + * [r712] tests/test_myldap.c: ensure that filter_get_var() and + filter_get_var() return non-NULL to enable parsing of config file + with attribute mapping and filter settings and use base from + config file + +2008-04-29 20:03 arthur + + * [r711] man/nss-ldapd.conf.5.xml: make language about pagesize + option a little clearer + +2008-04-27 21:15 arthur + + * [r710] nslcd/cfg.c: support the case where an attribute mapping + variable is NULL + +2008-04-26 14:19 arthur + + * [r709] nslcd/myldap.c: also close the LDAP connection on + LDAP_SERVER_DOWN (besides LDAP_UNAVAILABLE) + +2008-04-26 13:48 arthur + + * [r708] man/nss-ldapd.conf.5.xml, nss/common.c: increase time out + values because now nslcd will error out more quickly if the LDAP + server is known to be unavailable + +2008-04-26 13:46 arthur + + * [r707] nslcd/nslcd.c: spelling fix in comment + +2008-04-26 13:46 arthur + + * [r706] man/nss-ldapd.conf.5.xml: some spelling fixes and a + clarification of the retry mechanism + +2008-04-26 13:20 arthur + + * [r705] nslcd/cfg.c: fix log message of incorrect map statement + +2008-04-26 13:16 arthur + + * [r704] nslcd/passwd.c: make log message a little more descriptive + +2008-04-26 13:16 arthur + + * [r703] configure.ac: fix quote in comment + +2008-04-26 13:13 arthur + + * [r702] nslcd/myldap.c: ensure that the connection to the LDAP + server is closed whenever any of the ldap_*() functions return + LDAP_UNAVAILABLE + +2008-04-25 16:40 arthur + + * [r701] man/nss-ldapd.conf.5.xml, nslcd/cfg.c, nslcd/cfg.h, + nslcd/myldap.c, tests/nss-ldapd-test.conf, tests/test_cfg.c, + tests/test_myldap.c: implement new timing mechanism for retries + to quickly fail lookups to LDAP server that have been failing for + some time, removing the reconnect_tries option and giving + reconnect_sleeptime and reconnect_maxsleeptime options a new + meaning + +2008-04-25 16:38 arthur + + * [r700] tests/test_myldap.c: include missing include + +2008-04-25 16:37 arthur + + * [r699] tests/test_myldap.c: ignore SIGPIPE in myldap tests + +2008-04-25 16:36 arthur + + * [r698] tests/test_myldap.c: fix assert to be test instead of + assignment + +2008-04-25 15:38 arthur + + * [r697] tests/test_myldap.c, tests/test_myldap.sh: have the binary + look up the file name and only use the shell script wrapper to + determine if LDAP server is available + +2008-04-25 12:19 arthur + + * [r696] compat/ether.h: fix typos in references to + HAVE_ETHER_NTOA_R and HAVE_ETHER_ATON_R macros + +2008-04-23 20:53 arthur + + * [r695] tests/test_nsscmds.sh: fix order of members in group in + tests because of new hashing dict (maybe we should fix the script + instead to always sort members properly) + +2008-04-23 20:50 arthur + + * [r694] common/dict.c: fix problem where first item in the + hashtable could be returned twice while looping + +2008-04-23 20:44 arthur + + * [r693] tests/test_dict.c: add test for problem with duplicate + entries being returned while looping over results + +2008-04-23 20:22 arthur + + * [r692] nslcd/passwd.c: don't issue warning when + myldap_get_entry() returns NULL and LDAP_SUCCESS + +2008-04-21 18:22 arthur + + * [r691] common/dict.c: allocate room for key string just after + entry to save on calls to malloc() and make it simpler + +2008-04-20 20:01 arthur + + * [r690] nslcd/group.c, nslcd/passwd.c: fix tests for valid user + and group names + +2008-04-20 19:50 arthur + + * [r689] nslcd/common.h, nslcd/group.c, nslcd/passwd.c: add checks + for valid user and group names in incoming requests and for data + returned from LDAP + +2008-04-20 19:43 arthur + + * [r688] nslcd/group.c: only support uniqueMember containing DN + values + +2008-04-20 14:09 arthur + + * [r687] nslcd/group.c: fix warning message to not refer to alias + +2008-04-20 14:07 arthur + + * [r686] nslcd/myldap.c: make warning message more verbose, fix + comment and don't try to store empty results + +2008-04-19 20:29 arthur + + * [r685] debian/libnss-ldapd.config: only guess the searchbase if + the value doesn't seem to be preseeded (based on a patch by + Petter Reinholdtsen ) + +2008-04-19 20:27 arthur + + * [r684] common/dict.c: fix wrapping and indenting of comments + +2008-04-19 11:04 arthur + + * [r683] nslcd/group.c: correctly call set_free() instead of free() + +2008-04-19 10:38 arthur + + * [r682] nslcd/group.c: use the new set data structure to gather + the group members + +2008-04-19 10:26 arthur + + * [r681] common/Makefile.am, common/set.c, common/set.h, tests, + tests/Makefile.am, tests/test_set.c: implement a set that uses + the dict module as back-end + +2008-04-19 10:22 arthur + + * [r680] common/dict.c: implement new dict module that uses a + hashtable which is around 40 times faster for large (around 2000) + entries but with around 40% more memory used + +2008-04-19 09:33 arthur + + * [r679] tests/Makefile.am, tests/test_dict.c, tests/usernames.txt: + some new tests for the dictionary module + +2008-04-19 06:07 arthur + + * [r678] nslcd/passwd.c: add test for emtpy DN + +2008-04-18 19:57 arthur + + * [r677] nslcd/myldap.c: instead of using the dict module to build + a cache just store the values in an fixed-sized array because no + more than 9 attributes are currently retrieved from an entry and + we never retrieve the same value more than once (so the cache is + useless) + +2008-04-17 21:37 arthur + + * [r676] common/dict.h: add note about freed values + +2008-04-17 21:12 arthur + + * [r675] common/dict.c, common/dict.h, nslcd/myldap.c, + tests/test_dict.c: change dict_values_first() and + dict_values_next() into dict_loop_first() and dict_loop_next() to + have a looping mechanism over keys and values + +2008-04-13 13:20 arthur + + * [r674] tests/nss-ldapd-test.conf: remote hopefully last reference + to rootbind{dn,pw} + +2008-04-06 20:35 arthur + + * [r673] nslcd/common.h: return values of dn2uid() and uid2dn() + should always be used + +2008-04-06 20:31 arthur + + * [r672] nslcd/group.c: properly handle the case where dn2uid() + couldn't do a DN->uid lookup + +2008-04-06 11:18 arthur + + * [r670] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: get files ready for + 0.6.1 release + +2008-04-06 10:50 arthur + + * [r669] config.guess, config.sub: include updated files + +2008-04-05 21:46 arthur + + * [r668] AUTHORS: include Petter Reinholdtsen for reporting many + bugs and even some fixes + +2008-04-05 21:16 arthur + + * [r667] debian/libnss-ldapd.postinst: handle case where value + contains spaces properly + +2008-04-05 21:09 arthur + + * [r666] debian/libnss-ldapd.postinst: support having a binddn set + without a bindpw + +2008-04-05 21:06 arthur + + * [r665] debian/libnss-ldapd.config: fix typo in comment + +2008-04-05 14:37 arthur + + * [r664] debian/libnss-ldapd.config, debian/libnss-ldapd.postinst, + debian/libnss-ldapd.templates, debian/po/ca.po, debian/po/cs.po, + debian/po/da.po, debian/po/de.po, debian/po/es.po, + debian/po/fr.po, debian/po/ja.po, debian/po/nl.po, + debian/po/pt.po, debian/po/pt_BR.po, debian/po/ru.po, + debian/po/sv.po, debian/po/templates.pot, debian/po/vi.po: remove + rootbind{dn,pw} options from packaging because the options are + not likely to be implemented in the future + +2008-04-05 14:25 arthur + + * [r663] nslcd/common.h, nslcd/group.c, nslcd/passwd.c: fix + member->group searches by also searching for DN in uniqueMember + attribute + +2008-04-05 14:22 arthur + + * [r662] nslcd/log.c: make log line a little bigger to properly log + more search filters + +2008-04-05 14:14 arthur + + * [r661] nslcd/nslcd.c: only return shadow entries to root users + +2008-04-05 14:12 arthur + + * [r660] nss/group.c: correctly implement buffer handling in + _nss_ldap_initgroups_dyn() to grow buffer when needed, check + limits and handle extra group parameter (had a closer look at + nis-initgroups.c) + +2008-04-05 14:10 arthur + + * [r659] tests/test_nsscmds.sh: no problem to shout a little with + failed tests + +2008-04-05 13:35 arthur + + * [r658] nss/group.c: properly check the limit (as seen in + nis-initgroups.c) + +2008-04-05 11:21 arthur + + * [r657] nslcd/shadow.c: partial support for reading AD date format + for pwdLastSet attribute + +2008-04-05 11:15 arthur + + * [r656] nslcd/myldap.c: split closing of LDAP session to separate + funtion to invalidate running searches always and closes + connection if setting up search failed + +2008-04-05 10:15 arthur + + * [r655] tests/test_group.c: use a larger buffer for group + membership results + +2008-04-05 09:55 arthur + + * [r654] tests/test_myldap.c: check that the last + myldap_get_entry() returned success + +2008-04-04 21:26 arthur + + * [r653] README, man/nss-ldapd.conf.5.xml, nslcd/cfg.c, + nslcd/cfg.h, nslcd/myldap.c, nss-ldapd.conf: remove code that + handles special cases when calling as root (removing rootbinddn, + rootbindpw, rootuse_sasl and rootsasl_authid options) + +2008-04-04 09:40 arthur + + * [r652] nslcd/myldap.c: revert r628 (using ldap_str2dn() instead + of ldap_explode_r?dn()) for now to make this compile on older + versions of OpenLDAP + +2008-04-04 09:16 arthur + + * [r651] man/nss-ldapd.conf.5.xml: add some more documentation to + the pagesize option + +2008-04-02 21:09 arthur + + * [r650] debian/libnss-ldapd.nslcd.init: make start not fail if + nslcd is already running and stop not fail if it wasn't running + before + +2008-03-30 14:37 arthur + + * [r649] nss-ldapd.conf: some fixes to the configuration when using + Active Directory (provided by Petter Reinholdtsen + ) + +2008-03-30 14:33 arthur + + * [r648] configure.ac, nslcd/myldap.c: only define and use + do_sasl_interact() if we have a sasl library + +2008-03-30 14:31 arthur + + * [r647] compat/attrs.h: make test for compiler versions simpler + and per used attribute + +2008-03-29 07:31 arthur + + * [r646] HACKING, README: add contact information on reporting bugs + and contributing patches + +2008-03-29 07:31 arthur + + * [r645] HACKING: add some more notes about the design and + direction I want to go in + +2008-03-28 22:56 arthur + + * [r644] nslcd/myldap.c: don't warn about problems retreiving the + objectClass from en entry + +2008-03-27 22:59 arthur + + * [r643] nslcd/group.c: fix a problem where the newly allocated + storage by realloc() wasn't used (thanks to Petter Reinholdtsen + for the patch) + +2008-03-16 14:51 arthur + + * [r642] debian/libnss-ldapd.config, debian/libnss-ldapd.postinst: + comment out all rootbind{dn,pw} code as to not copy those + directives because they are unsupported + +2008-03-16 14:44 arthur + + * [r641] debian/libnss-ldapd.config: use tail instead of head to + avoid conflicts becase nss_ldap seems to pick up the last option + in the file + +2008-03-16 14:00 arthur + + * [r640] debian/libnss-ldapd.config: handle the case where an + option is defined multiple times + +2008-03-06 06:34 arthur + + * [r639] AUTHORS, debian/copyright, debian/po/es.po: updated + Spanish (es) translation of debconf templates by Rudy Godoy + Guillén + +2008-03-04 21:41 arthur + + * [r638] AUTHORS, debian/po/nl.po: updated Dutch (nl) translation + of debconf templates by Bart Cornelis + +2008-02-19 21:32 arthur + + * [r637] README: some updates to reflect recent changes + +2008-02-19 21:32 arthur + + * [r636] man/Makefile.am: have a better way to specify the manual + page rule + +2008-02-15 16:52 arthur + + * [r635] common/tio.c: split out the flushing of the buffers to + separate functions and see if we can flush some data from the + buffer if it is overflowing before growing the buffer + +2008-02-15 12:35 arthur + + * [r634] nslcd/myldap.c: add StartTLS support by Ralf Haferkamp + + +2008-02-15 12:35 arthur + + * [r633] nslcd/myldap.c: pass URI to do_bind() to make it work with + do_rebind() and use that URI (thanks Ralf Haferkamp + ) + +2008-02-15 09:41 arthur + + * [r632] tests/test_myldap.c: add tests for myldap_get_rdn_value() + and myldap_cpy_rdn_value() + +2008-02-12 21:41 arthur + + * [r631] configure.ac: make using implicit function definitions an + error + +2008-02-12 21:28 arthur + + * [r630] common/tio.c, common/tio.h, nslcd/nslcd.c, nss/common.c, + tests/test_tio.c: implement resizable I/O buffers and tune buffer + sizes to normal requests + +2008-02-12 21:18 arthur + + * [r629] common/tio.c: always allocate the read and write buffers + and make the struct tio_buffer inline in struct tio_fileinfo + +2008-02-10 14:24 arthur + + * [r628] nslcd/myldap.c: replace the calls to ldap_explode_dn() and + ldap_explode_rdn() with a call to ldap_str2dn() resulting in much + simpler code + +2008-02-08 15:49 arthur + + * [r627] nslcd/cfg.c: only support "dns" and "domain" values on + platforms with the necessary functions available + +2008-02-08 15:41 arthur + + * [r626] nslcd/ether.c: don't define struct ether_addr here, it was + moved to compat/ether.h + +2008-02-04 22:47 arthur + + * [r625] nslcd/myldap.c: make some changes to allow it to compile + on more platforms + +2008-02-04 22:38 arthur + + * [r624] compat/Makefile.am, compat/ether.c, compat/ether.h, + configure.ac, nslcd/ether.c: provide replacements for + ether_aton_r() and ether_ntoa_r() for platforms that don't have + them + +2008-02-04 22:32 arthur + + * [r623] configure.ac, nslcd/nslcd.c: only call + __nss_configure_lookup() if it is available, if it isn't the + platform is out of luck + +2008-02-04 22:30 arthur + + * [r622] nslcd/myldap.h: defined LDAP_SCOPE_DEFAULT it's not + defined elsewhere + +2008-02-04 22:29 arthur + + * [r621] nslcd/nslcd.c: fix missing casts + +2008-02-04 22:27 arthur + + * [r620] nslcd/nslcd.c: actually include the compat header files + when needed + +2008-02-03 21:55 arthur + + * [r618] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: get files ready for + 0.6 release + +2008-02-03 11:31 arthur + + * [r617] configure.ac: also check for sasl2 library + +2008-02-03 11:30 arthur + + * [r616] tests/test_myldap.c, tests/test_nsscmds.sh: add tests for + new LDAP lookups + +2008-02-03 11:24 arthur + + * [r615] nslcd/attmap.c, nslcd/attmap.h, nslcd/group.c: support the + uniqueMember LDAP attribute that holds DN values (they are + translated with dn2uid() from passwd.c) + +2008-02-03 11:19 arthur + + * [r614] debian/libnss-ldapd.postinst, debian/libnss-ldapd.postrm, + debian/rules: don't use dh_makeshlibs any more because we don't + need the shlibs file; call ldconfig from maintainer scripts + ourselves + +2008-02-03 10:17 arthur + + * [r613] debian/rules: install the NSS library under /lib instead + of /usr/lib to make it easyer to unmount /usr if it's on a + separate filesystem + +2008-02-02 15:58 arthur + + * [r612] debian/rules: don't pass options to configure which are + not used + +2008-02-02 15:57 arthur + + * [r611] configure.ac: remove --with-ngroups option because it + isn't used + +2008-02-02 15:50 arthur + + * [r610] nslcd/common.h, nslcd/passwd.c: implement a dn2uid() + function to transform a DN into a username (looking inside the DN + or doing an LDAP lookup if neede) + +2008-02-02 15:46 arthur + + * [r609] nslcd/myldap.c, nslcd/myldap.h: implement + myldap_cpy_rdn_value() function to copy rdn value into a buffer + (functionality like myldap_get_rdn_value()) + +2008-02-02 12:02 arthur + + * [r608] nslcd/myldap.c: log and otherwise ignore errors in + ldap_parse_page_control() + +2008-02-02 12:00 arthur + + * [r607] nslcd/myldap.c: fix copy-pasto + +2008-02-02 11:57 arthur + + * [r606] nslcd/myldap.c: don't request paging when doing a search + with scope base and ignore errors of ldap_create_page_control() + +2008-02-02 11:42 arthur + + * [r605] nslcd/myldap.c: reset LDAP error flag if ldap_get_values() + returned an error because some LDAP functions don't do this + correctly + +2008-02-01 22:41 arthur + + * [r604] nslcd/myldap.c: have proper checks and logs of all ldap + operations + +2008-02-01 22:25 arthur + + * [r603] tests/test_group.c: enable _nss_ldap_initgroups_dyn() test + because it's working now + +2008-02-01 22:19 arthur + + * [r602] nslcd-common.h: fix buffer size debug message + +2008-02-01 22:18 arthur + + * [r601] nss/common.h, nss/hosts.c, nss/netgroup.c, nss/networks.c: + do not set errno (and h_errno) if we got the last entry from + get*ent() (this apparently is needed by coreutils' id and groups + commands) + +2008-02-01 22:01 arthur + + * [r600] tests/Makefile.am: pagectrl module has moved + +2008-02-01 21:58 arthur + + * [r599] tests/test_nsscmds.sh: test for hugegroup + +2008-02-01 21:57 arthur + + * [r598] tests/test_nsscmds.sh: the groups command no longer lists + the username + +2008-02-01 19:59 arthur + + * [r597] nss/common.c, nss/common.h, nss/group.c, nss/hosts.c, + nss/netgroup.c, nss/networks.c: remove the nslcd2nss() function + because it's not needed with the current protocol + +2008-02-01 19:32 arthur + + * [r596] nss/common.h: fail with a permanent error if resetting the + stream failed to prevent indefinite retries + +2008-01-31 22:20 arthur + + * [r595] nslcd/myldap.c: defined LDAP_DEPRECATED to also have + definitions for deprecated functions + +2008-01-31 22:11 arthur + + * [r594] compat/attrs.h: only define MUST_USE attribute if gcc + version is more recent than 3.4 + +2008-01-31 22:07 arthur + + * [r593] debian/copyright: update copyright information + +2008-01-31 22:04 arthur + + * [r592] compat/Makefile.am, compat/pagectrl.c, compat/pagectrl.h, + configure.ac, debian/copyright, nslcd/Makefile.am, + nslcd/myldap.c, nslcd/pagectrl.c, nslcd/pagectrl.h: move pagectrl + code into compat directory + +2008-01-31 21:55 arthur + + * [r591] configure.ac: make comments lowercase for consistency + +2008-01-31 21:50 arthur + + * [r590] tests/test_myldap.c: re-add test URIs that accidentally + got commented out in the last commit + +2008-01-31 21:45 arthur + + * [r589] tests/Makefile.am, tests/test_cfg.c, tests/test_myldap.c, + tests/test_nsscmds.sh: pass the correct pthread flags for all + calls to compiler and linker and link in compat code, handle + other assert.h setups and avoid some ! in if statements in shell + scripts + +2008-01-31 21:41 arthur + + * [r588] configure.ac: improve LDAP library autodetection and make + if statements consistent + +2008-01-31 20:59 arthur + + * [r587] configure.ac: move finding of replacement functions to a + more logical place + +2008-01-31 20:58 arthur + + * [r586] configure.ac: define extra macros to import system + extensions from system header files and remove duplicate check + for ldap_set_rebind_proc() + +2008-01-31 20:57 arthur + + * [r585] configure.ac: test to see if the compiler supports certain + -W flags before using them + +2008-01-30 22:40 arthur + + * [r584] nslcd/ether.c: include stdint.h + +2008-01-30 22:36 arthur + + * [r583] nslcd.h, nslcd/ether.c, nss/ethers.c: use uint8_t instead + of u_int8_t because the former seems to be available on more + platforms + +2008-01-30 22:31 arthur + + * [r582] INSTALL, depcomp, install-sh: update some files from + recent automake + +2008-01-30 21:58 arthur + + * [r581] compat/Makefile.am, compat/daemon.c, compat/daemon.h, + compat/getopt_long.c, compat/getopt_long.h, configure.ac: provide + replacement functions for daemon() and getopt_long() when they + are not available on the system + +2008-01-30 21:57 arthur + + * [r580] configure.ac: remove duplicate warning flags + +2008-01-30 21:29 arthur + + * [r579] compat/attrs.h: define __STRING() if it's not defined by + the system + +2008-01-30 21:15 arthur + + * [r578] tests/test_tio.c: include errno in assertion statement + +2008-01-30 21:13 arthur + + * [r577] compat/getpeercred.c: some fixes for LOCAL_PEERCRED (still + untested) + +2008-01-27 20:42 arthur + + * [r576] AUTHORS, debian/po/de.po: updated German (de) translation + of debconf templates by Erik Schanze + +2008-01-27 16:51 arthur + + * [r575] compat/ldap.h, nslcd/Makefile.am, nslcd/myldap.c: + integrate some compatibility code into myldap.c, the only place + it's used + +2008-01-27 10:22 arthur + + * [r573] nslcd/myldap.c: work around some LDAP libraries not having + all options + +2008-01-27 10:20 arthur + + * [r572] configure.ac, nslcd/myldap.h: on some systems lber.h needs + to be included before ldap.h + +2008-01-27 10:16 arthur + + * [r571] common/tio.c, nslcd-common.h, nslcd/nslcd.c, nss/common.c, + tests/test_tio.c: when including stdint.h check if we actually + have it + +2008-01-27 10:14 arthur + + * [r570] nslcd/pagectrl.c, nslcd/pagectrl.h: correct #endif comment + +2008-01-26 17:55 arthur + + * [r569] nslcd/cfg.c: have a fallback value for HOST_NAME_MAX if it + is not defined + +2008-01-26 17:51 arthur + + * [r568] tests/test_nsscmds.sh: handle the case where + /etc/nss-ldapd.conf does not exist a little more graceful + +2008-01-26 14:32 arthur + + * [r567] nslcd/nslcd.c: log error when getpeercred() returned + nothing + +2008-01-26 14:31 arthur + + * [r566] compat/getpeercred.c, compat/getpeercred.h, configure.ac: + add (untested) support for the Solaris getpeerucred() function + +2008-01-26 10:49 arthur + + * [r565] Makefile.am, compat, compat/Makefile.am, + compat/getpeercred.c, compat/getpeercred.h, configure.ac, + nslcd/Makefile.am, nslcd/nslcd.c: move code to get information + from socket peer to the compat directory because it is very + platform specific + +2008-01-26 08:33 arthur + + * [r564] tests/test_myldap.c, tests/test_nsscmds.sh, + tests/test_tio.c: somewhat improve the output from the tests + +2008-01-26 08:31 arthur + + * [r563] nslcd/cfg.c: fix marsing of map statement + +2008-01-26 08:31 arthur + + * [r562] tests/test_cfg.c: also test map filter and scope + configuration options + +2008-01-16 20:49 arthur + + * [r561] nslcd/cfg.c: fix problem in map statement end-of-line + handling + +2008-01-16 20:43 arthur + + * [r560] tests/test_cfg.c: add a test for the map statement + +2008-01-03 12:51 arthur + + * [r559] nslcd/nslcd.c: close connections in worker threads at + program termination + +2008-01-03 12:49 arthur + + * [r558] nslcd/nslcd.c: make code a little more compact, don't + include debug twice in the log message and remove the + capabilities code because it will probably never be used + +2008-01-03 10:36 arthur + + * [r557] tests/test_nsscmds.sh: support the case where + is in + /etc/group + +2008-01-03 10:34 arthur + + * [r556] nss/aliases.c, nss/common.h, nss/ethers.c, nss/group.c, + nss/hosts.c, nss/netgroup.c, nss/networks.c, nss/passwd.c, + nss/protocols.c, nss/rpc.c, nss/services.c, nss/shadow.c: only + start the NSLCD_ACTION_*_ALL requests with the first call to + getent() instead of with setent() to avoid unneeded requests if + compat is used (except with netgroups) + +2008-01-03 10:30 arthur + + * [r555] nslcd/passwd.c, nss/prototypes.h: update copyright year + +2008-01-03 09:45 arthur + + * [r554] tests/test_nsscmds.sh: get the number of groups and + services from files in /etc for comparison + +2008-01-03 09:21 arthur + + * [r553] nslcd/passwd.c: do not warn about missing loginShell + attribute because it is not mandatory + +2008-01-03 08:25 arthur + + * [r552] nss/group.c: increment value that is pointed to, not the + pointer (fixes segfault) + +2008-01-02 22:22 arthur + + * [r551] nslcd/common.h: immediatly bail out if write entity + function failed (prevents numerous "error writing to client" + messages from filling up the logs) + +2008-01-01 21:05 arthur + + * [r550] tests/test_nsscmds.sh: check to see if nslcd is running + and add test for a large group (100 members) + +2008-01-01 21:04 arthur + + * [r549] nss/exports.linux, nss/group.c, nss/prototypes.h: enable + the _nss_ldap_initgroups_dyn() function that is now implemented + in nslcd + +2008-01-01 21:02 arthur + + * [r548] nss/common.h: use the new tio_mark()/tio_reset() functions + to support retries of the getent() functions when + NSS_STATUS_TRYAGAIN would be returned + +2008-01-01 20:53 arthur + + * [r547] common/tio.c, common/tio.h, tests/test_tio.c: add limited + implementation of tio_mark() and tio_reset() functions to do + limited seeks in the read stream, clean up header file comments + and write tests for new code + +2007-12-31 16:47 arthur + + * [r546] nslcd/common.h: fix get_userpassword() function + description + +2007-12-31 16:46 arthur + + * [r545] nslcd/shadow.c: fix incorrect references to attribute map + entries + +2007-12-31 16:45 arthur + + * [r544] nslcd/group.c: remove TODO (was done) + +2007-12-31 16:43 arthur + + * [r543] nslcd/common.c: fix bug that would return a password of + one character short + +2007-12-27 21:39 arthur + + * [r542] nslcd/cfg.c: do not define variable if we're not going to + use it + +2007-12-27 21:38 arthur + + * [r541] configure.ac: check for all used ldap functions + +2007-12-27 10:42 arthur + + * [r539] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: get files ready for + 0.5 release + +2007-12-26 22:35 arthur + + * [r538] tests/test_cfg.c: remove temporary file to make distcheck + succeed + +2007-12-26 21:55 arthur + + * [r537] README, debian/copyright: some documentation cleanups + +2007-12-26 20:36 arthur + + * [r536] tests/test_nsscmds.sh: ignore erros in nss commands + +2007-12-26 20:35 arthur + + * [r535] nslcd/myldap.c: only log "connected to LDAP server" if it + is a new connection + +2007-12-26 17:58 arthur + + * [r534] nslcd/cfg.c, nslcd/cfg.h, tests, tests/test_cfg.c: + properly handle spaces in some configuration options (major + change in code in cfg module) + +2007-12-26 10:54 arthur + + * [r533] tests/test_myldap.c: in test_two_searches() test that we + can read from the second search if the first search as abandoned + +2007-12-26 10:52 arthur + + * [r532] nslcd/myldap.c: properly flag running searches as invalid + if the connection to the LDAP server is reset + +2007-12-25 17:10 arthur + + * [r531] nslcd/common.h, nslcd/myldap.c, nslcd/myldap.h, + tests/test_myldap.c: have myldap_get_entry() return an LDAP + status code that can signal errors in the lookup + +2007-12-25 17:02 arthur + + * [r530] nslcd.h, nslcd/common.h, nss/common.c, nss/group.c: remove + NSLCD_RESULT_UNAVAIL because it's not needed anymore (the + connection is broken when an error occurs) and rename + NSLCD_RESULT_NOTFOUND into NSLCD_RESULT_END to better match its + meaning + +2007-12-25 16:53 arthur + + * [r529] nslcd/common.h: no need for us to flush the buffer since + our caller closes the stream immediatly (or could otherwise pass + the flushing to another thread) + +2007-12-24 23:29 arthur + + * [r528] man/nss-ldapd.conf.5.xml: some general cleanups and + document the krb5_ccname option + +2007-12-24 21:50 arthur + + * [r527] debian/libnss-ldapd.config: disable rootbinddn and + rootbindpw questions for now because they are not supported + +2007-12-24 17:11 arthur + + * [r526] man/nss-ldapd.conf.5.xml: document current timing and + reconnect options + +2007-12-24 16:58 arthur + + * [r525] nslcd/myldap.c: merge the do_map_error(), + do_with_reconnect() into the myldap_search() and do_try_search() + functions having more understandable reconnect and retry logic + +2007-12-24 16:41 arthur + + * [r524] nslcd/myldap.h: add some more documentation for using the + myldap module + +2007-12-22 21:05 arthur + + * [r523] tests/nss-ldapd-test.conf, tests/test_myldap.c: add + limited test for reconnect logic + +2007-12-22 21:02 arthur + + * [r522] nslcd/cfg.c, nslcd/cfg.h, nslcd/myldap.c: remove + bind_policy option because the same effect is achieved by setting + reconnect_tries to 1 + +2007-12-22 20:52 arthur + + * [r521] nslcd/cfg.c, nslcd/cfg.h: reorder timing and reconnect + options to be more logical and remove nss_ prefix from reconnect + options + +2007-12-22 20:38 arthur + + * [r520] tests/test_myldap.c: limit printing of results in test to + just 10 + +2007-12-22 20:35 arthur + + * [r519] tests/test_myldap.sh: include script name in messages and + have srcdir default to . + +2007-12-22 20:32 arthur + + * [r518] nslcd/myldap.c: integrate do_result() into + myldap_get_entry() reducing complexity and improving error + handling + +2007-12-22 13:36 arthur + + * [r517] nslcd/myldap.c: remove duplicate comment + +2007-12-22 13:34 arthur + + * [r516] nslcd/cfg.c, nslcd/cfg.h: remove some unused configuration + file options + +2007-12-22 13:21 arthur + + * [r515] nslcd/myldap.c: bring more uniformity to log messages + +2007-12-22 13:09 arthur + + * [r514] nslcd/myldap.c: give struct myldap_session members more + logical names + +2007-12-21 09:48 arthur + + * [r513] tests/test_myldap.sh, tests/test_nsscmds.sh: only test the + first URI in the configfile + +2007-12-20 19:30 arthur + + * [r512] tests/Makefile.am, tests/test_myldap.c, + tests/test_myldap.sh: pass configfile to use as a command-line + paramter to test_myldap, use the myldap_session_close() function, + print a limited number of results, add a wrapper script to test + whether the LDAP server is available for the test and ship all + needed files in the tarball + +2007-12-20 19:25 arthur + + * [r511] tests/test_nsscmds.sh: fail on any command and specify + configfile separately + +2007-12-20 17:00 arthur + + * [r510] debian/copyright: remove FSF copyright since we no longer + use their code + +2007-12-20 16:58 arthur + + * [r509] nslcd/myldap.c, nslcd/myldap.h: refactor myldap code to + get rid of most of the old nss status codes, properly handle + failures of ldap function calls and improve sourcecode comments + +2007-12-20 16:57 arthur + + * [r508] nslcd/myldap.c, nslcd/myldap.h: add myldap_session_close() + function (mainly for testing purposes) + +2007-12-20 16:53 arthur + + * [r507] nslcd/myldap.c: move checks of validity of passed entries + to separate functions + +2007-12-20 16:46 arthur + + * [r506] nslcd/myldap.c: remove msg member from struct myldap_entry + and just reference the same message in the search + +2007-12-20 15:29 arthur + + * [r505] nslcd/shadow.c: rewrite GET_OPTIONAL_DATE() as an + extension to GET_OPTIONAL_LONG() + +2007-12-20 15:28 arthur + + * [r504] configure.ac: add/change some tests for currently used + functions, relayout some complexer tests and use AC_CHECK_TYPE + instead of custom test + +2007-12-20 15:25 arthur + + * [r503] nslcd/ether.c: use ether_ntoa_r() instead of ether_ntoa() + +2007-12-20 15:17 arthur + + * [r502] compat/ldap.h, configure.ac: remove unused tests and + compatibility code + +2007-12-20 15:08 arthur + + * [r501] tests/nss-ldapd-test.conf: set pagesize to some more + reasonable value + +2007-12-20 13:55 arthur + + * [r500] tests/test_myldap.c: have assertion on correct search + +2007-12-16 16:43 arthur + + * [r498] nss-ldapd.conf: fix typo in description + +2007-12-14 16:41 arthur + + * [r497] nslcd/myldap.c: potential fix for double free() bug like + in nss_ldap (Debian bug #366172) + +2007-12-14 16:19 arthur + + * [r496] nslcd/myldap.h: improve description of myldap interface in + comments + +2007-12-14 16:12 arthur + + * [r495] nslcd/common.c: explain why we write an invalid address + (in comment) and add TODO to describe we need to change the log + format + +2007-12-14 16:07 arthur + + * [r494] tests/test_myldap.c: fix typo in comment + +2007-12-09 22:13 arthur + + * [r493] debian/control: update package description + +2007-12-09 16:24 arthur + + * [r492] tests/Makefile.am: fix objects that are needed to get + tests linkable (due to namechange from ldap-nss to myldap) + +2007-12-09 15:50 arthur + + * [r491] compat/ldap.h, nslcd/cfg.c, nslcd/cfg.h, nslcd/myldap.c: + some small layout changes + +2007-12-09 15:32 arthur + + * [r490] tests/test_nsscmds.sh: remove ugly space + +2007-12-09 15:23 arthur + + * [r489] nslcd-common.h, nslcd/Makefile.am, nslcd/alias.c, + nslcd/attmap.h, nslcd/cfg.c, nslcd/common.h, nslcd/group.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/myldap.c, + nslcd/myldap.h: get rid of some old code and rename ldap-nss to + myldap since there is no more NSS-related code in there + +2007-12-09 14:49 arthur + + * [r488] nslcd-common.h, nslcd/alias.c, nslcd/common.c, + nslcd/common.h, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c: + switch to new LDAP entry parsing code that is much simpler and + more readable + +2007-12-09 14:36 arthur + + * [r487] tests/test_nsscmds.sh: add some comments to tests, enable + netgroup tests and extend ether and services tests + +2007-12-09 14:34 arthur + + * [r486] nslcd/ldap-nss.c: ignore decoding errors from + ldap_get_values() as they are just nonexisting attribute values + +2007-12-07 16:49 arthur + + * [r485] debian/control: fix Vcs-* links to point to the trunk + +2007-12-07 16:49 arthur + + * [r484] debian/control: upgrade to standards-version 3.7.3 (no + changes needed) + +2007-12-07 13:10 arthur + + * [r483] nslcd/nslcd.c: don't use backticks as quote mark + +2007-12-01 22:03 arthur + + * [r482] common/dict.c: simple check for validity of key value in + dict_put() + +2007-11-26 22:38 arthur + + * [r481] configure.ac, man/nss-ldapd.conf.5.xml, nslcd/cfg.c, + nslcd/cfg.h, nslcd/ldap-nss.c: clean up Kerberos ccname code, + moving it to cfg.c, fixing some bugs in the putenv() code, making + the gss_krb5_ccache_name() automatically used if the function is + available and removing the --with-gssapi-dir, + --enable-configurable-krb5-ccname-gssapi and + --enable-configurable-krb5-ccname-env configure options + +2007-11-25 15:21 arthur + + * [r480] AUTHORS, README, configure.ac, man/nss-ldapd.conf.5.xml, + nslcd/cfg.c: implement LDAP server discovery through DNS, based + on a patch by Ralf Haferkamp and Michael Calmer + + +2007-11-24 15:26 arthur + + * [r479] HACKING: update versions of used tools + +2007-11-20 21:53 arthur + + * [r478] debian/control: remove XS- prefix from version control + fields + +2007-11-20 21:49 arthur + + * [r477] debian/control: put Homepage field in source stanza + +2007-11-16 11:43 arthur + + * [r476] AUTHORS, nslcd/ldap-nss.c: patch from Andreas Schneider + to get krb5_ccname option working + +2007-10-31 22:12 arthur + + * [r475] nslcd.h: improve comments about protocol, also describing + the final NSLCD_RESULT_NOTFOUND + +2007-10-28 14:50 arthur + + * [r474] nslcd/ldap-nss.c: some smaller cleanups and + simplifications to the code (getting rid of the is_connected flag + +2007-10-28 13:33 arthur + + * [r473] nslcd/ldap-nss.c: remove sizelimit parameter + +2007-10-28 13:17 arthur + + * [r472] nslcd/ldap-nss.c: integrate ent_context attributes into + ldap_search + +2007-10-28 12:54 arthur + + * [r471] nslcd/ldap-nss.c: remove session from context and remove + sycnhronous search functions + +2007-10-28 12:37 arthur + + * [r470] nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/netgroup.c, + nslcd/service.c: replace calls to _nss_ldap_get_values() by + myldap_get_values(), remove unused functions, remove struct + ldap_state and replace remaining references to context to use + search instead + +2007-10-28 11:39 arthur + + * [r469] man/nss-ldapd.conf.5.xml, nslcd/cfg.c, nslcd/cfg.h, + nslcd/ldap-nss.c: remove support for nss_connect_policy + configfile option and remove some supporting code for it + +2007-10-28 10:57 arthur + + * [r468] nslcd/alias.c, nslcd/common.h, nslcd/ether.c, + nslcd/group.c, nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c: + first step to use the new myldap interface + +2007-10-28 10:56 arthur + + * [r467] tests/test_nsscmds.sh: script to run a number of NSS + commands (mainly getent) and check the result (this requires an + LDAP setup that is yet to be documented) + +2007-10-27 16:54 arthur + + * [r466] man/nss-ldapd.conf.5.xml: include pagesize option in + manual page since this is tested now + +2007-10-27 16:53 arthur + + * [r465] nss-ldapd.conf: add pointer to pagesize in AD section of + sample configfile + +2007-10-27 16:28 arthur + + * [r464] nslcd/nslcd.c: clean up myldap session after each request + +2007-10-27 15:56 arthur + + * [r463] nslcd/cfg.c: make cfg_init() only callable once and add + note about not free()ing memory + +2007-10-27 15:48 arthur + + * [r462] common/tio.c: fix memory leak in I/O module not free()ing + allocated storage for file info on file close + +2007-10-27 15:36 arthur + + * [r461] common/tio.c: portability improvement to fall back to + ETIMEDOUT when ETIME is unavailable + +2007-10-26 08:46 arthur + + * [r460] NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: integrate changes from + 0.4.1 release + +2007-10-25 21:55 arthur + + * [r455] nslcd/rpc.c: fix rpc filter and remove unused objectClass + attmap entry + +2007-10-25 21:19 arthur + + * [r454] nslcd/ldap-nss.c: clean up any messages after abandoning + the search because that returns a new message (fix memory leak) + +2007-10-25 20:25 arthur + + * [r453] nslcd/ldap-nss.c: fix a memory leak, not storing search + entries so they could be freed later on + +2007-10-25 20:18 arthur + + * [r452] nslcd/ldap-nss.c: fix using unassigned status + +2007-10-25 20:17 arthur + + * [r451] nslcd/ldap-nss.c: fix memory leak + +2007-10-25 09:02 arthur + + * [r450] debian/libnss-ldapd.nslcd.init: remove S runlevel from + Default-Stop in init script + +2007-10-21 07:43 arthur + + * [r449] nss/networks.c: correct calls to + NSLCD_ACTION_NETWORK_BYNAME and NSLCD_ACTION_NETWORK_BYADDR and + get address in correct byte order with the last call + +2007-10-20 19:25 arthur + + * [r448] nslcd/passwd.c, nslcd/protocol.c: call mysnprintf() + instead of snprintf() where needed (bugfix) + +2007-10-19 22:04 arthur + + * [r444] nslcd/ldap-nss.c: make a replacement for + _nss_ldap_getbyname() which uses the myldap calls internally + +2007-10-19 10:35 arthur + + * [r443] nslcd/Makefile.am, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/myldap.h, tests, tests/Makefile.am, + tests/nss-ldapd-test.conf, tests/test_myldap.c: integrate basic + myldap interface (partially merged from dev-myldap branch) + +2007-10-19 09:39 arthur + + * [r442] tests/Makefile.am: include debugging information in object + files + +2007-10-19 09:36 arthur + + * [r441] tests/Makefile.am: move most C[PP]FLAGS options to + AM_C[PP]FLAGS and clean up a little + +2007-10-19 09:30 arthur + + * [r440] common/tio.c: fix usage of DEBUG_TIO_STATS + +2007-10-14 07:59 arthur + + * [r438] AUTHORS: add translator to Japanese of templates + +2007-10-14 07:57 arthur + + * [r437] debian/po/ja.po: update Japanese (ja) translation of + debconf templates by Kenshi Muto + +2007-10-08 20:11 arthur + + * [r436] debian/copyright, debian/po/fr.po: update French (fr) + translation of debconf templates by Cyril Brulebois + + +2007-10-05 20:52 arthur + + * [r434] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: get files ready for + 0.4 release + +2007-10-04 19:52 arthur + + * [r433] .: ignore tarballs + +2007-10-04 19:49 arthur + + * [r432] configure.ac: remove linking with libresolv because it's + not needed on Linux + +2007-10-03 20:27 arthur + + * [r431] nss-ldapd.conf: some reordering to make the file more + logical and minor fixes + +2007-10-03 20:26 arthur + + * [r430] Makefile.am: pass --enable-warnings when running the + distcheck target + +2007-10-03 20:19 arthur + + * [r429] README: some general documentation improvements + +2007-09-28 08:06 arthur + + * [r428] man/nss-ldapd.conf.5.xml: add note about escaping of + ldapi:// scheme + +2007-09-28 08:06 arthur + + * [r427] debian/libnss-ldapd.templates, debian/po/ca.po, + debian/po/cs.po, debian/po/da.po, debian/po/de.po, + debian/po/es.po, debian/po/fr.po, debian/po/ja.po, + debian/po/nl.po, debian/po/pt.po, debian/po/pt_BR.po, + debian/po/ru.po, debian/po/sv.po, debian/po/templates.pot, + debian/po/vi.po: remove note about escaping of ldapi:// url + scheme + +2007-09-28 07:05 arthur + + * [r426] nslcd/cfg.c: add warnings and errors to untested and + unsupported configfile options + +2007-09-25 20:57 arthur + + * [r425] man/nss-ldapd.conf.5.xml: manual page improvements + +2007-09-24 19:29 arthur + + * [r424] configure.ac: switch to defining __thread as empty string + and issue warning if __thread keyword is not supported + +2007-09-24 19:22 arthur + + * [r423] common/tio.c: also initialize sa_sigaction although it's + not used + +2007-09-24 18:58 arthur + + * [r422] debian/libnss-ldapd.postinst: do something special for + setting the uri parameter because it may be speicified multiple + times + +2007-09-24 13:39 arthur + + * [r421] debian/libnss-ldapd.config: fix newline mangling + +2007-09-23 20:39 arthur + + * [r420] debian/libnss-ldapd.config: properly handle multiple uri + lines in config file + +2007-09-23 20:18 arthur + + * [r419] debian/libnss-ldapd.postinst: trim preceding spaces when + adding an entry in /etc/nsswitch.conf + +2007-09-23 11:06 arthur + + * [r418] Makefile.am, common/tio.c, nslcd/ldap-nss.h, + nslcd/nslcd.c, nss/common.c: some small improvements to the code + based on some source code checks + +2007-09-23 11:01 arthur + + * [r417] Makefile.am: remove pscan target as these checks are + sufficiently covered by the other tests + +2007-09-22 21:40 arthur + + * [r416] nslcd/Makefile.am: add compat files to sources so they end + up in the tarball + +2007-09-22 21:35 arthur + + * [r415] tests/Makefile.am: add all objects that are now needed to + test the configuration module + +2007-09-22 21:29 arthur + + * [r414] tests/test_cfg.c: remove test for alloc_lsd() because we + don't use struct ldap_service_search_descriptor any more + +2007-09-21 19:44 arthur + + * [r412] nslcd/ldap-nss.c: remove unneeded variables and slightly + improve logging + +2007-09-21 19:39 arthur + + * [r411] common/Makefile.am: just use -fPIC on all files in this + directory + +2007-09-19 20:47 arthur + + * [r410] nslcd/cfg.c, nslcd/cfg.h, nslcd/nslcd.c: put config + filename as a parameter to cfg_init() + +2007-09-15 17:20 arthur + + * [r409] nslcd/ldap-nss.c: centralize opening of connection to LDAP + server in do_open() and refactor do_bind() to be simpler (making + do_rebind() just one line) + +2007-09-15 14:43 arthur + + * [r408] man/nss-ldapd.conf.5.xml: remove documentation for + nss_schema option since it isn't used any more and probably never + will be + +2007-09-15 14:42 arthur + + * [r407] nslcd/attmap.c, nslcd/attmap.h, nslcd/cfg.c, nslcd/cfg.h, + nslcd/common.h, nslcd/group.c, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/passwd.c: remove support for nested + groups and use of uniqueMember and member attributes as well as + memberOf attribute (this removes quite some functionality but + helps us in refactoring because the code was one big exception to + all the other modules) + +2007-09-15 14:10 arthur + + * [r406] nslcd/group.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h: some + more code cleanup, changing return type of _nss_ldap_init(), + integrating _nss_ldap_init(), do_init_session(), do_parse_async() + and _nss_ldap_search_async() into the functions that call them + (each was only called once) + +2007-09-15 11:35 arthur + + * [r404] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: do not pass useless errnos + around because they aren't used anymore + +2007-09-15 08:25 arthur + + * [r403] nslcd/cfg.h: remove unused include + +2007-09-14 23:10 arthur + + * [r402] nslcd/ldap-nss.c: some type fixes and logic + simplifications + +2007-09-14 23:10 arthur + + * [r401] nslcd/group.c: minor code improvements + +2007-09-14 22:00 arthur + + * [r400] nslcd/Makefile.am, nslcd/alias.c, nslcd/cfg.c, + nslcd/ether.c, nslcd/group.c, nslcd/host.c, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/netgroup.c, nslcd/network.c, + nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, + nslcd/shadow.c, nslcd/util.c, nslcd/util.h: move the two + remaining useful functions from util.c to ldap-nss.c + +2007-09-14 21:51 arthur + + * [r399] nslcd/group.c, nslcd/util.c, nslcd/util.h: move + _nss_ldap_dn2uid() from util.c to group.c + +2007-09-14 21:51 arthur + + * [r398] nslcd/common.h, nslcd/passwd.c: add note about free()ing + the returned value and add logging + +2007-09-14 21:01 arthur + + * [r397] nslcd/common.h, nslcd/group.c, nslcd/passwd.c: move + user2dn() from group.c to passwd_username2dn() in passwd.c + +2007-09-14 20:54 arthur + + * [r396] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: do not flush streams: our caller + closes the streams flusing them + +2007-09-14 20:50 arthur + + * [r395] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: make use of write_*ent() + functions consistent + +2007-09-14 19:44 arthur + + * [r394] nslcd/alias.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/util.c, nslcd/util.h: revert special casing for + alias_byname() to other functions and some logging strings + simplifications + +2007-09-14 19:35 arthur + + * [r393] nslcd/group.c: remove some more references to the old + locked functions + +2007-09-14 18:48 arthur + + * [r392] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/network.c, + nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, + nslcd/shadow.c, nslcd/util.c: remove mutex from all LDAP + operations because we now have a session and a connection per + thread + +2007-09-14 16:30 arthur + + * [r391] nslcd/alias.c, nslcd/common.h, nslcd/ether.c, + nslcd/group.c, nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/netgroup.c, nslcd/network.c, nslcd/nslcd.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c, + nslcd/util.c, nslcd/util.h: get rid of global session and instead + pass the session as a parameter with every request and allocate a + session per thread + +2007-09-12 19:12 arthur + + * [r390] nslcd/ldap-nss.c: some code cleanup and fixes to the + layout + +2007-09-09 15:06 arthur + + * [r389] nslcd/group.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/util.c: change naming of search functions to clearly + indicate whether the synchronous or the asynchronous interface is + used + +2007-09-09 10:30 arthur + + * [r388] compat/ldap.h, nslcd/cfg.c, nslcd/cfg.h, nslcd/ldap-nss.c: + some simplifications in the reconnect loging, removing the + undocumented nss_reconnect_maxconntries configfile option and + some work to split out LDAP compatibility code to a separate file + +2007-09-08 21:37 arthur + + * [r387] nslcd/common.c, nslcd/common.h, nslcd/ldap-nss.c: move + nss2nslcd() to ldap-nss.c + +2007-09-08 20:47 arthur + + * [r386] nslcd/group.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h: rename + a function and a little bit of cleanup + +2007-09-08 20:33 arthur + + * [r385] nslcd/ldap-nss.c: fix endless loop bug + +2007-09-08 19:15 arthur + + * [r384] nslcd/alias.c, nslcd/attmap.c, nslcd/attmap.h, + nslcd/cfg.c, nslcd/cfg.h, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c, + nslcd/util.c: move base and scope handling to database specific + modules, gettting rid of ldap_service_search_descriptor + +2007-09-08 15:19 arthur + + * [r383] nslcd/alias.c, nslcd/attmap.c, nslcd/attmap.h, + nslcd/cfg.c, nslcd/cfg.h, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.c: move filters + definitions to the database modules themselves (and already + define base and scope but don't use them yet) + +2007-09-07 20:51 arthur + + * [r382] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: make handling of ent_context + consistent and simpler + +2007-09-07 19:57 arthur + + * [r381] nslcd/alias.c, nslcd/ether.c, nslcd/host.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.h: properly + initialize all contexts + +2007-09-07 19:56 arthur + + * [r380] nslcd/ldap-nss.h: remove struct ldap_args stuff + +2007-09-07 19:41 arthur + + * [r379] nslcd/group.c: remove last usage of struct ldap_args and + add FIXME + +2007-09-07 19:36 arthur + + * [r378] nslcd/Makefile.am, nslcd/alias.c, nslcd/cfg.c, + nslcd/ether.c, nslcd/group.c, nslcd/host.c, nslcd/ldap-nss.c, + nslcd/ldap-schema.c, nslcd/ldap-schema.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.c: remove the + ldap-schema.[ch] files since this is now fully implemented in the + database specific files + +2007-09-07 11:10 arthur + + * [r377] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/ldap-schema.c, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c: + also pass search filter for the *_all() functions from the + database module instead of doing it in ldap-nss.c + +2007-09-07 09:28 arthur + + * [r376] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c: + rename attlst stuff to attrs since that is the name of the + parameter that is passed + +2007-09-07 08:41 arthur + + * [r375] nslcd/alias.c, nslcd/common.c, nslcd/common.h, + nslcd/ether.c, nslcd/group.c, nslcd/host.c, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/ldap-schema.c, nslcd/ldap-schema.h, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c, + nslcd/util.h: move some of the filter code to the database + specific modules to be able to reduce complexity of ldap-nss.c + later on + +2007-09-05 20:53 arthur + + * [r374] man/Makefile.am: clean generated manual pages in + maintainer-clean target + +2007-09-03 21:47 arthur + + * [r373] nslcd/alias.c, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/netgroup.c, nslcd/network.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c: + include service name in attlst storage and functions + +2007-09-03 20:53 arthur + + * [r372] nslcd/ldap-nss.c: remove sigpipe handling code since + sigpipe is ignored throughout the program + +2007-08-27 19:38 arthur + + * [r371] man/Makefile.am: always ship docbook sources and generated + manual pages and always install manual pages (even without + docbook2x-man) + +2007-08-27 19:37 arthur + + * [r370] INSTALL, autogen.sh, depcomp, install-sh, missing, + mkinstalldirs: upgrade to using automake 1.10 + +2007-08-27 19:35 arthur + + * [r369] configure.ac: use AM_PROG_CC_C_O to have per-target + compiler flags + +2007-08-26 20:19 arthur + + * [r366] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + man/nslcd.8.xml, man/nss-ldapd.conf.5.xml: get files ready for + 0.3 release + +2007-08-26 14:51 arthur + + * [r365] Makefile.am: workaround for problems splint has in parsing + system header files + +2007-08-26 14:05 arthur + + * [r364] nslcd/cfg.h, nslcd/ldap-nss.h: move enum ldap_map_selector + and struct ldap_service_search_descriptor from ldap-nss.h to + cfg.h + +2007-08-25 13:21 arthur + + * [r363] debian/libnss-ldapd.postinst: fix handling of configfile + values with spaces and symbols that could cause problems with sed + +2007-08-25 11:52 arthur + + * [r362] debian/libnss-ldapd.postinst: change regular expression + boundry to | instead of % because it is less likely to appear + with normal use + +2007-08-25 11:51 arthur + + * [r361] debian/libnss-ldapd.config: clear password informating in + Debconf database if binddn is not used + +2007-08-19 15:38 arthur + + * [r360] tests, tests/Makefile.am, tests/test_cfg.c: add some + checks for the configuration module + +2007-08-19 14:26 arthur + + * [r359] configure.ac, tests/Makefile.am, tests/dict, + tests/test_dict.c, tests/test_tio.c, tests/tio: move dict and tio + tests into the tests directory + +2007-08-19 14:12 arthur + + * [r358] debian/po/pt.po: include updated Portugese translation by + Américo Monteiro + +2007-08-19 14:11 arthur + + * [r357] debian/po/templates.pot: change Project-Id-Version project + name + +2007-08-19 14:09 arthur + + * [r356] debian/po/ca.po, debian/po/cs.po, debian/po/da.po, + debian/po/de.po, debian/po/es.po, debian/po/fr.po, + debian/po/ja.po, debian/po/nl.po, debian/po/pt.po, + debian/po/pt_BR.po, debian/po/ru.po, debian/po/sv.po, + debian/po/templates.pot, debian/po/vi.po: update + Project-Id-Version and Report-Msgid-Bugs-To headers + +2007-08-19 14:08 arthur + + * [r355] debian/copyright, m4/acx_pthread.m4: include newer version + of acx_pthread.m4 + +2007-08-19 13:28 arthur + + * [r354] README: add a note about case-sensitivity of NSS and LDAP + databases + +2007-08-19 11:19 arthur + + * [r353] debian/libnss-ldapd.config, debian/libnss-ldapd.postinst: + fix some bugs in mangling of configfile and be more cautious + about replacing values (only replace first occurrence and only + match options with the correct number of options) + +2007-08-19 11:00 arthur + + * [r352] debian/libnss-ldapd.postinst: remove passwords from + configfile if the [root]binddn option was removed and always + unset the passwd in the debconf database + +2007-08-19 10:54 arthur + + * [r351] config.guess, config.sub: include updated files + +2007-08-19 09:22 arthur + + * [r350] debian/libnss-ldapd.postinst: no longer use + /etc/libnss-ldap.conf as a basis for creating a new configuration + file since the syntax is no longer compatible + +2007-08-19 09:16 arthur + + * [r349] debian/libnss-ldapd.postinst: only restart nscd on + configure + +2007-08-19 09:11 arthur + + * [r348] debian/libnss-ldapd.config, debian/libnss-ldapd.postinst, + debian/libnss-ldapd.templates, debian/po/ca.po, debian/po/cs.po, + debian/po/da.po, debian/po/de.po, debian/po/es.po, + debian/po/fr.po, debian/po/ja.po, debian/po/nl.po, + debian/po/pt.po, debian/po/pt_BR.po, debian/po/ru.po, + debian/po/sv.po, debian/po/templates.pot, debian/po/vi.po: remove + the ldap-version question as it should be unneeded in the most + common installations (where it needs to be set the whole config + is likely te need tweaking) + +2007-08-18 20:56 arthur + + * [r347] debian/libnss-ldapd.templates, debian/po/ca.po, + debian/po/cs.po, debian/po/da.po, debian/po/de.po, + debian/po/es.po, debian/po/fr.po, debian/po/ja.po, + debian/po/nl.po, debian/po/pt.po, debian/po/pt_BR.po, + debian/po/ru.po, debian/po/sv.po, debian/po/templates.pot, + debian/po/vi.po: rephrase the uri question and add some more + pointers on how to specify the value + +2007-08-18 20:47 arthur + + * [r346] debian/libnss-ldapd.nslcd.init: change remaining reference + to $PIDFILE into $NSLCD_PIDFILE + +2007-08-18 20:11 arthur + + * [r345] nslcd/ldap-nss.c: fix a couple of uses of per-map bases + that could be NULL and remove the ldap_proxy_bind_args that + wasn't used anywhere + +2007-08-18 19:37 arthur + + * [r344] man/nslcd.8.xml: replace remaining \- with - + +2007-08-18 19:35 arthur + + * [r343] configure.ac, man/nss-ldapd.conf.5.xml, nslcd/attmap.c, + nslcd/attmap.h, nslcd/cfg.c, nslcd/cfg.h, nslcd/ldap-nss.c, + nslcd/ldap-schema.h, nslcd/nslcd.c, nss-ldapd.conf: rewrite + configuration file handling to be simpler and more consistent, + this does mean that the syntax of the configfile has changed from + the PADL one and that some options were removed (also update + manual page and sample config file to reflect changes) + +2007-08-03 08:13 arthur + + * [r342] nslcd/cfg.c, nslcd/cfg.h, nslcd/group.c: remove + nss_initgroups and nss_initgroups_ignoreusers configfile options + +2007-08-03 07:21 arthur + + * [r341] HACKING, README: documentation improvements + +2007-08-03 07:20 arthur + + * [r340] README, configure.ac, man/nss-ldapd.conf.5.xml, + nslcd/cfg.c, nslcd/cfg.h, nslcd/ldap-nss.c, nslcd/ldap-nss.h: + remove --enable-paged-results configure option and now always do + runtime configuration, remove nss_paged_results configfile option + and use pagesize option to specify usage of paging or not + +2007-08-02 21:59 arthur + + * [r339] README: some spelling fixes, added a section on + unsupported features and rephrased default LDAP schema + objectclasses as filters + +2007-07-31 13:54 arthur + + * [r338] Makefile.am, configure.ac, debian/control, man, + man/Makefile.am, man/nslcd.8.xml, man/nss-ldapd.conf.5.xml, + nslcd.8, nss-ldapd.conf.5: switch to using docbook for manual + pages, use docbook2x-man for generating the manual pages and + update the nss-ldapd.conf manual page slightly + +2007-07-28 16:20 arthur + + * [r337] nslcd/alias.c, nslcd/cfg.h, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/ldap-schema.c, nslcd/ldap-schema.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: define the list of attributes to + look up in searches in the service modules instead of in + ldap-schema + +2007-07-28 14:57 arthur + + * [r336] nslcd/attmap.h: fix typo in comment + +2007-07-27 09:54 arthur + + * [r334] nslcd.h: fix typo + +2007-07-26 20:11 arthur + + * [r332] nslcd/cfg.c, nslcd/ldap-schema.h: remove some more old + mapping stuff and change configuration file keyword to map with + the new syntax + +2007-07-26 19:34 arthur + + * [r331] nslcd/alias.c, nslcd/attmap.c, nslcd/attmap.h, + nslcd/cfg.c, nslcd/cfg.h, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: switch to the new attribute + mapping code + +2007-07-26 16:00 arthur + + * [r330] nslcd/cfg.c, nslcd/cfg.h, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/ldap-schema.c: get rid of default and + override attribute value mappings and remove host and port + configuration options + +2007-07-26 11:58 arthur + + * [r329] nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/shadow.c: move + some shadow specific functions to shadow.c + +2007-07-26 11:57 arthur + + * [r328] nslcd/cfg.c, nslcd/cfg.h: make function + _nss_ldap_add_uri() static + +2007-07-24 15:36 arthur + + * [r327] nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/ldap-schema.c: + remove some more unused code + +2007-07-24 13:38 arthur + + * [r326] nslcd/Makefile.am, nslcd/alias.c, nslcd/attmap.c, + nslcd/attmap.h, nslcd/cfg.c, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/ldap-schema.c, nslcd/ldap-schema.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.c: switch to a new + interface for doing attribute mapping, splitting the attribute + mapping stuff into a separate file + +2007-07-24 10:13 arthur + + * [r325] nslcd/cfg.c, nslcd/ldap-schema.c, nslcd/ldap-schema.h: get + rid of some unused attribute mappings and a small reorganisation + of code + +2007-07-24 06:52 arthur + + * [r324] debian/libnss-ldapd.templates, debian/po/ca.po, + debian/po/cs.po, debian/po/da.po, debian/po/de.po, + debian/po/es.po, debian/po/fr.po, debian/po/ja.po, + debian/po/nl.po, debian/po/pt.po, debian/po/pt_BR.po, + debian/po/ru.po, debian/po/sv.po, debian/po/templates.pot, + debian/po/vi.po: rephrase nsswitch.conf question and removed + reference to example file we don't ship + +2007-07-24 06:40 arthur + + * [r323] debian/copyright, nslcd/Makefile.am, nslcd/cfg.c, + nslcd/cfg.h, nslcd/dnsconfig.c, nslcd/dnsconfig.h, + nslcd/resolve.c, nslcd/resolve.h, nss-ldapd.conf.5: get rid of + dnsconfig stuff since that probably didn't work anyway and it + cleans up some stuff + +2007-07-23 20:24 arthur + + * [r315] common/dict.c, tests/dict/test_dict.c: fix a serious bug + in dict_values_next() that would return map pointers instead of + values and write a test for it + +2007-07-23 15:23 arthur + + * [r314] debian/rules: use stricter distclean run in clean target + as suggested by lintian + +2007-07-23 14:42 arthur + + * [r313] common/dict.c, common/dict.h, tests/dict/test_dict.c: add + support for removing entries from a DICT by setting the value to + NULL (this does not free any memory) + +2007-07-21 14:04 arthur + + * [r310] AUTHORS: include translater of debconf templates to French + +2007-07-18 07:12 arthur + + * [r309] debian/po/fr.po: typo fix by Cyril Brulebois + + +2007-07-16 19:29 arthur + + * [r308] debian/po/fr.po: update French (fr) translation of debconf + templates by Cyril Brulebois + +2007-07-15 21:40 arthur + + * [r307] tests/tio/test_tio.c: disable test that will always fail + +2007-07-15 21:37 arthur + + * [r306] common/tio.c: fix typo + +2007-07-15 21:35 arthur + + * [r305] common/tio.c: fix bug with buffer magic in writing code + +2007-07-14 09:33 arthur + + * [r304] AUTHORS, debian/copyright, debian/po/pt.po: add Portuguese + (pt) translation of debconf templates by Américo Monteiro + + +2007-07-13 09:45 arthur + + * [r303] tests/dict/Makefile.am, tests/tio/Makefile.am: do the + simple unit tests at make check time + +2007-07-13 09:31 arthur + + * [r302] Makefile.am: don't include config diretory which we don't + use + +2007-07-13 08:44 arthur + + * [r301] common/tio.c: add const and add FIXME about a to-be-fixed + race condition + +2007-07-13 08:42 arthur + + * [r300] nss/networks.c: flag the address family parameter as + unused + +2007-07-13 08:26 arthur + + * [r299] README: add notes about format of host and ethers entries + in LDAP database + +2007-07-13 08:17 arthur + + * [r298] debian/control: add XS-Vcs-Svn and XS-Vcs-Browser as + specified in #391023 + +2007-06-18 08:46 arthur + + * [r297] nslcd/nslcd.c: add comment explaining the use of chmod() + over fchmod() + +2007-06-17 16:48 arthur + + * [r294] ChangeLog, NEWS, configure.ac, debian/changelog, + nss-ldapd.conf.5: get files ready for 0.2.1 release + +2007-06-17 14:05 arthur + + * [r293] Makefile.am: do proper wildcard expansion + +2007-06-17 14:05 arthur + + * [r292] Makefile.am, nss/Makefile.am: add proper support for make + uninstall + +2007-06-17 13:31 arthur + + * [r291] autogen.sh: force regeneration of all files + +2007-06-17 13:27 arthur + + * [r290] Makefile.am, autogen.sh, configure.ac: include stuff from + the m4 directory automatically + +2007-06-17 13:20 arthur + + * [r289] common/Makefile.am, nslcd/Makefile.am, nss/Makefile.am, + tests/Makefile.am, tests/dict/Makefile.am, tests/tio/Makefile.am: + support building outside the source directory + +2007-06-17 12:43 arthur + + * [r288] Makefile.am, configure.ac, debian/copyright, m4, + m4/acx_pthread.m4, nslcd/Makefile.am: use the ACX_PTHREAD macro + to check for platform independant pthread support and required + options + +2007-06-17 12:35 arthur + + * [r287] debian/copyright: further clarification of use of + autoconf/automake code + +2007-06-16 23:10 arthur + + * [r286] nslcd/nslcd.c: change fchmod() into chmod() since fchmod() + has undifined behaviour on named sockets (fails silently) + +2007-06-12 09:09 arthur + + * [r285] common/dict.c, nslcd/ldap-nss.c, nslcd/ldap-schema.c, + nslcd/util.c: fix casts of types where needed + +2007-06-12 09:06 arthur + + * [r284] nslcd/host.c: fix type of host address and handle errors + in writing hostent + +2007-06-11 18:44 arthur + + * [r280] ChangeLog, NEWS, TODO, configure.ac, debian/changelog, + nss-ldapd.conf.5: get files ready for 0.2 release + +2007-06-11 18:40 arthur + + * [r279] common/Makefile.am, common/dict.c, common/dict.h, + nslcd/Makefile.am, nslcd/cfg.h, nslcd/dict.c, nslcd/dict.h, + tests/dict/Makefile.am, tests/dict/test_dict.c: move dict into + the common directory + +2007-06-11 18:34 arthur + + * [r278] nss-ldapd.conf.5: add a note about the status of this + manual page + +2007-06-10 16:58 arthur + + * [r277] common/Makefile.am: compile tio module with -fPIC because + it is used in the NSS shared library + +2007-06-10 16:50 arthur + + * [r276] debian/libnss-ldapd.postinst: add note about modifying + /etc/nsswitch.conf in postinst + +2007-06-09 17:35 arthur + + * [r275] Makefile.am: have better rules to generate ChangeLog + +2007-06-09 16:54 arthur + + * [r274] common/tio.h: remove some trailing spaces + +2007-06-09 16:50 arthur + + * [r273] nss-ldapd.conf.5: add proper copyright header + +2007-06-08 22:57 arthur + + * [r272] Makefile.am, common, common/Makefile.am, common/tio.c, + common/tio.h, configure.ac, nslcd-common.h, nslcd/Makefile.am, + nslcd/alias.c, nslcd/common.h, nslcd/ether.c, nslcd/group.c, + nslcd/host.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/netgroup.c, nslcd/network.c, nslcd/nslcd.c, nslcd/passwd.c, + nslcd/protocol.c, nslcd/rpc.c, nslcd/service.c, nslcd/shadow.c, + nslcd/util.c, nslcd/util.h, nss/Makefile.am, nss/aliases.c, + nss/common.c, nss/common.h, nss/ethers.c, nss/group.c, + nss/hosts.c, nss/netgroup.c, nss/networks.c, nss/passwd.c, + nss/protocols.c, nss/rpc.c, nss/services.c, nss/shadow.c, + tests/Makefile.am, tests/tio, tests/tio/Makefile.am, + tests/tio/test_tio.c: implement our own stdio-like library that + handles IO with a simple configurable timeout mechanism with + buffering + +2007-06-05 21:48 arthur + + * [r271] NEWS, README, configure.ac, tests/dict/test_dict.c: some + remaining tabs to spaces and trim trailing spaces + +2007-06-02 15:28 arthur + + * [r270] configure.ac, debian/copyright: fix some remaining + references to the GNU Library General Public License + +2007-06-01 21:40 arthur + + * [r269] nslcd/nslcd.c: add some comments describing some problems + that this code may have + +2007-05-20 16:25 arthur + + * [r268] HACKING: add a section on build dependencies + +2007-05-13 19:52 arthur + + * [r267] config.guess, config.sub: include updated files + +2007-03-05 22:42 arthur + + * [r266] ., Makefile.am: include some targets to tun flawfinder, + pscan, rats and splint + +2007-03-04 20:03 arthur + + * [r265] nslcd-common.h, nslcd/alias.c, nslcd/ether.c, + nslcd/group.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/ldap-schema.c, nslcd/ldap-schema.h, nslcd/log.c, + nslcd/nslcd.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/shadow.c, nslcd/util.c, nslcd/util.h, nss/common.c, + nss/common.h, nss/group.c, nss/hosts.c, nss/netgroup.c, + nss/networks.c, nss/prototypes.h, nss/services.c: code + improvements by making type casts explicit, flagging ignored + return values, renames and flagging of parameters and some + miscelanious improvements (thanks to gcc warnings, splint, rats + and flawfinder) + +2007-03-02 21:17 arthur + + * [r264] nslcd/ldap-nss.c: remove runtime checking for existance of + /lib/init/rw/libnss-ldap.bind_policy_soft + +2007-03-02 20:40 arthur + + * [r263] nss-ldapd.conf: add missing attribute mapping for AD + +2007-03-02 20:37 arthur + + * [r262] nslcd/nslcd.c: do chmod on file descriptor instead of on + file name + +2007-02-17 12:08 arthur + + * [r251] nslcd-common.h, nslcd/cfg.c, nss/hosts.c: fix a few bugs + found thanks to the new warnings + +2007-02-17 12:07 arthur + + * [r250] compat, compat/attrs.h, nslcd/cfg.h, nslcd/common.h, + nslcd/dict.h, nslcd/log.h, nslcd/nslcd.c, nss/Makefile.am, + nss/common.h, nss/ethers.c, nss/group.c, nss/hosts.c, + nss/netgroup.c, nss/networks.c, nss/passwd.c, nss/protocols.c, + nss/rpc.c, nss/services.c, nss/shadow.c, tests/dict/test_dict.c, + tests/test_aliases.c: add gcc attributes to some functions and + parameters + +2007-02-17 12:00 arthur + + * [r249] configure.ac: add some extra type checks and worarounds + +2007-02-17 12:00 arthur + + * [r248] configure.ac: add extra compiler warnings + +2007-02-10 08:13 arthur + + * [r240] nslcd/dnsconfig.c, nslcd/ldap-nss.c, nslcd/ldap-nss.h, + nslcd/ldap-schema.c, nslcd/util.c: replace syslog calls to calls + with our own logging module + +2007-02-06 22:27 arthur + + * [r237] README: fix a typo and update copyright info + +2007-02-04 22:42 arthur + + * [r236] configure.ac, tests/Makefile.am, tests/dict, + tests/dict/Makefile.am, tests/dict/test_dict.c: add simple test + for dict module + +2007-02-04 22:31 arthur + + * [r235] nslcd/dict.c: fix list corruption bug in dict_put() and + ignore setting value to NULL + +2007-02-04 22:30 arthur + + * [r234] nslcd/dict.c, nslcd/dict.h: don't store const void * as + value, just void * + +2007-02-01 22:12 arthur + + * [r233] nslcd/util.c, nslcd/util.h: declare old dict functions + static as thay are only used from within util.c + +2007-02-01 22:03 arthur + + * [r232] nslcd/dict.h, nslcd/ldap-nss.h: trim trailing whitespace + +2007-02-01 21:51 arthur + + * [r231] nslcd/Makefile.am, nslcd/cfg.c, nslcd/cfg.h, nslcd/dict.c, + nslcd/dict.h, nslcd/ldap-nss.c, nslcd/util.c, nslcd/util.h: add + new dictionary module and use it for the attribute mapping stuff + +2007-02-01 21:13 arthur + + * [r230] nslcd/Makefile.am, nslcd/log.c, nslcd/xmalloc.c, + nslcd/xmalloc.h: get rid of xmalloc.[ch] + +2007-01-17 22:40 arthur + + * [r229] nss/Makefile.am: no longer install libc-versioned symlink + and hardcode nss soname because we will likely need to change our + code if the ABI changes + +2007-01-17 22:23 arthur + + * [r228] debian/rules: in Debian package install NSS files in + /usr/lib instead of /lib + +2007-01-17 22:16 arthur + + * [r227] nss/aliases.c, nss/common.h, nss/ethers.c, nss/group.c, + nss/hosts.c, nss/netgroup.c, nss/networks.c, nss/passwd.c, + nss/protocols.c, nss/rpc.c, nss/services.c, nss/shadow.c: ensure + that all NSS functions can be generated by the marcos in common.h + and spell out the read_..() function for every type + +2007-01-17 21:54 arthur + + * [r226] debian/copyright: indent license blubs and include license + information for nslcd/resolve.[ch] + +2007-01-17 21:53 arthur + + * [r225] nslcd.h: add a little bit more documentation + +2007-01-17 16:10 arthur + + * [r224] nslcd/cfg.c: remove a const where it really wasn't + +2007-01-17 16:03 arthur + + * [r223] nslcd/cfg.c, nslcd/cfg.h, nslcd/group.c, nslcd/ldap-nss.c, + nslcd/util.c, nslcd/util.h: move most config code into cfg.c, + clean up dictornary stuff in util.c and do some more smaller + restructuring + +2007-01-17 15:35 arthur + + * [r222] nslcd/group.c, nslcd/ldap-nss.h, nslcd/util.c, + nslcd/util.h: move name_list stuff to group.c as that is the only + place it's used at the moment + +2007-01-17 15:29 arthur + + * [r221] nslcd/netgroup.c: replace __netgrent with mynetgrent + removing the fields that are not used + +2007-01-17 13:16 arthur + + * [r220] nslcd/Makefile.am, nslcd/cfg.c, nslcd/cfg.h, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/ldap-schema.h, + nslcd/util.c, nslcd/util.h: first step to split out all + configuration stuff into separate file + +2007-01-17 12:51 arthur + + * [r219] nslcd/ldap-nss.c, nslcd/ldap-nss.h: get rid of more code + that would check if the socket was changed from under us by our + caller + +2007-01-17 12:14 arthur + + * [r218] nslcd/ldap-nss.c: get rid of rebinding-on-fork() logic as + our threading model is very predictable + +2007-01-10 22:50 arthur + + * [r217] nslcd/netgroup.c: write a final result code of + NSLCD_RESULT_NOTFOUND for netgroup lookups + +2007-01-10 22:48 arthur + + * [r216] nss/netgroup.c, nss/prototypes.h: fix netgroup lookups so + that _nss_ldap_getnetgrent_r() returns NSS_STATUS_RETURN if there + are no more entries to return but there was a first entry + +2007-01-09 21:21 arthur + + * [r215] COPYING, Makefile.am, README, configure.ac, + debian/copyright, debian/libnss-ldapd.nslcd.init, nslcd-common.h, + nslcd.8, nslcd.h, nslcd/Makefile.am, nslcd/alias.c, + nslcd/common.c, nslcd/common.h, nslcd/dnsconfig.c, + nslcd/dnsconfig.h, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/ldap-schema.c, + nslcd/ldap-schema.h, nslcd/log.c, nslcd/log.h, nslcd/netgroup.c, + nslcd/network.c, nslcd/nslcd.c, nslcd/pagectrl.c, + nslcd/pagectrl.h, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.c, nslcd/util.h, + nslcd/xmalloc.c, nslcd/xmalloc.h, nss/Makefile.am, nss/aliases.c, + nss/common.c, nss/common.h, nss/ethers.c, nss/group.c, + nss/hosts.c, nss/netgroup.c, nss/networks.c, nss/passwd.c, + nss/protocols.c, nss/prototypes.h, nss/rpc.c, nss/services.c, + nss/shadow.c, tests/Makefile.am, tests/test_aliases.c, + tests/test_ethers.c, tests/test_group.c, tests/test_hosts.c, + tests/test_netgroup.c, tests/test_networks.c, + tests/test_passwd.c, tests/test_protocols.c, tests/test_rpc.c, + tests/test_services.c, tests/test_shadow.c: change license from + GNU Library General Public License v.2 to GNU Lesser General + Public License v.2.1 with permission from Luke Howard + +2007-01-08 22:26 arthur + + * [r214] nss/netgroup.c, nss/prototypes.h: use our own thread-local + file pointer for doing requests instead of misusing the data + field in the __netgrent struct + +2007-01-08 16:04 arthur + + * [r213] debian/control: add a provide line for libnss-ldap so we + can seamlessly replace it (it should provide the same + functionality) + +2007-01-08 15:42 arthur + + * [r212] debian/libnss-ldapd.postinst: only modify nsswitch + databases we support, leave everything else alone (e.g. + automount) + +2007-01-02 08:06 arthur + + * [r211] debian/libnss-ldapd.nslcd.init: change description in init + script + +2006-12-31 10:05 arthur + + * [r210] nslcd-common.h: if the string to write is NULL, write an + empty string + +2006-12-31 10:03 arthur + + * [r209] nslcd-common.h: ensure that all arrays that are allocated + in the buffer are now aligned to the pointer size + +2006-12-31 10:02 arthur + + * [r208] nslcd-common.h, nss/hosts.c: extract some more common + macros + +2006-12-30 10:50 arthur + + * [r207] nslcd/ldap-nss.c, tests/test_group.c: get rid of a few + warnings + +2006-12-29 10:46 arthur + + * [r206] config.sub: update to newer version again (got lost in + r205) + +2006-12-29 10:04 arthur + + * [r205] config.sub, nslcd/group.c, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/util.c: get rid of debug() function and + call log_log() instead + +2006-12-27 09:48 arthur + + * [r204] nslcd-common.h, nslcd/alias.c, nslcd/common.h, + nslcd/ether.c, nslcd/group.c, nslcd/host.c, nslcd/netgroup.c, + nslcd/network.c, nslcd/passwd.c, nslcd/protocol.c, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c: do not allocate new memory with + malloc() for each request with a string parameter but use a + buffer allocated on the stack instead (this simplifies free()-ing + the buffer(s) in case of problems) + +2006-12-25 20:30 arthur + + * [r203] nslcd/dnsconfig.c, nslcd/group.c, nslcd/ldap-nss.c, + nslcd/ldap-nss.h, nslcd/passwd.c, nslcd/util.c, nslcd/util.h: get + rid of NSS_BUFSIZ, rename _nss_ldap_oc_check() to + has_objectclass(), redo _nss_ldap_escape_string() with simpler + logic and slightly different signature and redid layout of some + code + +2006-12-23 11:50 arthur + + * [r201] ChangeLog, NEWS, TODO, configure.ac, debian/changelog: get + files ready for 0.1 release + +2006-12-22 23:23 arthur + + * [r200] nslcd.8: fix name of configuration file and update date + and version number + +2006-12-22 23:20 arthur + + * [r199] NEWS, TODO, nslcd/alias.c, nslcd/dnsconfig.c, + nslcd/dnsconfig.h, nslcd/ether.c, nslcd/group.c, nslcd/host.c, + nslcd/ldap-nss.c, nslcd/ldap-nss.h, nslcd/ldap-schema.c, + nslcd/ldap-schema.h, nslcd/netgroup.c, nslcd/network.c, + nslcd/pagectrl.c, nslcd/pagectrl.h, nslcd/passwd.c, + nslcd/protocol.c, nslcd/resolve.c, nslcd/resolve.h, nslcd/rpc.c, + nslcd/service.c, nslcd/shadow.c, nslcd/util.c, nslcd/util.h, + nss-ldapd.conf, nss-ldapd.conf.5, nss/exports.linux: remove last + keyword and disable keyword expansion + +2006-12-22 10:56 arthur + + * [r198] nslcd/Makefile.am: make list of source files a little + clearer + +2006-12-22 07:35 arthur + + * [r197] HACKING: change reference to directory name + +2006-12-21 19:55 arthur + + * [r196] Makefile.am, configure.ac, debian/copyright, nslcd, + server: rename server directory to nslcd + +2006-12-21 19:53 arthur + + * [r195] ChangeLog, Makefile.am: add code for generating ChangeLog + and add initial ChangeLog + +2006-12-21 19:04 arthur + + * [r194] .: change trunk location in repository to match package + name + +2006-12-21 10:12 arthur + + * [r193] server/alias.c, server/dnsconfig.c, server/dnsconfig.h, + server/ether.c, server/group.c, server/host.c, server/ldap-nss.c, + server/ldap-nss.h, server/ldap-schema.c, server/ldap-schema.h, + server/log.c, server/log.h, server/netgroup.c, server/network.c, + server/pagectrl.c, server/pagectrl.h, server/passwd.c, + server/protocol.c, server/rpc.c, server/service.c, + server/shadow.c, server/util.c, server/util.h, server/xmalloc.c, + server/xmalloc.h: normalize copyright headers + +2006-12-20 11:51 arthur + + * [r192] debian/copyright: update copyright file with current + copyright information + +2006-12-20 11:34 arthur + + * [r191] Makefile.am, nss/Makefile.am, server/Makefile.am, + tests/Makefile.am: properly capitalize company name + +2006-12-20 11:10 arthur + + * [r190] README: fix wrapping + +2006-12-20 11:08 arthur + + * [r189] README: integrate remaining parts in documentation + +2006-12-20 09:14 arthur + + * [r188] Makefile.am, debian/libnss-ldapd.examples: ship + nss-ldapd.conf as an example in the Debian package + +2006-12-19 22:31 arthur + + * [r187] ., debian/changelog, debian/control: change Debian source + package name to nss-ldapd + +2006-12-19 22:28 arthur + + * [r186] Makefile.am: do not try to ship gone README.Debian but do + ship new HACKING + +2006-12-19 15:04 arthur + + * [r185] nss-ldapd.conf: get rid of pam stuff + +2006-12-19 15:03 arthur + + * [r184] HACKING, NEWS, README, TODO: first step at improving + documentation + +2006-12-19 15:02 arthur + + * [r183] configure.ac, debian/changelog: change version number to + 0.1 + +2006-12-19 14:03 arthur + + * [r182] debian/libnss-ldapd.postinst: change some tests with grep + to be correct, add some comments and improve import of old + configuration file + +2006-12-19 13:55 arthur + + * [r181] debian/README.Debian: the README.Debian does not contain + any more relevant information + +2006-12-19 12:10 arthur + + * [r180] server/nslcd.c: add TODO + +2006-12-19 11:53 arthur + + * [r179] Makefile.am, configure.ac, debian/libnss-ldapd.config, + debian/libnss-ldapd.nslcd.init, debian/libnss-ldapd.postinst, + debian/libnss-ldapd.postrm, debian/rules, ldap.conf, + nss-ldapd.conf, nss-ldapd.conf.5, nss_ldap.5: change default + configuration file name to /etc/nss-ldapd.conf + +2006-12-18 22:34 arthur + + * [r178] Makefile.am, nslcd.8: add initial nslcd manual page + +2006-12-18 22:31 arthur + + * [r177] server/nslcd.c: output of --help no longer shows --config + option (which isn't there) + +2006-12-18 22:30 arthur + + * [r176] configure.ac: change name of package also in configure + +2006-12-18 21:54 arthur + + * [r175] debian/libnss-ldapd.config: handle cases where commands in + backticks return an error code + +2006-12-18 21:32 arthur + + * [r174] nss/hosts.c: only set h_errno to error value on problems + and change the returned value in some cases + +2006-12-17 22:30 arthur + + * [r173] debian/libnss-ldapd.nslcd.init: report process id in + status + +2006-12-17 11:19 arthur + + * [r172] configure.ac, debian/changelog, + debian/libnss-ldapd.config, debian/libnss-ldapd.nslcd.init, + debian/libnss-ldapd.postinst, nss/common.h, server/nslcd.c, + tests/test_networks.c: remove trailing spaces + +2006-12-17 11:18 arthur + + * [r171] nss/prototypes.h: add note about glibc manual + +2006-12-17 11:14 arthur + + * [r170] nss/Makefile.am: fix comment as to installing libraries + +2006-12-17 11:13 arthur + + * [r169] debian/control: add a snippet to the package description + as to what the main differences to libnss-ldap are + +2006-12-17 07:27 arthur + + * [r168] debian/rules: move the nss libraries to /lib instead of + /usr/lib + +2006-12-17 07:26 arthur + + * [r167] debian/rules: remove some unneeded configure options + +2006-12-16 22:17 arthur + + * [r166] Makefile.am, debian/libnss-ldapd.lintian-overrides, + debian/rules: fix some lintian warnings regarding shared + libraries with an override file and generating shlibs for now + +2006-12-16 22:15 arthur + + * [r165] debian/rules: fix configuration file manual page name + +2006-12-16 22:13 arthur + + * [r164] debian/libnss-ldapd.templates, debian/po/ca.po, + debian/po/cs.po, debian/po/da.po, debian/po/de.po, + debian/po/es.po, debian/po/fr.po, debian/po/ja.po, + debian/po/nl.po, debian/po/pt_BR.po, debian/po/ru.po, + debian/po/sv.po, debian/po/templates.pot, debian/po/vi.po: end + every short description line with a colon (and run + debconf-updatepo) (thanks lintian) + +2006-12-16 22:11 arthur + + * [r163] server/nslcd.c: set correct permissions on socket creation + and remove socket and pidfile on exit + +2006-12-16 21:52 arthur + + * [r162] nss/exports.linux, nss/group.c, nss/prototypes.h, + tests/test_group.c: remove _nss_ldap_initgroups_dyn() from + interface for now because it is currently not working + +2006-12-16 17:39 arthur + + * [r161] configure.ac: fix configure --help strings to be more + consistent and list default values + +2006-12-16 16:40 arthur + + * [r160] Makefile.am: fix debian files to ship and split off those + files into a separate variable + +2006-12-16 16:38 arthur + + * [r159] debian/po/POTFILES.in, debian/po/ca.po, debian/po/cs.po, + debian/po/da.po, debian/po/de.po, debian/po/es.po, + debian/po/fr.po, debian/po/ja.po, debian/po/nl.po, + debian/po/pt_BR.po, debian/po/ru.po, debian/po/sv.po, + debian/po/templates.pot, debian/po/vi.po: update po and pot files + based on current templates + +2006-12-16 16:35 arthur + + * [r158] debian/config, debian/libnss-ldapd.config, + debian/libnss-ldapd.postinst, debian/libnss-ldapd.postrm, + debian/libnss-ldapd.templates, debian/rules, debian/templates: + redid Debian packaging: on installation a search is done for any + reasonable configuration information (existing nss_ldap config, + hostname info, etc), configuring nsswitch.conf is also done and + all files in the debian directory have more logical names + +2006-12-16 16:25 arthur + + * [r157] Makefile.am, debian/libnss-ldapd.nslcd.init, debian/rules: + ship an init script for starting nslcd + +2006-12-14 10:34 arthur + + * [r156] AUTHORS: fix format of AUTHORS file and include new + authors + +2006-12-14 10:33 arthur + + * [r155] ANNOUNCE, README: include ANNOUNCE document in README + +2006-12-14 10:32 arthur + + * [r154] ChangeLog, NEWS: rename ChangeLog to NEWS and change + formatting of file to follow common format + +2006-12-13 16:07 arthur + + * [r153] NEWS, TODO: NEWS looks more like a TODO + +2006-12-08 21:58 arthur + + * [r152] Makefile.am, debian/changelog, debian/control, + debian/libnss-ldapd.postinst, debian/rules: clean up Debian + packaging a bit + +2006-12-08 21:45 arthur + + * [r151] tests/ldaptest.pl, tests/nsswitch.test, tests/testd.c, + tests/testgr.c, tests/testnss.c, tests/testpw.c, tests/testpw3.c, + tests/testpw4.c, tests/testpw5.c, tests/testpw6.c: get rid of old + test code (most of it should be covered by the new test code) + +2006-12-08 19:40 arthur + + * [r150] .: ignore generated debuild files + +2006-12-08 19:37 arthur + + * [r149] debian/po/ca.po, debian/po/cs.po, debian/po/da.po, + debian/po/de.po, debian/po/es.po, debian/po/fr.po, + debian/po/ja.po, debian/po/nl.po, debian/po/pt_BR.po, + debian/po/ru.po, debian/po/sv.po, debian/po/templates.pot, + debian/po/vi.po, debian/templates: do not make default values + translatable + +2006-12-08 19:31 arthur + + * [r148] nss/common.c: fix indentation + +2006-12-08 19:31 arthur + + * [r147] README, debian/LDAP-Permissions.txt, debian/examples, + debian/libnss-ldapd.docs: get rid of more documentation in an + attempt to include all useful documentation in one place + +2006-12-08 19:04 arthur + + * [r146] Makefile.am, README, doc: reasonable configuration + information (existing nss_ldap config, parts in top-level README + +2006-12-08 18:37 arthur + + * [r145] configure.ac, nslcd.h: specify socket and pidfile location + with configure script + +2006-12-08 17:17 arthur + + * [r144] debian/po/ca.po, debian/po/cs.po, debian/po/da.po, + debian/po/de.po, debian/po/es.po, debian/po/fr.po, + debian/po/ja.po, debian/po/nl.po, debian/po/pt_BR.po, + debian/po/ru.po, debian/po/sv.po, debian/po/templates.pot, + debian/po/vi.po: run debconf-updatepo to get pot and po files in + a consistent state + +2006-12-08 16:26 arthur + + * [r143] debian/control: get rid of cdbs build dependency + +2006-12-07 12:18 arthur + + * [r142] debian, debian/README.Debian, debian/changelog, + debian/control, debian/libnss-ldap.dirs, debian/libnss-ldap.init, + debian/libnss-ldap.install, debian/libnss-ldap.links, + debian/libnss-ldap.postinst, debian/libnss-ldap.postrm, + debian/libnss-ldapd.docs, debian/libnss-ldapd.postinst, + debian/libnss-ldapd.postrm, debian/rules: initial step to get + working Debian packaging + +2006-12-05 22:26 arthur + + * [r141] Makefile.am, compile, config.sub, configure.ac, + nss/Makefile.am, server/Makefile.am: clean up build scripts to + only link nslcd to OpenSSL and to cleanly create a nss_ldap.so + file + +2006-12-05 22:25 arthur + + * [r140] server/ldap-nss.c, server/ldap-nss.h: get rid of + _nss_ldap_get_ld_errno() which wasn't used + +2006-12-03 17:18 arthur + + * [r139] server/nslcd.c: fix logging levels and remove some + commented out code + +2006-12-03 17:17 arthur + + * [r138] server/ldap-nss.c, server/ldap-schema.c, server/passwd.c: + get rid of some more unneeded code + +2006-12-03 17:16 arthur + + * [r137] tests/Makefile.am: split out common files into own + variable and disable (comment out) protocol debugging + +2006-12-03 17:15 arthur + + * [r136] nss/exports.linux: regenerate from prototypes.h + +2006-11-30 17:52 arthur + + * [r135] server/Makefile.am, server/alias.c, server/common.h, + server/ether.c, server/group.c, server/host.c, server/ldap-nss.c, + server/netgroup.c, server/network.c, server/nslcd-server.c, + server/nslcd-server.h, server/nslcd.c, server/passwd.c, + server/protocol.c, server/rpc.c, server/service.c, + server/shadow.c, server/util.c: implement a simple threading + solution and move code from nslcd-server.c to nslcd.c + +2006-11-28 16:21 arthur + + * [r134] nslcd.h, nss/aliases.c, nss/ethers.c, nss/group.c, + nss/passwd.c, nss/protocols.c, nss/rpc.c, nss/services.c, + nss/shadow.c, server/alias.c, server/ether.c, server/group.c, + server/passwd.c, server/protocol.c, server/rpc.c, + server/service.c, server/shadow.c: rename LDF_ marcos to NSLCD_ + macros to have a single namespace + +2006-11-28 15:44 arthur + + * [r133] server: ignore generated nslcd binary + +2006-11-28 15:44 arthur + + * [r132] configure.ac: look for nslcd.h now since nslcd.c has been + moved into the server directory + +2006-11-28 10:59 arthur + + * [r131] ., Makefile.am, configure.ac, exports.linux, log.c, log.h, + nslcd-common.h, nslcd-server.c, nslcd-server.h, nslcd.c, + nss/Makefile.am, nss/exports.linux, server, server/Makefile.am, + server/log.c, server/log.h, server/nslcd-server.c, + server/nslcd-server.h, server/nslcd.c, server/xmalloc.c, + server/xmalloc.h, testnss.c, tests, tests/Makefile.am, + tests/test_aliases.c, tests/test_ethers.c, tests/test_group.c, + tests/test_hosts.c, tests/test_netgroup.c, tests/test_networks.c, + tests/test_passwd.c, tests/test_protocols.c, tests/test_rpc.c, + tests/test_services.c, tests/test_shadow.c, tests/testnss.c, + xmalloc.c, xmalloc.h: get as many files from the root directory + as possible, moving all server related code to the server + directory and moving and splitting the test code to the tests + directory + +2006-11-28 09:59 arthur + + * [r130] nslcd-server.c, nss/networks.c, server/network.c, + testnss.c: implement network name lookups on server side plus + some fixes on the client side + +2006-11-28 09:54 arthur + + * [r129] nslcd-server.c, server/common.c: include config.h as first + statement + +2006-11-28 09:45 arthur + + * [r128] nslcd-common.h: implement more detailed protocol logging + (dumping the actual byte values read and written) + +2006-11-27 09:59 arthur + + * [r127] Makefile.am, nslcd-client.c, nslcd-client.h, + nss/Makefile.am, nss/aliases.c, nss/common.c, nss/common.h, + nss/ethers.c, nss/group.c, nss/hosts.c, nss/netgroup.c, + nss/networks.c, nss/passwd.c, nss/protocols.c, nss/rpc.c, + nss/services.c, nss/shadow.c: get rid of nslcd-client.{c,h} and + move it to nss/common.{c,h}, this ensures that all code that is + needed for the nss part is in the nss directory + +2006-11-27 09:05 arthur + + * [r126] server/host.c, server/rpc.c: fix typos + +2006-11-26 22:36 arthur + + * [r125] server/Makefile.am, server/dnsconfig.c, + server/dnsconfig.h, server/ether.c, server/group.c, + server/ldap-nss.c, server/ldap-nss.h, server/ldap-parse.h, + server/ldap-schema.c, server/ldap-schema.h, server/network.c, + server/passwd.c, server/util.c, server/util.h: clean up header + files + +2006-11-26 12:01 arthur + + * [r124] doc/autofs-4.1.3-lookup-nssldap.patch, + doc/lookup_nssldap.c, ldap.conf, nslcd-server.c, nslcd-server.h, + nslcd.h, nss/Makefile.am, nss/automount.c, nss/prototypes.h, + server/Makefile.am, server/automount.c, server/ldap-nss.h, + server/ldap-schema.c, server/ldap-schema.h, server/rpc.c, + server/util.c, server/util.h: get rid of automount map + information lookups through NSS as this is not used (at least not + with glibc), autofs-ldap looks up the information on it's own + (but does parse /etc/nsswitch.conf) + +2006-11-25 10:56 arthur + + * [r123] nslcd-server.c, nss/services.c, server/service.c, + testnss.c: implement server end of service name lookup and fix + client end to translate between host and network byte order and + to also pass protocol in request + +2006-11-25 10:55 arthur + + * [r122] nslcd-common.h: fix bug that always causes a + READ_STRING_ALLOC to read to a variable called name + +2006-11-25 10:09 arthur + + * [r121] nslcd-server.c, server/rpc.c, testnss.c: implement rpc + service on server side + +2006-11-25 10:09 arthur + + * [r120] server/host.c: get rid of superfluous test + +2006-11-25 10:08 arthur + + * [r119] server/protocol.c: only flush the stream after writing all + records + +2006-11-25 09:16 arthur + + * [r118] nslcd-server.c, server/protocol.c, testnss.c: implement + protocol handling (server side) + +2006-11-25 09:16 arthur + + * [r117] nslcd.h, nss/netgroup.c, nss/prototypes.h: trip trailing + whitespace + +2006-11-25 08:07 arthur + + * [r116] nslcd-common.h: include stdio for definitions of fread(), + fwrite() etc + +2006-11-24 11:10 arthur + + * [r115] nslcd-server.c, server/host.c, testnss.c: implement server + end of host name lookups (without IPv6 support sofar) + +2006-11-24 11:03 arthur + + * [r114] nss/hosts.c: fix problem with allocated array for storing + addresses, properly set h_errnop and check empty address (only + addresses of other address family) in nss functions, not in + read_hostent() + +2006-11-24 10:58 arthur + + * [r113] nslcd-common.h: make protocol logging a little more + readable and do not use fseek() in streams because that is not + supported + +2006-11-22 13:16 arthur + + * [r112] server/alias.c, server/ether.c, server/group.c, + server/passwd.c, server/shadow.c: only flush the stream after + writing all records (not every time) and more logging consistency + +2006-11-22 12:18 arthur + + * [r111] nslcd-server.c, server/shadow.c, testnss.c: implement + server end of shadow lookups + +2006-11-22 12:17 arthur + + * [r110] server/alias.c, server/passwd.c: make logging a little bit + more consistent + +2006-11-22 11:45 arthur + + * [r109] server/netgroup.c: add extra copyright information (the + exact same code was seen in glibc) + +2006-11-21 16:45 arthur + + * [r108] nslcd-server.c, nslcd.h, nss/netgroup.c, + server/netgroup.c, testnss.c: implement netgroup lookups, + including test code + +2006-11-19 15:49 arthur + + * [r107] nslcd.h: include a note about encoding of strings + +2006-11-19 15:38 arthur + + * [r106] nslcd-server.c, server/ether.c: implement nslcd_ether_*() + functions + +2006-11-19 15:37 arthur + + * [r105] nslcd-server.c, nslcd-server.h: create prototypes for all + server methods + +2006-11-19 15:36 arthur + + * [r104] nss/ethers.c: write contents of ethernet address not + pointer + +2006-11-19 08:57 arthur + + * [r103] server/group.c: add missing semicolon + +2006-11-19 08:55 arthur + + * [r102] nslcd-common.h: add more verbose protocol logging, + including logging of errors + +2006-11-19 08:54 arthur + + * [r101] ., debian, doc, nss, server, tests: ignore stale nfs files + +2006-11-19 08:51 arthur + + * [r100] nss/common.h: fix bug: the readfn() function was executed + twice + +2006-11-18 08:12 arthur + + * [r99] server/group.c, server/netgroup.c: some layout changes + +2006-11-18 08:09 arthur + + * [r98] nslcd.h: include changes to handle protocol, rpc, service + and netgroup nslcd calls + +2006-11-17 22:59 arthur + + * [r97] nss/Makefile.am, nss/netgroup.c, nss/prototypes.h: + implement netgroup lookups + +2006-11-17 22:55 arthur + + * [r96] nss/aliases.c, nss/automount.c, nss/common.h, nss/ethers.c, + nss/group.c, nss/hosts.c, nss/networks.c, nss/passwd.c, + nss/protocols.c, nss/rpc.c, nss/services.c, nss/shadow.c: do some + refactoring in the generated code and add some documentation on + generated code in comments in common.h + +2006-11-16 13:06 arthur + + * [r95] nss/Makefile.am, nss/services.c: implement reading of + services entities + +2006-11-16 12:57 arthur + + * [r94] nss/Makefile.am, nss/rpc.c: implement reading of rpc + entities + +2006-11-16 12:51 arthur + + * [r93] nss/Makefile.am, nss/protocols.c: implement reading of + protocol entities + +2006-11-16 12:50 arthur + + * [r92] nss/aliases.c, nss/common.h, nss/ethers.c, nss/group.c, + nss/hosts.c, nss/networks.c, nss/passwd.c, nss/shadow.c: switch + to a simpler and more compact framework to generate methods (one + reader function to deserialize a struct from the stream and + auto-generated functions) + +2006-11-15 15:06 arthur + + * [r91] nslcd.h, nss/Makefile.am, nss/networks.c, nss/prototypes.h: + implement network information lookups through NSS + +2006-11-15 11:00 arthur + + * [r90] nss/hosts.c: properly filter out empty returned address + records and return NOTFOUND for entries without addresses in our + address family + +2006-11-14 14:41 arthur + + * [r89] xmalloc.h: add xxmalloc() macro to simply allocate a + structure of a certain type + +2006-11-14 14:40 arthur + + * [r88] nslcd.h, nss/Makefile.am, nss/automount.c, + nss/prototypes.h: implement automounter maps lookups + +2006-11-14 14:40 arthur + + * [r87] nss/common.h: just close the stream in case of problems + instead of calling endent() + +2006-11-11 15:38 arthur + + * [r86] server/group.c: include some other functions into lookup + functions to increase readability + +2006-11-11 15:16 arthur + + * [r85] server/Makefile.am, server/alias.c, server/aliases.c, + server/automount.c, server/common.c, server/common.h, + server/ether.c, server/ethers.c, server/group.c, server/host.c, + server/hosts.c, server/ldap-nss.c, server/ldap-nss.h, + server/ldap-parse.h, server/ldap-schema.c, server/ldap-schema.h, + server/netgroup.c, server/network.c, server/networks.c, + server/passwd.c, server/protocol.c, server/protocols.c, + server/rpc.c, server/service.c, server/services.c, + server/shadow.c, server/util.c, server/util.h: fix naming and + copyright headers + +2006-11-11 14:02 arthur + + * [r84] server/aliases.c, server/ldap-nss.c, server/ldap-nss.h, + server/util.c, server/util.h: simplify some functions to pass + file pointer around instead of struct and buffer (initially only + for alias_byname()) + +2006-11-11 07:17 arthur + + * [r83] server/ldap-nss.h: some reformatting + +2006-11-10 15:36 arthur + + * [r82] nslcd.h, nss/Makefile.am, nss/aliases.c, nss/ethers.c, + nss/exports.h, nss/group.c, nss/hosts.c, nss/passwd.c, + nss/prototypes.h, nss/shadow.c, testnss.c: rename nss/exports.h + to nss/prototypes.h + +2006-11-10 15:31 arthur + + * [r81] nss/exports.h, nss/group.c, nss/hosts.c, nss/passwd.c, + nss/shadow.c: switch to using prototypes that are defined in + glibc 2.3.6 + +2006-11-10 13:56 arthur + + * [r80] nslcd.h, nss/Makefile.am, nss/shadow.c, testnss.c: + implement NSS-side shadow lookups (plus test code) + +2006-11-10 13:08 arthur + + * [r79] nslcd.h, nss/Makefile.am, nss/ethers.c, nss/exports.h, + testnss.c: implement NSS-side ethers database lookups plus test + code + +2006-11-10 12:44 arthur + + * [r78] nss/exports.h, nss/hosts.c, testnss.c: add test code for + host database and add const to function definition + +2006-11-10 11:51 arthur + + * [r77] nss/aliases.c, nss/group.c, nss/hosts.c: use better names + for our thread-local file pointer + +2006-11-07 21:18 arthur + + * [r76] server/aliases.c: expand some marcos and combine some code + +2006-11-07 21:06 arthur + + * [r75] server/passwd.c: expand some marcos and combine some code + +2006-11-05 23:14 arthur + + * [r74] nslcd-common.h, testnss.c: add proper copyright headers + +2006-11-05 23:05 arthur + + * [r73] nslcd-server.c, nslcd-server.h, server/group.c, testnss.c: + implement group functions in server but currently + group_bymember() does not work + +2006-11-05 22:57 arthur + + * [r72] nslcd-common.h: remove testing stuff + +2006-11-05 22:57 arthur + + * [r71] nslcd-common.h: fix some variable usage bugs in READ_* + marcos and change protocol debugging marcos to not use variadic + arguments + +2006-11-04 13:05 arthur + + * [r70] Makefile.am, certutil, doc/nsswitch.ldap, nsswitch.ldap: + reorganize (and get rid of) some files + +2006-11-03 22:03 arthur + + * [r69] nslcd.h, nss/Makefile.am, nss/hosts.c: implement initial + host database lookups NSS-side + +2006-11-03 22:01 arthur + + * [r68] nslcd-common.h: make SKIP more consistent with READ + +2006-11-03 19:07 arthur + + * [r67] nslcd-server.c: clean struct sockaddr_un structure before + usage + +2006-11-03 13:55 arthur + + * [r66] nslcd-common.h, nss/group.c: fix bogus reuse of tmpint32, + introducing tmp3int32 + +2006-11-03 13:46 arthur + + * [r65] nslcd-common.h: split buffer management macros into + separate macros + +2006-11-03 12:37 arthur + + * [r64] nslcd-common.h, nslcd.h, nss/aliases.c, nss/group.c, + server/aliases.c: rename LOOP to STRINGLIST as that is currently + the only supported format + +2006-11-03 12:09 arthur + + * [r63] nslcd-common.h, nss/group.c: add _nss_ldap_initgroups_dyn() + function + +2006-11-03 10:06 arthur + + * [r62] nslcd-common.h, nss/aliases.c, nss/common.h, nss/group.c, + nss/passwd.c: make loop macros common, create macros for + expanding {set,get,end}ent() functions and implement + {set,get,end}aliasent + +2006-11-03 10:03 arthur + + * [r61] nslcd.h: small documentation fixes + +2006-11-03 10:03 arthur + + * [r60] nslcd-server.h: implement nslcd_alias_all() server-side + +2006-11-03 10:02 arthur + + * [r59] nslcd-server.c, server/aliases.c: implement + nslcd_alias_all() server-side + +2006-11-03 10:02 arthur + + * [r58] server/group.c: get rid of some more unneeded code + +2006-11-02 14:17 arthur + + * [r57] server/aliases.c, server/passwd.c: some small fixes + +2006-11-02 14:13 arthur + + * [r56] nslcd-client.h, nslcd-server.c, nslcd-server.h, nslcd.h, + nss/aliases.c, nss/common.c, nss/passwd.c, server/aliases.c, + server/common.c, server/passwd.c: rename some constants and + switch to a more sane naming scheme + +2006-11-02 13:58 arthur + + * [r55] nss/exports.h: we only need to export + _nss_ldap_initgroups_dyn(), not _nss_ldap_initgroups() + +2006-11-02 12:08 arthur + + * [r54] nslcd-client.h, nss/aliases.c, nss/group.c, nss/passwd.c: + rename READ_RESPONSE() macro to READ_RESPONSE_CODE() + +2006-11-01 22:48 arthur + + * [r53] nslcd.h, nss/Makefile.am, nss/group.c, testnss.c: implement + NSS side of getgrnam(), getgrgid() and {set,get,end}grent() + +2006-11-01 14:05 arthur + + * [r52] nss/aliases.c, nss/common.h, nss/passwd.c: always set + *errnop correctly + +2006-11-01 13:13 arthur + + * [r51] CVSVersionInfo.txt, Makefile.am: get rid of + CVSVersionInfo.txt + +2006-11-01 12:58 arthur + + * [r50] nslcd.c: prevent recursive hostname lookups through ldap + +2006-11-01 12:32 arthur + + * [r49] Makefile.am: add some files to EXTRA_DIST + +2006-11-01 12:19 arthur + + * [r48] nslcd-server.c, nslcd.h, server/common.c, server/group.c, + server/passwd.c: get rid of some trailing spaces + +2006-11-01 12:19 arthur + + * [r47] nslcd.c: ignore SIGPIPE and get rid of some trailing spaces + +2006-11-01 12:18 arthur + + * [r46] testnss.c: only print result on success and errors on + failure + +2006-11-01 12:17 arthur + + * [r45] server/common.h: do not close the server-side stream as the + main dispatcher will close it + +2006-11-01 12:13 arthur + + * [r44] nss/passwd.c: implement _nss_ldap_{set,get,end}pwent() + functions with thread-local opened file + +2006-11-01 12:08 arthur + + * [r43] nss/common.h: also set file pointer to NULL when closing a + stream to properly handle reuse of stream + +2006-11-01 12:04 arthur + + * [r42] log.c: prefix debugging messages with DEBUG + +2006-11-01 12:04 arthur + + * [r41] configure.ac: look for different file in source directory, + improve --enable-debug option and add checking for __thread + keyword + +2006-11-01 12:02 arthur + + * [r40] nslcd-common.h: do not try to read and write zero length + strings and add protocol debugging option + +2006-11-01 09:23 arthur + + * [r39] Makefile.am, dnsconfig.c, dnsconfig.h, ldap-nss.c, + ldap-nss.h, ldap-parse.h, ldap-schema.c, ldap-schema.h, nslcd.c, + pagectrl.c, pagectrl.h, resolve.c, resolve.h, server/Makefile.am, + server/dnsconfig.c, server/dnsconfig.h, server/ldap-nss.c, + server/ldap-nss.h, server/ldap-parse.h, server/ldap-schema.c, + server/ldap-schema.h, server/pagectrl.c, server/pagectrl.h, + server/resolve.c, server/resolve.h, server/util.c, server/util.h, + util.c, util.h: move some remaining files into the server/ + directory + +2006-10-31 14:18 arthur + + * [r38] nslcd-common.h, nslcd-server.c, nslcd-server.h, nslcd.h, + nss/aliases.c, server/aliases.c, server/passwd.c, testnss.c: + implement reading of alias information through getaliasbyname() + +2006-10-31 12:46 arthur + + * [r37] nss/aliases.c, nss/common.c, nss/common.h, nss/exports.h, + nss/passwd.c: make code consistent by adding headers, removing + trailing whitespace and proper ifdefs for header files + +2006-10-31 12:19 arthur + + * [r36] .: ignore more files + +2006-10-31 12:18 arthur + + * [r35] nslcd-common.h: add header file defining read and write + macros + +2006-10-31 12:17 arthur + + * [r34] nslcd-client.c, nslcd-client.h, nslcd-server.c, + nslcd-server.h, nslcd.h, nss/Makefile.am, nss/common.c, + nss/common.h, nss/passwd.c, server/common.h, server/passwd.c, + testnss.c: clear up protocol macros while implementing getpwuid() + and {set,get,end}pwent() functions (last not yet on NSS side) + +2006-10-31 10:08 arthur + + * [r33] nslcd.h: document protocol a little better + +2006-10-30 16:21 arthur + + * [r32] Makefile.am, nslcd-client.c, nslcd-client.h, + nslcd-server.c, nslcd-server.h, nslcd.c, nslcd.h, testnss.c: get + first working version of end-to-end test of nss call using simple + test program + +2006-10-30 16:16 arthur + + * [r31] Makefile.am, configure.ac: add server directory + +2006-10-30 16:15 arthur + + * [r30] nss/passwd.c: get rid of some empty lines + +2006-10-30 15:37 arthur + + * [r29] server, server/Makefile.am, server/common.c, + server/common.h, server/passwd.c: implement simple password + lookup with nslcd_getpwnam() function + +2006-10-30 13:44 arthur + + * [r28] nss/common.h, nss/passwd.c: return read data in struct and + fix some marcos + +2006-10-30 13:40 arthur + + * [r27] nss/Makefile.am: do not build libnss_ldap.so in this + directory, only build nss object functions + +2006-10-25 21:48 arthur + + * [r26] configure.ac, nss: build nss directory + +2006-10-25 15:22 arthur + + * [r25] ldap-alias.c, ldap-automount.c, ldap-ethers.c, ldap-grp.c, + ldap-hosts.c, ldap-netgrp.c, ldap-network.c, ldap-proto.c, + ldap-pwd.c, ldap-rpc.c, ldap-service.c, ldap-spwd.c, server, + server/aliases.c, server/automount.c, server/ethers.c, + server/group.c, server/hosts.c, server/netgroup.c, + server/networks.c, server/passwd.c, server/protocols.c, + server/rpc.c, server/services.c, server/shadow.c: move ldap + server code into separate directory + +2006-10-25 15:11 arthur + + * [r24] Makefile.am, nslcd-client.c, nslcd-client.h, nslcd.h, nss, + nss/Makefile.am, nss/aliases.c, nss/common.c, nss/common.h, + nss/exports.h, nss/passwd.c: add some basic minimal NSS code that + can be generated from macros + +2006-10-23 12:03 arthur + + * [r23] ., Makefile.am, configure.ac, log.c, log.h, nslcd-client.c, + nslcd-client.h, nslcd-server.c, nslcd-server.h, nslcd.c, nslcd.h, + xmalloc.c, xmalloc.h: implemented basic client/server setup with + a thin client comminicating with a local server over a socket + (initial version of code, much needs to be done) + +2006-10-23 12:02 arthur + + * [r22] ldap-grp.c, ldap-parse.h: rearrange functions in more + logical order + +2006-10-23 12:01 arthur + + * [r21] ldap-nss.h: align comments + +2006-10-23 11:26 arthur + + * [r20] ldap-pwd.c: export function _nss_ldap_parse_pw() + +2006-10-17 14:13 arthur + + * [r19] Makefile.am, dnsconfig.c, dnsconfig.h, ldap-alias.c, + ldap-automount.c, ldap-ethers.c, ldap-grp.c, ldap-hosts.c, + ldap-netgrp.c, ldap-network.c, ldap-nss.c, ldap-nss.h, + ldap-parse.h, ldap-proto.c, ldap-pwd.c, ldap-rpc.c, + ldap-schema.c, ldap-schema.h, ldap-service.c, ldap-spwd.c, ltf.c, + ltf.h, pagectrl.c, pagectrl.h, resolve.c, resolve.h, util.c: get + rid of ltf files (which contain NPL licenced code btw) clean up + includes and general small code cleanups + +2006-10-17 13:40 arthur + + * [r18] .cvsignore: get rid of this file + +2006-10-16 15:02 arthur + + * [r17] Makefile.am, dnsconfig.c, dnsconfig.h, ldap-alias.c, + ldap-automount.c, ldap-ethers.c, ldap-grp.c, ldap-hosts.c, + ldap-netgrp.c, ldap-network.c, ldap-nss.c, ldap-nss.h, + ldap-parse.h, ldap-proto.c, ldap-pwd.c, ldap-rpc.c, + ldap-schema.h, ldap-service.c, ldap-spwd.c, ltf.c, nss_common.h, + nss_ldap.spec, util.c, util.h: some more cleanups, expanding some + MACROs and typedefs and get rid of some more code + +2006-10-15 10:48 arthur + + * [r16] configure.ac: add --enable-warnings option for extra + compiler warnings + +2006-10-12 13:00 arthur + + * [r15] Makefile.am, exports.solaris, ldap-alias.c, ldap-alias.h, + ldap-automount.c, ldap-automount.h, ldap-bp.c, ldap-bp.h, + ldap-ethers.c, ldap-ethers.h, ldap-grp.c, ldap-grp.h, + ldap-hosts.c, ldap-hosts.h, ldap-netgrp.c, ldap-netgrp.h, + ldap-network.c, ldap-network.h, ldap-proto.c, ldap-proto.h, + ldap-pwd.c, ldap-pwd.h, ldap-rpc.c, ldap-rpc.h, ldap-service.c, + ldap-service.h, ldap-spwd.c, ldap-spwd.h: get rid of some + unnecessary header files (and a c file) + +2006-10-12 12:34 arthur + + * [r14] ANNOUNCE, AUTHORS, COPYING, ChangeLog, Makefile.am, NEWS, + README, certutil, configure.ac, dnsconfig.c, dnsconfig.h, + ldap-alias.c, ldap-alias.h, ldap-automount.c, ldap-automount.h, + ldap-bp.c, ldap-bp.h, ldap-ethers.c, ldap-ethers.h, ldap-grp.c, + ldap-grp.h, ldap-hosts.c, ldap-hosts.h, ldap-netgrp.c, + ldap-netgrp.h, ldap-network.c, ldap-network.h, ldap-nss.c, + ldap-nss.h, ldap-parse.h, ldap-proto.c, ldap-proto.h, ldap-pwd.c, + ldap-pwd.h, ldap-rpc.c, ldap-rpc.h, ldap-schema.c, ldap-schema.h, + ldap-service.c, ldap-service.h, ldap-spwd.c, ldap-spwd.h, + ldap.conf, ltf.c, ltf.h, nss_common.h, nss_ldap.5, nss_ldap.spec, + pagectrl.c, pagectrl.h, resolve.c, resolve.h, util.c, util.h: + remove trailing spaces + +2006-10-12 12:32 arthur + + * [r13] ANNOUNCE, AUTHORS, Makefile.am, NEWS, README, certutil, + configure.ac, dnsconfig.c, dnsconfig.h, exports.aix, + exports.hpux, exports.linux, exports.solaris, ldap-alias.c, + ldap-alias.h, ldap-automount.c, ldap-automount.h, ldap-bp.c, + ldap-bp.h, ldap-ethers.c, ldap-ethers.h, ldap-grp.c, ldap-grp.h, + ldap-hosts.c, ldap-hosts.h, ldap-netgrp.c, ldap-netgrp.h, + ldap-network.c, ldap-network.h, ldap-nss.c, ldap-nss.h, + ldap-parse.h, ldap-proto.c, ldap-proto.h, ldap-pwd.c, ldap-rpc.c, + ldap-rpc.h, ldap-schema.c, ldap-schema.h, ldap-service.c, + ldap-service.h, ldap-spwd.c, ldap-spwd.h, ldap.conf, ltf.c, + nsswitch.ldap, pagectrl.c, resolve.c, resolve.h, util.c, util.h: + some more small cleanups of code for non-supported systems and + convert tabs to spaces + +2006-10-12 12:29 arthur + + * [r12] configure.ac: include templates from acconfig.h into + configure.ac + +2006-10-12 11:38 arthur + + * [r11] debian/rules: set as executable + +2006-10-12 11:01 arthur + + * [r10] Makefile.am, aix_authmeth.c, dnsconfig.c, dnsconfig.h, + irs-grp.c, irs-hosts.c, irs-netgrp.c, irs-network.c, irs-nss.c, + irs-nss.h, irs-proto.c, irs-pwd.c, irs-service.c, irs.h, + ldap-alias.c, ldap-alias.h, ldap-automount.c, ldap-automount.h, + ldap-bp.c, ldap-bp.h, ldap-ethers.c, ldap-ethers.h, ldap-grp.c, + ldap-grp.h, ldap-hosts.c, ldap-hosts.h, ldap-netgrp.c, + ldap-netgrp.h, ldap-network.c, ldap-network.h, ldap-nss.c, + ldap-nss.h, ldap-parse.h, ldap-proto.c, ldap-proto.h, ldap-pwd.c, + ldap-pwd.h, ldap-rpc.c, ldap-rpc.h, ldap-schema.c, ldap-schema.h, + ldap-service.c, ldap-service.h, ldap-sldap.c, ldap-sldap.h, + ldap-spwd.c, ldap-spwd.h, ltf.c, ltf.h, nss_common.h, + nss_dbdefs.h, nss_ldap.5, pagectrl.c, pagectrl.h, resolve.c, + resolve.h, snprintf.c, snprintf.h, util.c, util.h: first round of + cleanups, all non-glibc NSS stuff has been removed, because we + are going to do some major restructuring it will not likely + remain valid anyway and we can always re-add it later + +2006-10-12 08:00 arthur + + * [r9] CVSVersionInfo.txt, ChangeLog, NEWS, aix_authmeth.c, + certutil, dnsconfig.c, dnsconfig.h, + doc/autofs-4.1.3-lookup-nssldap.patch, doc/lookup_nssldap.c, + exports.linux, exports.solaris, irs-grp.c, irs-hosts.c, + irs-netgrp.c, irs-network.c, irs-nss.c, irs-nss.h, irs-proto.c, + irs-pwd.c, irs-service.c, irs.h, ldap-alias.c, ldap-alias.h, + ldap-automount.c, ldap-automount.h, ldap-bp.c, ldap-bp.h, + ldap-ethers.c, ldap-ethers.h, ldap-grp.c, ldap-grp.h, + ldap-hosts.c, ldap-hosts.h, ldap-netgrp.c, ldap-netgrp.h, + ldap-network.c, ldap-network.h, ldap-nss.c, ldap-nss.h, + ldap-parse.h, ldap-proto.c, ldap-proto.h, ldap-pwd.c, ldap-pwd.h, + ldap-rpc.c, ldap-rpc.h, ldap-schema.c, ldap-schema.h, + ldap-service.c, ldap-service.h, ldap-sldap.c, ldap-sldap.h, + ldap-spwd.c, ldap-spwd.h, ldap.conf, ltf.c, ltf.h, nss_common.h, + nss_dbdefs.h, nss_ldap.5, nsswitch.ldap, pagectrl.c, pagectrl.h, + resolve.c, resolve.h, snprintf.c, snprintf.h, + tests/nsswitch.test, tests/testpw.c, tests/testpw4.c, + tests/testpw5.c, tests/testpw6.c, util.c, util.h: add keyword + expansion (svn:keywords) to all files containing keywords + +2006-10-12 07:50 arthur + + * [r8] Makefile.am, configure.ac: add West to copyrights notice + +2006-10-11 14:00 arthur + + * [r7] INSTALL: install newer version from automake + +2006-10-11 13:58 arthur + + * [r6] Makefile.am, acconfig.h, aclocal.m4, autogen.sh, + config.guess, config.h.in, config.sub, configure.ac, + configure.in, depcomp, install-sh, missing, mkinstalldirs, + stamp-h, stamp-h.in: first step in cleaning up build process + (switch to newer autoconf/automake and remove generated files + from version control) + +2006-10-11 13:52 arthur + + * [r5] ., Makefile.in, configure: remove some files from version + control and add more ignores + +2006-10-11 13:44 arthur + + * [r4] ., debian: ignore some generated files + +2006-10-11 13:37 arthur + + * [r3] .: branch off latest Debian version + +2006-10-11 13:37 arthur + + * [r2] ., Makefile.am, Makefile.in, aclocal.m4, configure, + configure.in, debian, debian/LDAP-Permissions.txt, + debian/README.Debian, debian/changelog, debian/compat, + debian/config, debian/control, debian/copyright, debian/examples, + debian/examples/groups.ldif, debian/examples/people.ldif, + debian/libnss-ldap.dirs, debian/libnss-ldap.init, + debian/libnss-ldap.install, debian/libnss-ldap.links, + debian/libnss-ldap.postinst, debian/libnss-ldap.postrm, + debian/po, debian/po/POTFILES.in, debian/po/ca.po, + debian/po/cs.po, debian/po/da.po, debian/po/de.po, + debian/po/es.po, debian/po/fr.po, debian/po/ja.po, + debian/po/nl.po, debian/po/pt_BR.po, debian/po/ru.po, + debian/po/sv.po, debian/po/templates.pot, debian/po/vi.po, + debian/rules, debian/templates, ldap-nss.c, ldap-nss.h, + ldap-pwd.c, ldap.conf, stamp-h: import Debian release 251-5.2 + +2006-10-11 13:34 arthur + + * [r1] ., .cvsignore, ANNOUNCE, AUTHORS, COPYING, + CVSVersionInfo.txt, ChangeLog, INSTALL, Makefile.am, Makefile.in, + NEWS, README, acconfig.h, aclocal.m4, aix_authmeth.c, autogen.sh, + certutil, config.guess, config.h.in, config.sub, configure, + configure.in, depcomp, dnsconfig.c, dnsconfig.h, doc, + doc/README.AIX, doc/README.HPUX, doc/README.IRS, doc/README.SFU, + doc/README.paged, doc/SolarisInstallNotes.txt, + doc/autofs-4.1.3-lookup-nssldap.patch, doc/lookup_nssldap.c, + exports.aix, exports.hpux, exports.linux, exports.solaris, + install-sh, irs-grp.c, irs-hosts.c, irs-netgrp.c, irs-network.c, + irs-nss.c, irs-nss.h, irs-proto.c, irs-pwd.c, irs-service.c, + irs.h, ldap-alias.c, ldap-alias.h, ldap-automount.c, + ldap-automount.h, ldap-bp.c, ldap-bp.h, ldap-ethers.c, + ldap-ethers.h, ldap-grp.c, ldap-grp.h, ldap-hosts.c, + ldap-hosts.h, ldap-netgrp.c, ldap-netgrp.h, ldap-network.c, + ldap-network.h, ldap-nss.c, ldap-nss.h, ldap-parse.h, + ldap-proto.c, ldap-proto.h, ldap-pwd.c, ldap-pwd.h, ldap-rpc.c, + ldap-rpc.h, ldap-schema.c, ldap-schema.h, ldap-service.c, + ldap-service.h, ldap-sldap.c, ldap-sldap.h, ldap-spwd.c, + ldap-spwd.h, ldap.conf, ltf.c, ltf.h, missing, mkinstalldirs, + nss_common.h, nss_dbdefs.h, nss_ldap.5, nss_ldap.spec, + nsswitch.ldap, pagectrl.c, pagectrl.h, resolve.c, resolve.h, + snprintf.c, snprintf.h, stamp-h.in, tests, tests/ldaptest.pl, + tests/nsswitch.test, tests/testd.c, tests/testgr.c, + tests/testpw.c, tests/testpw3.c, tests/testpw4.c, + tests/testpw5.c, tests/testpw6.c, util.c, util.h: import release + 251 of nss-ldap + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/HACKING b/contrib/slapd-modules/nssov/nss-ldapd/HACKING new file mode 100644 index 0000000000..8ec90729c3 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/HACKING @@ -0,0 +1,154 @@ + +This document tries to describe the software layout and design of the library. +It should provide some help for contributing code to this package. + +CONTRIBUTING TO NSS-LDAPD +========================= + +Contributions to nss-ldapd are most welcome. However not all contributions +will be automatically integrated. Some notes: + +* for large changes it is a good idea to send an email first +* send your patches in unified diff (diff -u) format +* try to use the svn version of the software to develop the patch +* clearly state which problem you're trying to solve and how this is + accomplished +* please follow the existing coding conventions +* patches will be integrated on a best-effort bases +* please test the patch and include information on testing with the patch + (platforms tested, etc) +* contributions will be acknowledged in the AUTHORS file +* include a copyright statement in the patched code if you feel the + contribution is significant enough (e.g. more than a few lines) +* when including third-party code, retain copyright information (copyright + holder and license) and ensure that the license is LGPL compatible + +Please contact Arthur de Jong if you want to +contribute or use the Debian BTS if you're using the Debian package. + + +BUILD DEPENDENCIES +================== + +For building svn snapshots the following tools are needed: + +* autoconf (2.61 is used but 2.59 is minimal) +* automake (1.10 is used) +* check (0.9.5 is used) + +and of course the usual build tools (gcc/make/etc). Also see debian/control +(Build-Depends field) for libraries you need. + +To build the svn snapshot run the autogen.sh shell script to build the +configure script. When developing patches please use --enable-warnings with +configure and don't introduce too many new warnings. For building the manual +pages docbook2x is used. + + +RELEASE VERSIONING +================== + +A new versioning scheme was chosen over the nss_ldap release scheme. The +scheme is a simple major.minor numbering starting with 0.1. Until a 1.0 +release is made the code will be considered work in progress. The interfaces +may change and features may be added and removed. + + +GENERAL DESIGN +============== + +The basic design splits the functionality in two parts. The NSS part +interfaces with libc and translates the NSS requests into simple generic +requests (e.g. "get user with name test", "get group with gid 101" or "get all +shadow entries"). Translating these requests into LDAP requests is then the +job of the daemon (nslcd) so that the NSS part won't have to know anything +about LDAP (in fact replacing it with another lookup method is very simple). + + nslcd -> OpenLDAP -> LDAP server + ^ + libc NSS -> libnss_ldap.so + +design goals +------------ +* make it as simple as possible +* design as specified above +* simpler configuration and semantics +* simpler, clearer and completer documentation +* split source code into directories (src, src/hacks, src/aix, src/irs, etc) +* get rid of unneeded code and complexity +* split complexity in two parts (LDAP interface in server, NSS interface in + library) +* have a stable, easily maintainable piece of quality software + + +NSS PART +======== + +The NSS part is implemented in files in the nss directory. The functions are +split into files according to the database they support. All functions look +like: + +_nss_ldap_FUNCTION_r(...) + This function opens the connection to the nslcd (with a time-out) builds the + correct data structures and does a request (write()) to the nslcd waiting + for an answer (again with a time-out) + +Currently a number of macros are used to build most of the function bodies for +these functions. A more elegant solution is welcome. + +Some handy links: +http://mirrors.usc.edu/pub/gnu/Manuals/glibc-2.2.3/html_chapter/libc_28.html#SEC596 +http://www.gnu.org/software/libc/manual/html_node/index.html + + +THE COMMUNICATIONS PROTOCOL +=========================== + +The protocol used for communicating between the NSS library and the nslcd +daemon is very simple and almost fully described in the nslcd.h header file. +The nslcd-common.h header file defines some macros that are used for reading +and writing protocol entities (strings, 32-bit integers, etc). + +Some of the protocol handling code is automatically generated from the macros +defined in nslcd.h. This cannot be done automatically in every case though so +changing the protocol requires manual checking in the relevant source files in +both the nss and the nslcd directories. + +If the protocol is changed in an incompatible way the protocol version should +be incremented in nslcd.h. There is currently no versioning scheme available +for this. + +A special module (common/tio.c) was made so we can define simpler semantics +for time-out values and buffer sizes. Both tha NSS library and nslcd use this +module which means that it includes functionality that is needed for both +(e.g. large write buffers for the server part and large resettable read +buffers for the NSS part). Maybe building two modules from the same source +with different features in them is an option (e.g. the NSS part needs the +read buffers and handling of SIGPIPE and the nslcd part needs the write +buffers and possibly flushing in the background). + + +SERVER PART +=========== + +At the server end a dispatcher picks up the request and delegates it to one of +the database specific functions. + +nslcd_FUNCION(...) + This functions fills in the correct parameters from the request. This + function should write responses to the stream. Almost all these functions + are generated from a macro in common.h. + + +SECURITY NOTES +============== + +This design does open up the system to more potential security issues as there +is now a local interface to a daemon with privileges. Before processes could +only potentially exploit bugs in the library and gain the privileges of the +process that was doing the name lookups. In this case the privileges of the +daemon are potentially exposed. + +The deamon should be changed to set a specific less-privileged user and +group to minimize the riscs. Code for this is already in place. Configuration +options should be added and the Debian packaging should use this. diff --git a/contrib/slapd-modules/nssov/nss-ldapd/INSTALL b/contrib/slapd-modules/nssov/nss-ldapd/INSTALL new file mode 100644 index 0000000000..d3c5b40a94 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/INSTALL @@ -0,0 +1,237 @@ +Installation Instructions +************************* + +Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, +2006, 2007 Free Software Foundation, Inc. + +This file is free documentation; the Free Software Foundation gives +unlimited permission to copy, distribute and modify it. + +Basic Installation +================== + +Briefly, the shell commands `./configure; make; make install' should +configure, build, and install this package. The following +more-detailed instructions are generic; see the `README' file for +instructions specific to this package. + + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory of the package. +It may also create one or more `.h' files containing system-dependent +definitions. Finally, it creates a shell script `config.status' that +you can run in the future to recreate the current configuration, and a +file `config.log' containing compiler output (useful mainly for +debugging `configure'). + + It can also use an optional file (typically called `config.cache' +and enabled with `--cache-file=config.cache' or simply `-C') that saves +the results of its tests to speed up reconfiguring. Caching is +disabled by default to prevent problems with accidental use of stale +cache files. + + If you need to do unusual things to compile the package, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to the address given in the `README' so they can +be considered for the next release. If you are using the cache, and at +some point `config.cache' contains results you don't want to keep, you +may remove or edit it. + + The file `configure.ac' (or `configure.in') is used to create +`configure' by a program called `autoconf'. You need `configure.ac' if +you want to change it or regenerate `configure' using a newer version +of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. + + Running `configure' might take a while. While running, it prints + some messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Optionally, type `make check' to run any self-tests that come with + the package. + + 4. Type `make install' to install the programs and any data files and + documentation. + + 5. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. There is + also a `make maintainer-clean' target, but that is intended mainly + for the package's developers. If you use it, you may have to get + all sorts of other programs in order to regenerate files that came + with the distribution. + + 6. Often, you can also type `make uninstall' to remove the installed + files again. + +Compilers and Options +===================== + +Some systems require unusual options for compilation or linking that the +`configure' script does not know about. Run `./configure --help' for +details on some of the pertinent environment variables. + + You can give `configure' initial values for configuration parameters +by setting variables in the command line or in the environment. Here +is an example: + + ./configure CC=c99 CFLAGS=-g LIBS=-lposix + + *Note Defining Variables::, for more details. + +Compiling For Multiple Architectures +==================================== + +You can compile the package for more than one kind of computer at the +same time, by placing the object files for each architecture in their +own directory. To do this, you can use GNU `make'. `cd' to the +directory where you want the object files and executables to go and run +the `configure' script. `configure' automatically checks for the +source code in the directory that `configure' is in and in `..'. + + With a non-GNU `make', it is safer to compile the package for one +architecture at a time in the source code directory. After you have +installed the package for one architecture, use `make distclean' before +reconfiguring for another architecture. + +Installation Names +================== + +By default, `make install' installs the package's commands under +`/usr/local/bin', include files under `/usr/local/include', etc. You +can specify an installation prefix other than `/usr/local' by giving +`configure' the option `--prefix=PREFIX'. + + You can specify separate installation prefixes for +architecture-specific files and architecture-independent files. If you +pass the option `--exec-prefix=PREFIX' to `configure', the package uses +PREFIX as the prefix for installing programs and libraries. +Documentation and other data files still use the regular prefix. + + In addition, if you use an unusual directory layout you can give +options like `--bindir=DIR' to specify different values for particular +kinds of files. Run `configure --help' for a list of the directories +you can set and what kinds of files go in them. + + If the package supports it, you can cause programs to be installed +with an extra prefix or suffix on their names by giving `configure' the +option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. + +Optional Features +================= + +Some packages pay attention to `--enable-FEATURE' options to +`configure', where FEATURE indicates an optional part of the package. +They may also pay attention to `--with-PACKAGE' options, where PACKAGE +is something like `gnu-as' or `x' (for the X Window System). The +`README' should mention any `--enable-' and `--with-' options that the +package recognizes. + + For packages that use the X Window System, `configure' can usually +find the X include and library files automatically, but if it doesn't, +you can use the `configure' options `--x-includes=DIR' and +`--x-libraries=DIR' to specify their locations. + +Specifying the System Type +========================== + +There may be some features `configure' cannot figure out automatically, +but needs to determine by the type of machine the package will run on. +Usually, assuming the package is built to be run on the _same_ +architectures, `configure' can figure that out, but if it prints a +message saying it cannot guess the machine type, give it the +`--build=TYPE' option. TYPE can either be a short name for the system +type, such as `sun4', or a canonical name which has the form: + + CPU-COMPANY-SYSTEM + +where SYSTEM can have one of these forms: + + OS KERNEL-OS + + See the file `config.sub' for the possible values of each field. If +`config.sub' isn't included in this package, then this package doesn't +need to know the machine type. + + If you are _building_ compiler tools for cross-compiling, you should +use the option `--target=TYPE' to select the type of system they will +produce code for. + + If you want to _use_ a cross compiler, that generates code for a +platform different from the build platform, you should specify the +"host" platform (i.e., that on which the generated programs will +eventually be run) with `--host=TYPE'. + +Sharing Defaults +================ + +If you want to set default values for `configure' scripts to share, you +can create a site shell script called `config.site' that gives default +values for variables like `CC', `cache_file', and `prefix'. +`configure' looks for `PREFIX/share/config.site' if it exists, then +`PREFIX/etc/config.site' if it exists. Or, you can set the +`CONFIG_SITE' environment variable to the location of the site script. +A warning: not all `configure' scripts look for a site script. + +Defining Variables +================== + +Variables not defined in a site shell script can be set in the +environment passed to `configure'. However, some packages may run +configure again during the build, and the customized values of these +variables may be lost. In order to avoid this problem, you should set +them in the `configure' command line, using `VAR=value'. For example: + + ./configure CC=/usr/local2/bin/gcc + +causes the specified `gcc' to be used as the C compiler (unless it is +overridden in the site shell script). + +Unfortunately, this technique does not work for `CONFIG_SHELL' due to +an Autoconf bug. Until the bug is fixed you can use this workaround: + + CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash + +`configure' Invocation +====================== + +`configure' recognizes the following options to control how it operates. + +`--help' +`-h' + Print a summary of the options to `configure', and exit. + +`--version' +`-V' + Print the version of Autoconf used to generate the `configure' + script, and exit. + +`--cache-file=FILE' + Enable the cache: use and save the results of the tests in FILE, + traditionally `config.cache'. FILE defaults to `/dev/null' to + disable caching. + +`--config-cache' +`-C' + Alias for `--cache-file=config.cache'. + +`--quiet' +`--silent' +`-q' + Do not print messages saying which checks are being made. To + suppress all normal output, redirect it to `/dev/null' (any error + messages will still be shown). + +`--srcdir=DIR' + Look for the package's source code in directory DIR. Usually + `configure' can determine that directory automatically. + +`configure' also accepts some other, not widely useful, options. Run +`configure --help' for more details. + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/Makefile.am new file mode 100644 index 0000000000..c5caee4da5 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/Makefile.am @@ -0,0 +1,93 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +SUBDIRS = compat common nss nslcd man tests + +DEBIAN_FILES = debian/changelog debian/compat debian/control \ + debian/copyright debian/rules \ + debian/libnss-ldapd.docs \ + debian/libnss-ldapd.examples \ + debian/libnss-ldapd.lintian-overrides \ + debian/libnss-ldapd.nslcd.init \ + debian/libnss-ldapd.config \ + debian/libnss-ldapd.templates \ + debian/libnss-ldapd.postinst \ + debian/libnss-ldapd.postrm \ + $(wildcard debian/po/*.po) debian/po/templates.pot \ + debian/po/POTFILES.in + +EXTRA_DIST = nss-ldapd.conf nslcd.h nslcd-common.h \ + $(wildcard m4/*.m4) HACKING $(DEBIAN_FILES) + +DISTCHECK_CONFIGURE_FLAGS='--enable-warnings' + +ACLOCAL_AMFLAGS = -I m4 + +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ + +install-data-local: install-ldap_conf +uninstall-local: uninstall-ldap_conf + +# install a default configuration file if it is not already there +install-ldap_conf: + @if [ -f $(DESTDIR)$(NSS_LDAP_PATH_CONF) ]; then \ + echo "$(DESTDIR)$(NSS_LDAP_PATH_CONF) already exists, install will not overwrite"; \ + else \ + $(INSTALL_DATA) -D $(srcdir)/nss-ldapd.conf $(DESTDIR)$(NSS_LDAP_PATH_CONF); \ + fi +uninstall-ldap_conf: + -rm -f $(DESTDIR)$(NSS_LDAP_PATH_CONF) + +# target for easily creating a Debian package +# the find is an ugly hack to fix a bug if being built on an nfs filesystem +deb: distdir + find $(distdir) -type d | xargs touch + cd $(distdir) && \ + debuild + rm -rf $(distdir) + +# target for generating the ChangeLog file +changelog: + ( svn2cl -i --stdout -r HEAD:195 ; \ + svn2cl -i --stdout -r 194:3 --strip-prefix='libnss_ldapd' ; \ + svn2cl -i --stdout -r 2 --strip-prefix='libnss_ldap_251-5.2' ; \ + svn2cl -i --stdout -r 1 --strip-prefix='nss_ldap-251' ; \ + ) > ChangeLog + +flawfinder.html: + flawfinder --quiet --html --context --followdotdir . > $@ + +rats.html: + rats --quiet --html --context . > $@ + +splint.txt: + -env LARCH_PATH=/usr/share/splint/lib/ \ + LCLIMPORTDIR=/usr/share/splint/imports/ \ + splint -checks \ + -warnposix +showsummary +showalluses +hints -namechecks \ + -globstate -predboolint -mustfreeonly -temptrans -kepttrans \ + -I. -I$(srcdir) -I$(top_builddir) $(DEFS) -D_REENTRANT -DDEBUG \ + -D__signed__=signed -D__thread= -D__gnuc_va_list=__ptr_t \ + -Dkrb5_int32=int32_t -Dkrb5_ui_4=uint32_t \ + -D__u16=uint16_t -D__u32=uint32_t \ + *.[ch] nss/*.[ch] nslcd/*.[ch] common/*.[ch] compat/*.[ch] > $@ 2>&1 + +.PHONY: flawfinder.html rats.html splint.txt diff --git a/contrib/slapd-modules/nssov/nss-ldapd/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/Makefile.in new file mode 100644 index 0000000000..133b95e2ac --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/Makefile.in @@ -0,0 +1,713 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = . +DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in $(srcdir)/config.h.in \ + $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \ + TODO compile config.guess config.sub depcomp install-sh \ + missing mkinstalldirs +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ + configure.lineno config.status.lineno +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ + html-recursive info-recursive install-data-recursive \ + install-dvi-recursive install-exec-recursive \ + install-html-recursive install-info-recursive \ + install-pdf-recursive install-ps-recursive install-recursive \ + installcheck-recursive installdirs-recursive pdf-recursive \ + ps-recursive uninstall-recursive +RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ + distclean-recursive maintainer-clean-recursive +ETAGS = etags +CTAGS = ctags +DIST_SUBDIRS = $(SUBDIRS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) +am__remove_distdir = \ + { test ! -d $(distdir) \ + || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ + && rm -fr $(distdir); }; } +DIST_ARCHIVES = $(distdir).tar.gz +GZIP_ENV = --best +distuninstallcheck_listfiles = find . -type f -print +distcleancheck_listfiles = find . -type f -print +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +SUBDIRS = compat common nss nslcd man tests +DEBIAN_FILES = debian/changelog debian/compat debian/control \ + debian/copyright debian/rules \ + debian/libnss-ldapd.docs \ + debian/libnss-ldapd.examples \ + debian/libnss-ldapd.lintian-overrides \ + debian/libnss-ldapd.nslcd.init \ + debian/libnss-ldapd.config \ + debian/libnss-ldapd.templates \ + debian/libnss-ldapd.postinst \ + debian/libnss-ldapd.postrm \ + $(wildcard debian/po/*.po) debian/po/templates.pot \ + debian/po/POTFILES.in + +EXTRA_DIST = nss-ldapd.conf nslcd.h nslcd-common.h \ + $(wildcard m4/*.m4) HACKING $(DEBIAN_FILES) + +DISTCHECK_CONFIGURE_FLAGS = '--enable-warnings' +ACLOCAL_AMFLAGS = -I m4 +all: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +.SUFFIXES: +am--refresh: + @: +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + echo ' cd $(srcdir) && $(AUTOMAKE) --gnu '; \ + cd $(srcdir) && $(AUTOMAKE) --gnu \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + echo ' $(SHELL) ./config.status'; \ + $(SHELL) ./config.status;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + $(SHELL) ./config.status --recheck + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(srcdir) && $(AUTOCONF) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) + +config.h: stamp-h1 + @if test ! -f $@; then \ + rm -f stamp-h1; \ + $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ + else :; fi + +stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status + @rm -f stamp-h1 + cd $(top_builddir) && $(SHELL) ./config.status config.h +$(srcdir)/config.h.in: $(am__configure_deps) + cd $(top_srcdir) && $(AUTOHEADER) + rm -f stamp-h1 + touch $@ + +distclean-hdr: + -rm -f config.h stamp-h1 + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. +$(RECURSIVE_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +$(RECURSIVE_CLEAN_TARGETS): + @failcom='exit 1'; \ + for f in x $$MAKEFLAGS; do \ + case $$f in \ + *=* | --[!k]*);; \ + *k*) failcom='fail=yes';; \ + esac; \ + done; \ + dot_seen=no; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + rev="$$rev ."; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || eval $$failcom; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done +ctags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ + done + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ + include_option=--etags-include; \ + empty_fix=.; \ + else \ + include_option=--include; \ + empty_fix=; \ + fi; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test ! -f $$subdir/TAGS || \ + tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + $(am__remove_distdir) + test -d $(distdir) || mkdir $(distdir) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d "$(distdir)/$$subdir" \ + || $(MKDIR_P) "$(distdir)/$$subdir" \ + || exit 1; \ + distdir=`$(am__cd) $(distdir) && pwd`; \ + top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$$top_distdir" \ + distdir="$$distdir/$$subdir" \ + am__remove_distdir=: \ + am__skip_length_check=: \ + distdir) \ + || exit 1; \ + fi; \ + done + -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ + ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ + ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ + || chmod -R a+r $(distdir) +dist-gzip: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +dist-bzip2: distdir + tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 + $(am__remove_distdir) + +dist-lzma: distdir + tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma + $(am__remove_distdir) + +dist-tarZ: distdir + tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z + $(am__remove_distdir) + +dist-shar: distdir + shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz + $(am__remove_distdir) + +dist-zip: distdir + -rm -f $(distdir).zip + zip -rq $(distdir).zip $(distdir) + $(am__remove_distdir) + +dist dist-all: distdir + tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz + $(am__remove_distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + case '$(DIST_ARCHIVES)' in \ + *.tar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ + *.tar.bz2*) \ + bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ + *.tar.lzma*) \ + unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ + *.tar.Z*) \ + uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ + *.shar.gz*) \ + GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ + *.zip*) \ + unzip $(distdir).zip ;;\ + esac + chmod -R a-w $(distdir); chmod a+w $(distdir) + mkdir $(distdir)/_build + mkdir $(distdir)/_inst + chmod a-w $(distdir) + dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ + && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ + && cd $(distdir)/_build \ + && ../configure --srcdir=.. --prefix="$$dc_install_base" \ + $(DISTCHECK_CONFIGURE_FLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ + distuninstallcheck \ + && chmod -R a-w "$$dc_install_base" \ + && ({ \ + (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ + && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ + distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ + } || { rm -rf "$$dc_destdir"; exit 1; }) \ + && rm -rf "$$dc_destdir" \ + && $(MAKE) $(AM_MAKEFLAGS) dist \ + && rm -rf $(DIST_ARCHIVES) \ + && $(MAKE) $(AM_MAKEFLAGS) distcleancheck + $(am__remove_distdir) + @(echo "$(distdir) archives ready for distribution: "; \ + list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ + sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' +distuninstallcheck: + @cd $(distuninstallcheck_dir) \ + && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ + || { echo "ERROR: files left after uninstall:" ; \ + if test -n "$(DESTDIR)"; then \ + echo " (check DESTDIR support)"; \ + fi ; \ + $(distuninstallcheck_listfiles) ; \ + exit 1; } >&2 +distcleancheck: distclean + @if test '$(srcdir)' = . ; then \ + echo "ERROR: distcleancheck can only run from a VPATH build" ; \ + exit 1 ; \ + fi + @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ + || { echo "ERROR: files left in build directory after distclean:" ; \ + $(distcleancheck_listfiles) ; \ + exit 1; } >&2 +check-am: all-am +check: check-recursive +all-am: Makefile config.h +installdirs: installdirs-recursive +installdirs-am: +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -f Makefile +distclean-am: clean-am distclean-generic distclean-hdr distclean-tags + +dvi: dvi-recursive + +dvi-am: + +html: html-recursive + +info: info-recursive + +info-am: + +install-data-am: install-data-local + +install-dvi: install-dvi-recursive + +install-exec-am: + +install-html: install-html-recursive + +install-info: install-info-recursive + +install-man: + +install-pdf: install-pdf-recursive + +install-ps: install-ps-recursive + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + -rm -f $(am__CONFIG_DISTCLEAN_FILES) + -rm -rf $(top_srcdir)/autom4te.cache + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-recursive + +pdf-am: + +ps: ps-recursive + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ + install-strip + +.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ + all all-am am--refresh check check-am clean clean-generic \ + ctags ctags-recursive dist dist-all dist-bzip2 dist-gzip \ + dist-lzma dist-shar dist-tarZ dist-zip distcheck distclean \ + distclean-generic distclean-hdr distclean-tags distcleancheck \ + distdir distuninstallcheck dvi dvi-am html html-am info \ + info-am install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs installdirs-am maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \ + uninstall-local + + +install-data-local: install-ldap_conf +uninstall-local: uninstall-ldap_conf + +# install a default configuration file if it is not already there +install-ldap_conf: + @if [ -f $(DESTDIR)$(NSS_LDAP_PATH_CONF) ]; then \ + echo "$(DESTDIR)$(NSS_LDAP_PATH_CONF) already exists, install will not overwrite"; \ + else \ + $(INSTALL_DATA) -D $(srcdir)/nss-ldapd.conf $(DESTDIR)$(NSS_LDAP_PATH_CONF); \ + fi +uninstall-ldap_conf: + -rm -f $(DESTDIR)$(NSS_LDAP_PATH_CONF) + +# target for easily creating a Debian package +# the find is an ugly hack to fix a bug if being built on an nfs filesystem +deb: distdir + find $(distdir) -type d | xargs touch + cd $(distdir) && \ + debuild + rm -rf $(distdir) + +# target for generating the ChangeLog file +changelog: + ( svn2cl -i --stdout -r HEAD:195 ; \ + svn2cl -i --stdout -r 194:3 --strip-prefix='libnss_ldapd' ; \ + svn2cl -i --stdout -r 2 --strip-prefix='libnss_ldap_251-5.2' ; \ + svn2cl -i --stdout -r 1 --strip-prefix='nss_ldap-251' ; \ + ) > ChangeLog + +flawfinder.html: + flawfinder --quiet --html --context --followdotdir . > $@ + +rats.html: + rats --quiet --html --context . > $@ + +splint.txt: + -env LARCH_PATH=/usr/share/splint/lib/ \ + LCLIMPORTDIR=/usr/share/splint/imports/ \ + splint -checks \ + -warnposix +showsummary +showalluses +hints -namechecks \ + -globstate -predboolint -mustfreeonly -temptrans -kepttrans \ + -I. -I$(srcdir) -I$(top_builddir) $(DEFS) -D_REENTRANT -DDEBUG \ + -D__signed__=signed -D__thread= -D__gnuc_va_list=__ptr_t \ + -Dkrb5_int32=int32_t -Dkrb5_ui_4=uint32_t \ + -D__u16=uint16_t -D__u32=uint32_t \ + *.[ch] nss/*.[ch] nslcd/*.[ch] common/*.[ch] compat/*.[ch] > $@ 2>&1 + +.PHONY: flawfinder.html rats.html splint.txt +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/NEWS b/contrib/slapd-modules/nssov/nss-ldapd/NEWS new file mode 100644 index 0000000000..8e43d2c98c --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/NEWS @@ -0,0 +1,2002 @@ +changes form 0.6.1 to 0.6.2 +--------------------------- + +* all user and group names are now checked for validity are specified in the + POSIX Portable Filename Character Set +* support retrieval of ranged attribute values as sometimes returned by Active + Directory +* added the threads keyword to configure the number of threads that should be + started in nslcd +* handle empty netgroups properly +* change the time out and retry mechanism for connecting to the LDAP server to + return an error quickly if the LDAP server is known to be unavailable for a + long time (this removed the reconnect_tries option and changes the meaning + of the reconnect_sleeptime and reconnect_maxsleeptime options) +* increased the time out values between the NSS module and nslcd because of + new retry mechanism +* implement new dict and set modules that use a hashtable to map keys + efficiently +* use the new set to store group membership to simplify memory management and + eliminate duplicate members +* the uniqueMember attribute now only supports DN values +* implement a cache for DN to user name lookups (15 minute timeout) used for + the uniqueMember attribute to save on doing LDAP searches for groups with a + lot of members, based on a patch by Petter Reinholdtsen +* improvements to the tests +* if any of the ldap calls return LDAP_UNAVAILABLE or LDAP_SERVER_DOWN the + connection is closed +* improve dependencies in LSB init script header to improve dependency based + booting + + +changes from 0.6 to 0.6.1 +------------------------- + +* numerous small fixes and compatibility improvements +* the I/O buffers between nslcd and NSS module are now dynamically sized and + tuned for common requests +* correctly follow referrals +* add StartTLS support by Ralf Haferkamp of SuSE +* miscellaneous documentation improvements +* remove code for handling rootbinddn/pw because it is unlikely to be + supported any time soon +* fix a problem with realloc()ed memory that was not referenced +* fix for a crash in group membership buffer growing code thanks to Petter + Reinholdtsen +* some improvements to the Active Directory sample configuration +* fix init script exit code with stop while not running +* fixes to the _nss_ldap_initgroups_dyn() function to properly handle the + buffer and limits passed by Glibc +* fixes to the member to groups search functions to correctly handle + uniqueMember attributes +* only return shadow entries to root users +* miscellaneous Debian packaging improvements + + +changes from 0.5 to 0.6 +----------------------- + +* fix parsing of map option in nss-ldapd.conf +* fix bug in handling of userPassword values +* remove warning about missing loginShell attribute +* support the uniqueMember LDAP attribute that holds DN values +* support ldap as a compat service in /etc/nsswitch.conf +* implement _nss_ldap_initgroups_dyn() to allow username->groups searches +* fix retry mechanism with get*ent() functions where a too small buffer was + passed by libc (to support groups with a lot of members) +* fix a bug in reporting of communications problems between nslcd and the NSS + library +* test and log failures of all LDAP library calls +* improved tests +* miscellaneous compatibility improvements to try to support more LDAP + libraries and platforms +* support compilation with OpenLDAP 2.4 and newer +* some configure script improvements +* Debian packaging improvements + + +changes from 0.4.1 to 0.5 +------------------------- + +* major structural changes in the LDAP lookup code using a newly implemented + module that does memory management, session handling, paging and all other + painful things with a simple interface +* rewritten LDAP query and result handling code, now generating warnings + about incorrect entries in the LDAP directory +* IPv6 addresses in host lookups are now supported +* added Kerberos ccname support (with the krb5_ccname option) thanks to + Andreas Schneider and Ralf Haferkamp from SuSE and remove --with-gssapi-dir, + --enable-configurable-krb5-ccname-gssapi and + --enable-configurable-krb5-ccname-env configure options and having automatic + detection instead +* added support for DNS SRV record lookups by specifying DNS as uri thanks to + Ralf Haferkamp and Michael Calmer from SuSE +* added support for DOMAIN as base DN which uses the host's domain to + construct a DN +* removed nss_connect_policy, bind_policy and sizelimit options +* cleaned up and documented reconnect logic with reconnect_tries, + reconnect_sleeptime and reconnect_maxsleeptime options +* configuration values with spaces in them (e.g. distinguished names) are now + handled properly +* fix a small memory leak in the I/O module +* miscellaneous code improvements (better source code comments, more + consistent logging, portability improvements, more tests, etc) +* improvements to documentation + + +changes from 0.4 to 0.4.1 +------------------------- + +* added French debconf translation by Cyril Brulebois +* added Japanese debconf translation by Kenshi Muto +* fix a problem with network name lookups where the lookup would result + in the wrong call to nslcd +* fix wrong default filter for rpc lookups +* fix a number of memory leaks (thanks valgrind) + (all memory leaks during normal operation should be fixed now) + + +changes from 0.3 to 0.4 +----------------------- + +* remove nss_schema configfile option +* temporary remove support for uniqueMember group membership attributes (will + be re-added in a later release) +* removed support for nested groups, if this is really needed (please ask or + file a bug if you want it) it can be re-added later on +* added missing docbook sources for manual pages to tarball +* major cleanups and simplifications in the core LDAP query code (we don't + need to worry about SIGPIPE because nslcd does that globally, locking + because a connection is only used by one thread) and more simplifications in + the the LDAP connection and query state +* get base, scope, filter and map configfile directives properly working +* simplifications in LDAP reconnect logic (some work remains to be done in + this area) +* issue warnings or errors for untested or unsupported configuration options +* properly handle multiple URIs in Debian configuration +* documentation improvements + + +changes from 0.2.1 to 0.3 +------------------------- + +* a bug in the communication buffer handling code was fixed +* a bug in the dictionary code was fixed (code not yet in use) +* a fix for the init script that used a wrong pidfile +* configuration file handling code was rewritten to be better maintainable +* some configuration file options have changed which means that compatibility + with the nss_ldap configuration file is lost +* configuration syntax is now documented in the nss-ldapd.conf(5) manual page +* support for dnsconfig was removed +* the configuration file no longer supports using multiple search bases +* removed nss_initgroups and nss_initgroups_ignoreusers options +* removed --enable-paged-results configure option and use pagesize + configuration file option to specify usage of paging at runtime +* added Portuguese debconf translation by Américo Monteiro +* Debian package configuration improvements and simplifications +* use docbook2x-man for generating manual pages +* miscellaneous documentation improvements including improved manual pages +* general code reorganisation and clean-ups to achieve another 9% code + reduction relative to 0.2.1 release (more than 40% relative to nss_ldap) +* SASL, Kerberos and SSL/TLS support remain untested + + +changes from 0.2 to 0.2.1 +------------------------- + +* fix permissions of server socket (this fixes a problem where non-root users + were unable to do lookups) +* fix configure script to properly check for pthread support +* small code improvements +* general build system cleanups + + +changes from 0.1 to 0.2 +----------------------- + +* fixes to the netgroup lookup code +* more simplifications and improvements in the code almost 5% code reduction + (compared to release 0.1) and 37% reduction in gcc warnings (from 443 in 251 + to 389 in 0.1 and 244 in 0.2) +* a lot of code improvements thanks to flawfinder, more gcc warnings, splint + and rats +* license change from GNU Library General Public License to GNU Lesser General + Public License (with the permission of Luke Howard) +* fix logging code to be cleaner and always use our own logging module +* a start has been made to make the code more testable and initial work to set + up a testing framework has been done +* implemented a timeout mechanism in the communication between the NSS part + and the nslcd server part + + +changes from nss_ldap 251 to nss-ldapd 0.1 +------------------------------------------ + +* initial release of nss-ldapd (should be functional but not yet stable enough + for production use) +* fork from the nss_ldap which was originally written by Luke Howard of PADL + Software Pty Ltd. changing package name to nss-ldapd and versioning scheme +* the functionality was split into a thin NSS library and a simple daemon + proxying the requests to the LDAP server (see README for rationale) +* a lot of dead and old compatibility code was removed (about 25% of the code + was removed) (more simplifications to come) +* the test code was rewritten +* build script simplifications +* default configuration file has been changed to /etc/nss-ldapd.conf +* most documentation has been updated and rewritten +* dropped support for non-glibc NSS interfaces and assumed OpenLDAP compatible + library + + +changes from 250 to 251 +----------------------- + +* remove doc/rfc2307.txt, it is available from + http://www.ietf.org/rfc/rfc2307.txt +* make objectClass a mappable attribute + + +changes from 249 to 250 +----------------------- + +* don't use static _nss_ldap_no_members buffer, causes crash when nss_ldap is + unloaded and memory is still referenced +* fix for BUG#249: tcsh closes file descriptors, confuses nss_ldap and hangs + (from David Houlder) +* fix for BUG#257: initgroups() broken in RFC2307bis support disabled +* fix for BUG#261: sslpath example wrong +* fix for BUG#263: compile do_triple_permutations() when IRS enabled + + +changes from 248 to 249 +----------------------- + +* fix for BUG#253: build broken on AIX +* fix for BUG#255: deadlock in initgroups + + +changes from 247 to 248 +----------------------- + +* fix regression in per-objectclass attribute mapping introduced in + nss_ldap-246 + + +changes from 246 to 247 +----------------------- + +* double-check *ld != NULL even if mapped eror return from ldap_initialize() + returns NSS_SUCCESS + + +changes from 245 to 246 +----------------------- + +* paged results and RFC2307bis support are now always compiled in; they are by + default disabled unless you configured with --enable-paged-results and + --enable-rfc2307bis, respectively. See nss_ldap(5) for configuration + options. +* fix for BUG#219: paged results delivers wrong results +* fix for BUG#222: use asynchronous start TLS if available, using bind_timeout + value +* fix for BUG#235: make DNS SRV lookup domain configurable (nss_srv_domain) +* fix for BUG#240: return "*" rather than "x" for userPassword if not present +* fix for BUG#245: paged results broken since nss_ldap-241 +* patch from Ralf Haferkamp : compile fix for IPv6 +* compile for Solaris +* schema mapping is always enabled, cleanup schema mapping code +* allow for map-specific objectclass mapping +* partial implementation of Solaris Simplified LDAP API, allows automountd + support on Solaris via nss_ldap +* for Linux automounter, always close connection after endautomntent() to + avoid persistent connection +* add nss_connect_policy argument to ldap.conf + + +changes from 244 to 245 +----------------------- + +* don't leak LDAP connection if do_bind() failed or descriptor owner had + changed. If do_bind() failed the underlying descriptor would also be leaked, + causing a large number of sockets to be consumed during failover +* add nss_initgroups_ignoreusers parameter to ldap.conf, returns NOTFOUND if + nss_ldap's initgroups() is called for users (comma separated) +* try to deal with systems that have headers for both versions of the SASL + library installed +* better logging of failed connections and reconnections +* patch from Dean Michaels : build with Netscape 5 + library on Solaris +* patch from Ralf Haferkamp : manual page fix to bind_policy + + +changes from 243 to 244 +----------------------- + +* patch from Ralf Haferkamp : enusre bytesleft macro does not + return values < 0 +* include in ldap-nss.c + + +changes from 242 to 243 +----------------------- + +* fix for BUG#225: invalid pointer dereferencing when reading rootpw + + +changes from 241 to 242 +----------------------- + +* fixes for compiling on Solaris 10 + + +changes from 240 to 241 +----------------------- + +* new, more robust reconnection logic +* both "host" and "uri" directives can be used in ldap.conf +* new (undocumented) nss_reconnect_tries, nss_reconnect_sleeptime, + nss_reconnect_maxsleeptime, nss_reconnect_maxconntries directives +* reload configuration file if changed + + +changes from 239 to 240 +----------------------- + +* new API for resolving automounts (requires custom autofs plugin for Linux at + present): _nss_ldap_setautomntent(), _nss_ldap_getautomntent(), + _nss_ldap_endautomntent(), _nss_ldap_getautomntbyname_r() +* fix for BUG#200: rename SOCKLEN_T as it conflicts on AIX +* fix for BUG#205: accept line feeds in ldap.conf +* fix for BUG#211: nss_ldap fails to start TLS on referred connections +* fix for BUG#213: initgroups crash if RFC2307bis undefined +* turn down reconnection logging volume + + +changes from 238 to 239 +----------------------- + +* support for initgroups using backlinks (selectable at runtime if RFC2307bis + support is enabled, using the nss_initgroups backlink configuration + directive) +* support for dynamically expanding filter sizes +* from Peter Marschall : revert the deletion of blanks/tabs in + ldap.conf that happened between 235 and 238 +* from Peter Marschall : This patch changes configure.in and + Makefile.am so that ldap.conf gets installed in the place and with the name + that is given to the configure option --with-ldap-conf-file. In addition to + that it fixes a long standing bug in Makefile.am that tries to install a + file before the destination directory is guaranteed to be created (hunk #3), + and uses $(mkinstalldirs) for AIX (hunk #2). + + +changes from 237 to 238 +----------------------- + +* more manual page updates + + +changes from 236 to 237 +----------------------- + +* more manual page updates + + +changes from 235 to 236 +----------------------- + +* fix for BUG#201: typo in ldap-schema.c causing build to fail +* add manual page for nss_ldap + + +changes from 234 to 235 +----------------------- + +* fix for BUG#198: make pagesize configurable +* fix for BUG#199: correct fix for BUG#138 (blind last char remove in + ldap.secret) + + +changes from 233 to 234 +----------------------- + +* don't reacquire global lock in do_next_page() +* restore old "bind_policy hard" behaviour (don't try to reconnect if + initialization failed). The behaviour introduced in nss_ldap-227 can be + enabled with "bind_policy hard_init". + + +changes from 232 to 233 +----------------------- + +* if do_open() returns NSS_UNAVAIL, don't try to do server reconnect; only do + it if NSS_TRYAGAIN is returned This should fix the problems introduced by + the fixes in nss_ldap-227 (delayed binding) + + +changes from 231 to 232 +----------------------- + +* fix for BUG#138 (blind last char remove in ldap.secret) + + +changes from 229 to 230 +----------------------- + +* don't free gss_krb5_ccache_name() output (Heimdal) + + +changes from 228 to 229 +----------------------- + +* more debugging in initgroups and _nss_ldap_getentry() +* fix _nss_ldap_getentry() enumeration behaviour, and optimize by not + searching if the requested attribute cannot be mapped + + +changes from 227 to 228 +----------------------- + +* fix for BUG#188: better documentation for OpenLDAP SSL options +* fix for BUG#189: do not configure tls_checkpeer unless it is explicitly + specifier in ldap.conf +* fix for BUG#190: set ls_state to LS_UNINITIALIZED after fork + + +changes from 226 to 227 +----------------------- + +* separate initializing LDAP session with actually connecting to the DSA, so + that we don't try to bind until we actually need to search (which allows the + retry logic in the search function to also apply to binding). NB: this will + only provide improved behavior for LDAP client libraries that support + ldap_init() or ldap_initialize() rather than ldap_open +* fix for BUG#183: support pw_change and pw_expire on BSD +* fix for BUG#187: NSS_BUFLEN_DEFAULT causing problems on IRS platforms +* fix for glibc 2.1 from Alexander Spannagel + + +changes from 225 to 226 +----------------------- + +* make LDAP_NSS_NGROUPS configurable with --with-ngroups (experts only) option + + +changes from 224 to 225 +----------------------- + +* make LDAP_NSS_NGROUPS 64 - better choice for small directories + + +changes from 223 to 224 +----------------------- + +* don't double-free on realloc() failure in do_parse_group_members() +* don't pass LDAP session as an argument, as it may refer to a stale LDAP + handle. If this does not work we will need to replace LDAPMessage pointers + with pointers to a structure that contains a reference-counted LDAP handle + as well as the message +* fix crasher when internal group membership buffer was reallocated + (introduced with nested group expansion code) +* immediately return NSS_TRYAGAIN and errno=ERANGE if there is not enough + buffer space to handle LDAP_NSS_NGROUPS groups; this prevents getgrXXX() + from expensive repeated directory searches when there is a priori knowledge + that group memberships are large + + +changes from 222 to 223 +----------------------- + +* allow empty lines in /etc/ldap.conf +* do loop detection in nested groups +* fixes for building with IRS on FreeBSD 4.10 + + +changes from 221 to 222 +----------------------- + +* fix deadlock in _nss_ldap_getentry() +* support more AIX usersec attributes +* more AIX porting fixes +* support Heimdal as well as MIT Kerberos + + +changes from 220 to 221 +----------------------- + +* AIX fix from Recall #169033 +* support for expansion of nested RFC2307bis groups +* support for searching using range retrieval +* fix memory leak with private contexts +* fix memory leak in do_result() +* implement _nss_ldap_getentry for AIX enumeration +* implement netgroups for IRS/AIX +* remove dependency on Berkeley DB - schema mapping and RFC2307bis no longer + requires DB +* remove old NeXT cruft in resolve.c + + +changes from 218 to 220 +----------------------- + +* fix for BUG#169: getntohost() on Solaris +* fix for BUG#170: _nss_ldap_getgroupsbymember_r fails to return all groups + when NSCD is running and attribute mapping is enabled on Solaris +* fix for BUG#173: reinstate use of sigaction() (XXX what is the correct fix + here?) +* fix for BUG#174: innetgr() depth checking + + +changes from 217 to 218 +----------------------- + +* fix for BUG#168: set errnop to ENOENT if not found +* check for -lgssapi before -lgssapi_krb5 + + +changes from 216 to 217 +----------------------- + +* fix for BUG#167: compilation fails on Solaris + + +changes from 215 to 216 +----------------------- + +* patch from Thorsten Kukuk to avoid overwriting sockaddr storage for IPv6; + use struct sockaddr_storage if available +* fix for BUG#153: use asynchronous search API in initgroups() +* fix for BUG#157: check for __pthread_once rather than __pthread_atfork on + glibc, as the latter is no longer exported +* fix for BUG#158: escape netgroup search filters correctly +* fix for BUG#161: remove redundant lock in _nss_ldap_innetgr() +* fix for BUG#164: set schema element array size to LM_NONE + 1 not LM_NONE +* fix for BUG#165: make _nss_ldap_result() private +* fix for BUG#166: chase all nested netgroups in innetgr() +* fix deadlock if getXXXent() called without first calling setXXXent() +* only request gidNumber attribute when initgroups() (avoids sending back rest + of a group's entry) +* don't request any attributes when mapping a user to a DN (we want the DN + only) + + +changes from 214 to 215 +----------------------- + +* choose between using native GSS-API and putenv() for setting ccache path +* per-map attribute mapping for attributes that appear in multiple maps + + +changes from 213 to 214 +----------------------- + +* define LDAP_DEPRECATED for compiling against OpenLDAP 2.2 + + +changes from 212 to 213 +----------------------- + +* fix netgroup compilation error when debugging is enabled +* support GSS-API for setting ccache name +* initgroups() should require user to be a POSIX account +* define LOGNAME_MAX for HP-UX +* do not use sigprocmask() - this blocks rather than disabling signals +* SASL version check fix from Howard Chu + + +changes from 211 to 212 +----------------------- + +* Solaris netgroup support test release +* fix crasher in do_sasl_interact() +* do_sasl_interact() needs to strdup() result for Cyrus SASL 1.x but not 2.x +* merge in LDAP debug patch from Howard Chu +* try alternate search descriptors on NSS_NOTFOUND as well as NSS_SUCCESS + + +changes from 210 to 211 +----------------------- + +* do AT_OC_MAP cache initialization at config init +* BSD build fixes +* replace [h]errno2nssstat lookup tables with switch statement; should help + building on AIX! + + +changes from 209 to 210 +----------------------- + +* initialize DBT structures +* fix SASL crasher + + +changes from 208 to 209 +----------------------- + +* fix SASL breakage + + +changes from 207 to 208 +----------------------- + +* use socklen_t not int +* remove OpenLDAP SASL code +* incorporated patches from (see below) Geert Jansen +* add the "sasl_secprops" option to configure SASL security layers (usage as + for OpenLDAP ldap.conf) +* add the "krb5_ccname" option to specify the location of the Kerberos ticket + cache (requires --enable-configurable-krb5-ccname for now as it is a fairly + coarse solution to a lack of appropriate API in the Kerberos libraries) +* add support for native Active Directory password policy attributes (enabled + if shadowLastChange is mapped to pwdLastSet) +* add "nss_override_attribute_value" and "nss_default_attribute_value" + keywords for over- riding and setting default attribute values, respectively + + +changes from 205 to 207 +----------------------- + +* work without LDAP_OPT_X_TLS_RANDOM_FILE +* fix schema mapping regression from nss_ldap-205; attribute mapping now works + again + + +changes from 204 to 205 +----------------------- + +* build with Sleepycat DB without db185 compat layer (tested with 4.x; needs + testing on 3.x) + + +changes from 203 to 204 +----------------------- + +* Linux netgroup implementation from Larry Lile +* Multiple service search descriptor support from Symas +* IPv6 patch from Thorsten Kukuk at SuSE + + +changes from 202 to 203 +----------------------- + +* fix for BUG#115 +* fix for BUG#121 + + +changes from 201 to 202 +----------------------- + +* getsockname() fixes from Howard Chu +* configuration parser crasher fix + + +changes from 200 to 201 +----------------------- + +* Berkeley DB fixes from Howard Chu +* Netscape client library build fix + + +changes from 199 to 200 +----------------------- + +* use sigprocmask() if available to block SIGPIPE +* fix build breakage with OpenLDAP HEAD + + +changes from 198 to 199 +----------------------- + +* HP-UX port +* BUG#111: incorrect debugging statement in _nss_ldap_enter() +* export required symbols only on Linux +* corrected symbol names for glibc alias enumeration functions +* the DNS response parser doesn't stop after parsing the right number of + records, and doesn't handle long responses (Nalin at RedHat) + + +changes from 197 to 198 +----------------------- + +* BUG#108: fix potential buffer overflow in dnsconfig.c (could be triggered if + no flat file configuration for nss_ldap and large DNS SRV data for domain; + because nss_ldap in SRV mode trusts DNS we do not believe this to be + exploitable to elevate privilege in the default configuration) +* do not malloc() configuration structure; use buffer + + +changes from 196 to 197 +----------------------- + +* improved AIX documentation from Dejan Muhamedagic +* define LDAP_OPT_SSL for Solaris 9 + + +changes from 195 to 196 +----------------------- + +* return NSS_TRYAGAIN not NSS_NOTFOUND for insufficient buffer space in + dn2uid_cache_get() +* support automake 1.5 and friends +* out of box build on AIX 4.3.3 +* fixed BUG#104: do_ssl_options() return code ignored + + +changes from 194 to 195 +----------------------- + +* fixed BUG#98: large groups cause buffer length wraparound with rfc2307bis + + +changes from 193 to 194 +----------------------- + +* bugfix for Debian Bug report #147553: lack of global mutex use in + initgroups() + + +changes from 192 to 193 +----------------------- + +* support for PADL GSS-SASL client library + + +changes from 191 to 192 +----------------------- + +* more carefully compare cached socket and peer addresses + + +changes from 190 to 191 +----------------------- + +* added configurable [hard|soft] reconnect, see the bind_policy parameter in + ldap.conf. + + +changes from 189 to 190 +----------------------- + +* check for Netscape 4 SDK without SSL; don't require pthreads for these + + +changes from 188 to 189 +----------------------- + +* patch for building on OpenLDAP 1.x from Nalin at RedHat + + +changes from 187 to 188 +----------------------- + +* specify runtime path for LDAP library correctly to native Solaris linker +* check for gcc correctly +* use native linker on Solaris and AIX + + +changes from 186 to 187 +----------------------- + +* make bogusSd in ldap-nss.c conditional on !HAVE_LDAP_LD_FREE +* merge in paged result support from Max Caines +* bugfixes for Debian Bug report #140854 + + +changes from 185 to 186 +----------------------- + +* incorporated patch for Debian Bug report #140854, where nss_ldap could in + some cases close a descriptor it did not own. Patch was provided by Luca + Filipozzi. + + +changes from 184 to 185 +----------------------- + +* updated copyrights +* fix for BUG#82: set close on exec (Debian bug 136953) + + +changes from 183 to 184 +----------------------- + +* return NSS_TRYAGAIN if no buffer space in ldap-grp.c + + +changes from 181 to 183 +----------------------- + +* return error strings in AIX authentication routine +* initialize schema in getgroupsbymember() +* fix for tls_checkpeer; pass NULL session in to set global option +* BUG#77: configurable config file locations + + +changes from 181 to 181 +----------------------- + +* ignore SIGPIPE whilst inside nss_ldap library routines to prevent crashing + on down LDAP server; possible fix for Debian bug 130006 +* removed --enable-no-so-keepalive; always try to disable SO_KEEPALIVE on + underlying socket to LDAP server +* include local copy of irs.h under AIX +* general cleanup of locking code +* _nss_ldap_no_members appears to only need defining for when RFC2307bis is + enabled + + +changes from 179 to 180 +----------------------- + +* pull in libpthreads on AIX + + +changes from 178 to 179 +----------------------- + +* a couple more patches for AIX + + +changes from 177 to 178 +----------------------- + +* patch from Gabor Gombas for AIX support +* Makefile.am: sasl.o needed by NSS_LDAP +* aix_authmeth.c: method_passwordexpired is really method_passwdexpired; but + since the struct was bzero()ed no need to set it to NULL +* configure.in: support both gcc and xlc_r +* exports.aix: sv_byport was not exported +* ldap-grp.c: getgrset() returned group names instead of gid numbers + + +changes from 176 to 177 +----------------------- + +* patch for building on AIX from IBM +* added simple authentication support for AIX +* cleaned up SASL patch to not break if Cyrus SASL is not installed + + +changes from 175 to 176 +----------------------- + +* fixed bug in SASL patch which had required OpenLDAP headers + + +changes from 174 to 175 +----------------------- + +* incorporated GSS-API SASL patches +* rebind to server on LDAP_LOCAL_ERROR + + +changes from 173 to 174 +----------------------- + +* added patches from Maxim Batourine for compiling with Sun workshop compiler +* added notes re: 64-bit compile on Solaris from above source + + +changes from 172 to 173 +----------------------- + +* notes on IRS in doc/README.IRS +* added irs.h for AIX compat +* patch from Bob Guo for stripping trailing spaces in ldap.conf. + + +changes from 171 to 172 +----------------------- + +* fixed schema mapping bug by storing a copy of the mapped schema in the + Berkeley DB rather than the element itself. Because the DB library returns + static storage, this was causing problems where the schema mapping calls + were used to build the attribute table in ldap-schema.c. This bugfix was + sponsored by n2h2.com; thanks! + + +changes from 170 to 171 +----------------------- + +* added ldap.conf stanza for AIX +* workaround for schema mapping bug. + + +changes from 169 to 170 +----------------------- + +* use _nss_ldap_getrdnvalue() for determining canonical group name + + +changes from 168 to 169 +----------------------- + +* fixed typo in ldap-service.c; prefix filters now with _nss_ldap + + +changes from 167 to 168 +----------------------- + +* initialize old_handler to SIG_DFL +* incorporate Stephan Cremer's mapping patches, a big thanks to Stephan for + these! +* use LDAP_OPT_NETWORK_TIMEOUT if available for network connect timeout +* removed hard-coded schema mapping for authPassword, NDS and MSSFU + + +changes from 166 to 167 +----------------------- + +* support for new OpenLDAP rebind proc prototype +* in rebind function, respect timeout +* fix for PADL Release Control + + +changes from 165 to 166 +----------------------- + +* corrected small typos + + +changes from 164 to 165 +----------------------- + +* posixMember is a distinguished name, don't pretend it is a login name +* cleaned up code referencing different member syntaxes + + +changes from 163 to 164 +----------------------- + +* removed IDS_UID code, never worked properly + + +changes from 162 to 163 +----------------------- + +* removed context_free function, usage confusing + + +changes from 161 to 162 +----------------------- + +* in reconnect harness, do not treat entry not found errors as requiring a + reconnect + + +changes from 160 to 161 +----------------------- + +* hopefully fixed use of synchronous searches in _nss_ldap_getbyname() + + +changes from 159 to 160 +----------------------- + +* patch from RedHat to check for DB3, override install user/group optionally +* use synchronous searches for _nss_ldap_getbyname() +* only set SSL options if we have values for those options + + +changes from 158 to 159 +----------------------- + +* make do_ssl_options() take a config parameter; avoid segfault with SSL? + + +changes from 157 to 158 +----------------------- + +* in the distinguished name to login cache (dn2uid) make sure we use the + AT(uid) macro for the uid attribute rather than the hard-coded value of + "uid" This should enable the cache for MSSFU support. + + +changes from 156 to 157 +----------------------- + +* for MSSFU, use posixMember for group memberships rather than member + (reported by Andy Rechenberg) +* ignore SIGPIPE before calling do_close() for idle_timeout + + +changes from 155 to 156 +----------------------- + +* logic was around the wrong way in do_search(), all searches were broken! +* --disable-ssl option for configure +* removed "Obsoletes: pam_ldap" from spec file + + +changes from 154 to 155 +----------------------- + +* do not use private API when setting OpenLDAP TLS options (do_ssl_options()) + + +changes from 153 to 154 +----------------------- + +* notes from Scott M. Stone +* idle timeout patch from Steve Barrus + + +changes from 152 to 153 +----------------------- + +* SSL fix + + +changes from 151 to 152 +----------------------- + +* further patch from Jarkko for TLS/SSL auth: support for LDAPS/cipher suite + selection/ client key/cert authentication + + +changes from 150 to 151 +----------------------- + +* patch from Andrew Rechenberg for Active Directory schema support +* patch from Jarkko Turkulainen for peer certificate support + with OpenLDAP + + +changes from 149 to 150 +----------------------- + +* patch from Anselm Kruis for URI support + + +changes from 148 to 149 +----------------------- + +* fixed compile on Solaris, broken in 145 by malformed Linux patch + + +changes from 147 to 148 +----------------------- + +* check for HAVE_LDAP_SET_OPTION always + + +changes from 146 to 147 +----------------------- + +* check for ldap_set_option(), as LDAP_OPT_REFERRALS is defined for OpenLDAP + 1.x but without the ldap_set_option() function + + +changes from 145 to 146 +----------------------- + +* mass re-indentation, GNU style +* patch from Simon Wilkinson for compatibility with old + initgroups entry point +* request authPassword attribute if --enable-authpassword +* authPassword support in ldap-spwd.c (shadow) + + +changes from 144 to 145 +----------------------- + +* preliminary support for authPassword attribute +* updated COPYING +* patch from Szymon Juraszczyk to suppot _nss_ldap_initgroups_dyn prototype + + +changes from 143 to 144 +----------------------- + +* when specifying filters with nss_base_XXX, only escape the filter argument + not the entire filter + + +changes from 142 to 143 +----------------------- + +* patch from nalin@redhat.com to avoid corrupting the heap when the + configuration file exists but has no host and base values. + _nss_ldap_readconfigfromdns() will write to the region which was already + freed. + + +changes from 141 to 142 +----------------------- + +* patch from Simon Wilkinson for memory leak in + ldap-service.c + + +changes from 140 to 141 +----------------------- + +* fix for BUG#54 (AIX detection broken) +* use -rpath on all platforms except Solaris, + not just Linux + + +changes from 139 to 140 +----------------------- + +* fix configure bug for DISABLE_SO_KEEPALIVE +* fix alignment bug in util.c; this was causing Solaris to crash whenever + per-map search descriptors were specified in ldap.conf + + +changes from 138 to 139 +----------------------- + +* updated INSTALL file with boilerplate +* fixed pointer error in ldap-nss.c + + +changes from 137.1 to 138 +------------------------- + +* close config file FILE * if out of buffer space for parsing search + descriptor +* fixed bug where non-recognized directives in ldap.conf would cause the + configuration file to not be parsed at all, if they were the last entries in + the config file. + + +changes from 137 to 137.1 +------------------------- + +* patch from nalin@redhat.com; return { NULL } not NULL for no group members +* cleaned up usage of libc-lock.h weak aliases to pthreads API; use in ltf.c + also +* use __libc_atfork() or pthread_atfork() to close off connection on fork, + rather than checking PIDs; this is expensive and breaks on Linux where each + thread may have a different PID. + + +changes from 136 to 137 +----------------------- + +* build nss_ldap as a loadable module on AIX +* doco on AIX + + +changes from 135 to 136 +----------------------- + +* define -DPIC for FreeBSD +* link with -shared not --shared +* fixes for AIX + + +changes from 134 to 135 +----------------------- + +* merged ldap.conf +* fixed bug in concatenating relative search bases in ldap-nss.c (profile + support) + + +changes from 133 to 134 +----------------------- + +* fixed Makefile.am +* reordered DB search order in util.c + + +changes from 132 to 133 +----------------------- + +* make /usr/lib directory in Makefile.am +* new spec file from Joe Little + + +changes from 131 to 132 +----------------------- + +* fixed rebind preprocessor logic + + +changes from 130 to 131 +----------------------- + +* created files for automake happiness + + +changes from 129 to 130 +----------------------- + +* fixed typo preventing build with Netscape client library + + +changes from 128 to 129 +----------------------- + +* updated version number +* fixed build bug on Solaris + + +changes from 127 to 128 +----------------------- + +* fixed logic bug in util.c introduced in nss_ldap-127 + + +changes from 126 to 127 +----------------------- + +* updating copyright notices +* autoconf support; IRIX and OSF/1 support has been dropped (dl-*.[ch]) as no + one really used this, the implementation was a hack, and these operating + systems have their own LDAP implementations now +* added support for "referrals" and "restart" options to ldap.conf +* use OpenLDAP 2.x rebind proc with correct arguments +* added "timelimit" and "bind_timelimit" directives to ldap.conf +* fixed bug with dereferencing aliases +* preliminary support for profiles; recognise profile semantics in + ldap-nss.c/util.c +* parity with pam_ldap; "ssl" directive in ldap.conf can now specify "yes" or + "start_tls" for Start TLS +* hopefully fixed Berkeley DB include mess in util.c +* fixed potential buffer overflow in util.c +* default to LDAP protocol version 3 +* fixed leaks in util.c, dnsconfig.c +* accept on/yes/true for boolean configuration values +* tested building on FreeBSD, Solaris 8, Linux +* tested functionality on RedHat 6.2 + + +changes from 124 to 126 +----------------------- + +* fixed up Linux Makefiles to build libnss_ldap + + +changes from 123 to 124 +----------------------- + +* patch from nalin@redhat.com for StartTLS +* fixed up indenting + + +changes from 122.BZ52.2 to 123 +------------------------------ + +* rolled in BUG#52 branch with fixes for AIX + + +changes from 122.BZ52.1 to 122.BZ52.2 +------------------------------------- + +* included ldap-schema.c; omitted from previous checkpoint + + +changes from 122 to 122.BZ52.1 +------------------------------ + +* preliminary fix for BUG#52 (support for different naming contexts for each + map) +* fixed bug in enumerating services map + + +changes from 121 to 122 +----------------------- + +* fixed BUG#50 (check return value of ldap_simple_bind()) + + +changes from 120 to 121 +----------------------- + +* fixed BUG#49 (fix acknowledged race condition) + + +changes from 119 to 120 +----------------------- + +* added Makefile.aix and exports.aix (forgot) + + +changes from 118 to 119 +----------------------- + +* patch from Gabor Gombas to support AIX implementation + of BIND IRS + + +changes from 117 to 118 +----------------------- + +* Makefile.RPM.openldap2 from Joe Little + + +changes from 116 to 117 +----------------------- + +* permanently ignore SIGPIPE when using SSL. This bug should be fixed + properly. + + +changes from 115 to 116 +----------------------- + +* added irs-nss.diff and README.IRS from Emile Heitor + + +changes from 113 to 115 +----------------------- + +* fixed filter escaping +* call ldapssl_client_init() once only +* include db_185.h not db.h for dn2uid cache +* fixes for FreeBSD (IRS) support from Emile Heitor + + +changes from 110 to 113 +----------------------- + +* patch from Ben Collins to escape '*' in filters + + +changes from 109 to 110 +----------------------- + +* patch from Phlilip Liu for async binds + + +changes from 108 to 109 +----------------------- + +* omit socket check for -DSSL; it doesn't work +* updated CONTRIBUTORS +* updated README re HAVE_LDAP_LD_FREE + + +changes from 107 to 108 +----------------------- + +* included "deref" option in /etc/ldap.conf, compatible with OpenLDAP syntax. + Patch from Michael Mattice. + + +changes from 106.2 to 107 +------------------------- + +* fixed argument to _nss_ldap_getent() in ldap-ethers.c + + +changes from 106.1 to 106.2 +--------------------------- + +* if root, use rootbinddn/rootbindpw in rebind proc +* include objectClass in pwd required attributes + + +changes from 105 to 106.1 +------------------------- + +* if user is a shadowAccount, then don't return password in getpwent(), + getpwuid() or getpwnam() +* incorporated patch (from Doug Nazar): +* allow getgrent() to be called without setgrent(); note arguments to + _nss_ldap_getent() have changed. +* return NSS_NOTFOUND instead of NSS_UNAVAIL at the end of a search +* initialize len for getpeername() + + +changes from 104 to 105 +----------------------- + +* incorporated patch for deadlock under Solaris (from Dave Begley) + + +changes from 103 to 104 +----------------------- + +* new spec file + + +changes from 102 to 103 +----------------------- + +* don't call ldap_parse_result() with V2 API + + +changes from 101 to 102 +----------------------- + +* added defines for LDAP_MSG_ONE et al if not in ldap.h +* removed LDAP_MORE_RESULTS_TO_RETURN test + + +changes from 100 to 101 +----------------------- + +* fixed spec file + + +changes from 99 to 100 +---------------------- + +* support for asynchronous search API! +* added some contributors +* notes about ldap_ld_free() +* merged in ChangeLog + + +changes from 98 to 99 +--------------------- + +* added some netgroup implementation tips +* do_close_no_unbind() cleanup + + +changes from 97 to 98 +--------------------- + +* /etc/nss_ldap.secret -> /etc/ldap.secret (sorry, Doug!) +* deleted crypt-mechanism code. Junk. +* fixed call to _nss_ldap_read() after changing prototypes in nss_ldap-88 + + +changes from 96 to 97 +--------------------- + +* #ifndef HAVE_LDAP_LD_FREE, still call ldap_unbind(), but having closed the + descriptor. + + +changes from 95 to 96 +--------------------- + +* re-orged + + +changes from 94 to 95 +--------------------- + +* disable SO_KEEPALIVE on socket rather than blocking SIGPIPE. Need to figure + out the right way to do this. + + +changes from 93 to 94 +--------------------- + +* committed some changes for the parent/child close problem. It relies on + internal libldap APIs so it may be non-portable but should work with + OpenLDAP and Netscape client libraries, and perhaps most UMich- derived + client libraries. There's a possible workaround for client libraries without + this; undefine HAVE_LDAP_LD_FREE to test this. + + +changes from 92 to 93 +--------------------- + +* important fix: make sure return status is reset after do_open() == + NSS_SUCCESS, just in case no entries are returned. This bug was introduced + in nss_ldap-88 and could potentially cause a security hole. + + +changes from 91 to 92 +--------------------- + +* signal handling fix: don't restore handler unnecessarily. +* don't open nss_ldap.secret unless a root pw is specified in ldap.conf + + +changes from 90 to 91 +--------------------- + +* reorganized SIGPIPE blocking code +* added SSL support + + +changes from 89 to 90 +--------------------- + +* only reconnect if we've changed to/from root + + +changes from 88 to 89 +--------------------- + +* cleaned up a few things + + +changes from 87 to 88 +--------------------- + +* added breaks to switch in _nss_ldap_lookup (thanks to Nathan.Hawkins@FMR.COM + for pointing this out) +* save signal handler and ignore SIGPIPE for appropriate sections of do_open() + and confirm connection is still active (patch from rpatel@globix.com) +* allow root users to bind as a different user, to provide quasi-shadow + password support (patch from nazard@dragoninc.on.ca) +* under Linux, make Makefile look at last libc version (patch from + nazard@dragoninc.on.ca) +* never clobber nsswitch.ldap/ldap.conf when making install (patch from + nazard@dragoninc.on.ca) +* change do_open() to not unbind the parent ldap connection when the pid + changes but simply open a new connection (patch from nazard@dragoninc.on.ca) +* changed _nss_ldap_lookup() and _nss_ldap_read() prototypes to return + NSS_STATUS error codes, so that NSS_UNAVAIL percolates as appropriate. + + +changes from 86 to 87 +--------------------- + +* fixed looking up DN-membered groups by member. Thanks to Jeff Mandel for + spotting this hard to find bug. + + +changes from 85 to 86 +--------------------- + +* member for NDS vs uniqueMember (needs further investigation; -DNDS) + + +changes from 84 to 85 +--------------------- + +* check non-NULLity of userdn before freeing +* use AT(uid) for groupsbymember filter + + +changes from 81 to 84 +--------------------- + +* implemented _nss_ldap_initgroups() + + +changes from 80 to 81 +--------------------- + +* removed extraneous do_sleep() code +* updated spec file + + +changes from 2.79 to 80 +----------------------- + +* (really 2.80) changed version number a la Solaris 7! +* cleaned up schema stuff into ldap-schema.h + + +changes from 2.78 to 2.79 +------------------------- + +* implemented exponential backoff reconnect logic + + +changes from 2.76 to 2.78 +------------------------- + +* removed ldap.conf.ragenet from lineup +* removed spurious do_close() + + +changes from 2.75 to 2.76 +------------------------- + +* added -lresolv to Solaris makefiles + + +changes from 2.72 to 2.75 +------------------------- + +* incorporated RPM patches from stein@terminator.net + + +changes from 2.71 to 2.72 +------------------------- + +* implemented getgroupsbymember() for Solaris. Supplementary groups should be + initialized now. (NB: doesn't appear to be quite working for RFC2307bis + yet.) +* GNU indent-ified + + +changes from 2.70 to 2.71 +------------------------- + +* removed -DDEBUG as default build flag + + +changes from 2.69 to 2.70 +------------------------- + +* put /usr/ucblib back into linker search path for Solaris. + + +changes from 2.68 to 2.69 +------------------------- + +* added timeout, unavailable, and server busy conditions to rebind logic +* indent -gnu all source files + + +changes from 2.65 to 2.68 +------------------------- + +* mods for glibc 2.1 (__set_errno is obselete it seems) + + +changes from 2.64 to 2.65 +------------------------- + +* mods to compile with OpenLDAP 2 + + +changes from 2.63 to 2.64 +------------------------- + +* changed alias schema to Sun SDS nisMailAlias schema +* updated TODO list to reflect Bugzilla entries +* restored capitalization of attributes for "niceness" + + +changes from 2.62 to 2.63 +------------------------- + +* added patch from gero@faveve.uni-stuttgart.de for parsing of ldap.conf with + tabs +* some fixes for BSDI BSD/OS IRS + + +changes from 2.61 to 2.62 +------------------------- + +* added experimental support for DN-membered groups; to enable, define + RFC2307BIS +* fixed align bug (where buflen wasn't being decremented after pointer + alignment) + + +changes from 2.60 to 2.61 +------------------------- + +* added warning about compiling with DS 4.1 LDAP SDK + + +changes from 2.59 to 2.60 +------------------------- + +* fixed missing close brace + + +changes from 2.56 to 2.59 +------------------------- + +* pw_comment field defaults to pw_gecos (Solaris only) + + +changes from 2.55 to 2.56 +------------------------- + +* fixed Makefile.linux.mozilla NSSLIBVER + + +changes from 2.54.6 to 2.55 +--------------------------- + +* merged in glibc-2.1 branch + + +changes from 2.54.5 to 2.54.6 +----------------------------- + +* misc fixes. + + +changes from 2.54.4 to 2.54.5 +----------------------------- + +* misc fixes. + + +changes from 2.54.3 to 2.54.4 +----------------------------- + +* glibc-2.1 patches from bcollins@debian.org + + +changes from 2.51 to 2.54.3 +--------------------------- + +* glibc-2.1 support. (Recall #93) +* set erange correctly on Solaris (related to above) +* added rebind function + + +changes from 2.49 to 2.51 +------------------------- + +* added stuff for RC + + +changes from 2.47 to 2.49 +------------------------- + +* configuration file is now case insensitive + + +changes from 2.45 to 2.47 +------------------------- + +* RFC2052BIS (_ldap._tcp) support + + +changes from 2.44 to 2.45 +------------------------- + +* added #include to globals.c + + +changes from 2.42 to 2.44 +------------------------- + +* NULL search base allowed (omit basedn from config file) + + +changes from 2.39 to 2.42 +------------------------- + +* fixed potential crasher in dnsconfig.c +* LDAP session is now persistent for performance reasons. Removed references + to the session anywhere outside ldap-nss.c. The process ID is cached and the + session reopened after a fork(). + + +changes from 2.38 to 2.39 +------------------------- + +* fixed warning in ldap-ethers.c (removed const from struct ether) +* added ldap_version keyword to ldap.conf for parity with pam_ldap + + +changes from 2.37 to 2.38 +------------------------- + +* debugged ldap_explode_rdn() code +* added support for Mozilla LDAP client library; see Makefile.linux.mozilla + and ltf.c for more information. Thanks to Netscape for making their library + available. + + +changes from 2.36 to 2.37 +------------------------- + +* moved to CVS repository and Linux as development environment +* incorporated ldap-service.c fix from Greg + + +changes from 2.35 to 2.36 +------------------------- + +* util.c: will use ldap_explode_rdn() if it exists + + +changes from 2.34 to 2.35 +------------------------- + +* made util.c compile again. Silly me. + + +changes from 2.33 to 2.34 +------------------------- + +* fixed #endif in testpw.c +* fixed another DN freeing leak in util.c +* added RFC 2307 to distribution (fixed the two typos in it: +* fixed bug in ...getrdnvalue() (thanks, Greg) +* diff rfc2307.txt ~/rfc2307.txt +480c480 +< MUST ( cn $ ipProtocolNumber ) +--- +> MUST ( cn $ ipProtocolNumber $ description ) +1038c1038 +< lester:X5/DBrWPOQQaI:10:10:Lester:/home/lester:/bin/csh +--- +> lester:X5/DBrWPOQQaI:10:10:Lester:/home/lester:/bin/sh + + +changes from 2.32 to 2.33 +------------------------- + +* rolled in more patches from greg@rage.net: +* removed _r from setXXXent and endXXXent functions for GNU_NSS +* cleaned up testpw.c to use pthreads and protos +* fixed prototype for gethostbyaddr_r on GNU_NSS +* braced conditional in getservbyname_r +* merged in Makefile.linux and README.LINUX diffs +* added htons(port) in getservbyport_r +* added nsswitch.test +* added ldaptest.pl +* added ldap.conf.ragenet + + +changes from 2.31 to 2.32 +------------------------- + +* moved Makefile to Makefile.solaris +* cleaned up mutex code for Linux, hopefully + + +changes from 2.30 to 2.31 +------------------------- + +* fixed leak in util.c (need to free dn) +* rolled in patches from greg@rage.net: +* fixed ldap-ethers.c to use struct ether +* fixed bracing in ldap-hosts.c (?) +* added SSLEAY patch to ldap-nss.h +* fixed locking in ldap-nss.h +* Makefile changes incorporated into Makefile.linux + + +changes from 2.29e to 2.30 +-------------------------- + +* synced into DevMan repository again +* RFC 2307 is the one! + + +changes from 2.29d to 2.29e +--------------------------- + +* util.c: fixed memory leak (call to ldap_value_free()) + + +changes from 2.29c to 2.29d +--------------------------- + +* ldap-ethers.c: fixed to use HOSTNAME attribute + + +changes from 2.29b to 2.29c +--------------------------- + +* ieee8022Device -> ieee802Device + + +changes from 2.29a to 2.29b +--------------------------- + +* added ieee8022Device and bootableDevice classes, + at Sun's request. + + +changes from 2.29 to 2.29a +-------------------------- + +* dc -> cn + + +changes from 2.28 to 2.29 +------------------------- + +* changed host/network/ethers naming schema see the -02 draft revision for + more info + + +changes from 2.27 to 2.28 +------------------------- + +* ldap-pwd.c, ldap-spwd.c: fixed tmpbuf stuff. Yuck. + + +changes from 2.26 to 2.27 +------------------------- + +* ANNOUNCE: reflected draft-howard-nis-schema-01.txt +* ldap-spwd.c: default for shadow integer values is -1, not 0 and fixed + crasher (thanks to dj@gregor.com) + + +changes from 2.25 to 2.26 +------------------------- + +* globals.c: added offset stuff back for mapping errnumbers. Weird: this stuff + *was* in an earlier version of the work area. I have no idea where it went. + Scary. + + +changes from 2.24 to 2.25 +------------------------- + +* irs-nss.h: added prototype for irs_ldap_acc() +* ldap-*.[ch]: removed redundent PARSER macro +* unbroke for GNU NSS (context_key_t changed to context_handle_t) + + +changes from 2.23 to 2.24 +------------------------- + +* irs-nss.c: added dispatch table for IRS library +* testpw5.c: added additional test program +* ldap-nss.c: removed spurious debug statement +* ldap-nss.c, util.c, dnsconfig.c: cleaned up memory allocation for config. + (This could be improved, but there is no longer a static ldap_config_t + structure.) +* Makefile: general cleanup + + +changes from 2.22 to 2.23 +------------------------- + +* default destructor is now simply wrapped around by individual backend + destructors +* __EXTENSIONS__ defined for Solaris 2.6 to import strncasecmp() +* getbyname: fixed crasher in ldap-nss.c due to uninitialized variable +* ldap-parse.h, assorted others: tidied up resolver calls to use NSS_ARGS() + macro and not to interfere with the previous backend's status (bad thing!) +* ldap-service.c: cleaned up potential uninitialized var in parser +* ldap-nss.c: no valued arrays are now { NULL } instead of NULL. + + +changes from 2.21 to 2.22 +------------------------- + +* testpw.c: XXX problem. dies with segfault, but gdb doesn't give me enough + information; it's definitely within nss_ldap.so though. I just can't see the + symbols. (Maybe dbx would be better...) However, testpw doesn't work at + *all* under 2.5.1, and technically it shouldn't as it's not linked against + liblthread. I haven't been able to duplicate this with testpw2, which is the + same code linked with the thread library. +* backported to NeXT + + +changes from 2.20 to 2.21 +------------------------- + +* resolve.h: renamed functions so as to keep namespace clean +* snprintf.h: tidied up for systems which already have snprintf() and renamed + anyway to keep namespace clean (_nss_ldap_snprintf) +* ldap-*.h: made character constants const to avoid nasty warnings +* globals.[ch]: as above +* README, TODO, ANNOUNCE: general documentation updates +* ldap-nss.c, et al: general work on Solaris 2.6 port, to get nscd working. + Lots of fiddling with the locking. +* Major architectural changes to Solaris NSS implementation. Thread specific + data is now stored in the backend, where it should be: just like it is in + IRS. Locking is a little more coarse now, but it will do for the moment. +* Paul Henson's DCE module gave me the inspiration to do the backend stuff the + "right" way -- thanks, Paul! +* As a result, a lot of the bugs listed in TODO have mysteriously fixed + themselves. :-) + + +changes from 2.19 to 2.20 +------------------------- + +* Makefile.*: ensured resolve.[ch] and dnsconfig.[ch] were there. +* Makefile: should link now with gcc -shared instead of requiring cc. + + +changes from 2.18 to 2.19 +------------------------- + +* testpw4.c: added irs hostbyname() test +* Makefile: added correct flags to build position indepdenent code with Sun's + compiler (thanks, Bill). Added SRV sources. +* testpw.c: works under NeXT, cleaned up a bit. +* ldap.conf: documented what this file does +* util.c: ignore blank lines in ldap.conf properly +* resolve.h: fixed up for Solaris + + +changes from 2.17 to 2.18 +------------------------- + +* ldap-network.c: fixed infinite loop in getnetbyname() +* util.c: goto out causes a compiler warning under Solaris. Documented this. + Should fix this, I suppose, but we need to break out of two blocks. (We + could remove the code that handles multivalued DNs, as it's fairly unlikely + that someone will use a DN of o=Xedoc+dc=xedoc,c=US+dc=com, but who knows?) +* ldap-ethers.c: line 215, result was not assigned to an lvalue (should have + been args->status, not args). Fixed. + + +changes from 2.16 to 2.17 +------------------------- + +* Cleaned up documentation and testpw4.c +* dnsconfig.c: Fixed strtok() bug which was clobbering domain + + +changes from 2.15 to 2.16 +------------------------- + +* util.c (_nss_ldap_readconfig) fixed strtok() typo + + +changes from 2.2 to 2.15 +------------------------ + +* dnsconfig.c: got DNS SRV support working under NEXTSTEP +* util.c: (_nss_ldap_getdomainname) made host and network DN parsing compliant + with current draft + + +changes from 2.1 to 2.2 +----------------------- + +* I'll get around to merging in the RCS log here one day. Nothing very + exciting happened, I just backported the code to NEXTSTEP and compiled it. diff --git a/contrib/slapd-modules/nssov/nss-ldapd/README b/contrib/slapd-modules/nssov/nss-ldapd/README new file mode 100644 index 0000000000..ab4671fda5 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/README @@ -0,0 +1,317 @@ + nss-ldapd - NSS library for name lookups using LDAP + + nss-ldapd is a fork from nss_ldap which was originally written by + Luke Howard of PADL Software Pty Ltd. + + http://www.padl.com/OSS/nss_ldap.html + + In 2006 Arthur de Jong of West Consuling forked the library to + split it into a thin NSS part and a server part. Most of the code + was rewritten. + http://ch.tudelft.nl/~arthur/nss-ldapd/ + + Copyright (C) 1997-2006 Luke Howard + Copyright (C) 2006, 2007 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA + + +INTRODUCTION +============ + +This is the nss-ldapd library which is an NSS module to do name lookups to an +LDAP directory server. This library was forked from nss_ldap as provided by +Luke Howard of PADL Software Pty Ltd. + +The library allows distributing account, group, host and other configuration +information from a central LDAP server throughout an organisation. Because +LDAP is a hierarchical directory service, you can distribute the information +in a manner which reflects an organisational structure. This contrasts with +the flat, single domain policy of NIS. LDAP has many of the advantages of NIS+ +(security and scalability) without the complexity. The system will work +alongside your existing NIS, NIS+, DNS and flat file name services. + +This library consists of a thin NSS part that communicates with a local daemon +that handles the LDAP lookups. This simplifies the architecture and fixes some +scalability and locking problems in the original design. + +improvements over nss_ldap +-------------------------- + +The fork from nss_ldap was done to implement some major design changes to fix +some structural problems in the library. + +The biggest of those problems were host name lookups through LDAP which could +cause deadlocks in most cases and some general name lookup problems during +booting (when the LDAP server was not started or not yet reachable). + +With nss-ldapd a number of refactoring steps were taken to simplify the code +and improve maintainability. Legacy code was removed and support for non-Linux +operating systems was initially removed to make the code more readable. +Portability will be re-added once the architecture stabilises. + +The most practical improvements of nss-ldapd over nss_ldap are: +- the LDAP library is not loaded for every process doing LDAP lookups +- the number of connections to the LDAP server is limited, because not every + process will open it's own connection (this problem is also mitigated by + using nscd) +- hostname lookups should now be deadlock-free because the LDAP server name is + no longer looked up using the ldap method +- the setup is easier to debug because logging on the server component can be + enabled without affecting "normal" processes + +This package runs a local daemon that will be enabled during the boot process. +This daemon will handle connections to the LDAP server and accept NSS requests +from a named socket (/var/run/nslcd/socket). The thin NSS library will proxy +requests to the daemon. + +Note that the package currently cannot be used on the same system alongside +nss_ldap. + +supported C libraries +--------------------- + +This library currently only supports the GNU C Library. Support for other C +libraries has been removed in a refactoring step. Compatibility code and +support for other C libraries will be added in due time upon request. + +supported name databases +------------------------ + +Currently the following name databases are supported: + + aliases, ethers, group, hosts, netgroup, networks, passwd, protocols, rpc, + services and shadow + +Note that for when using IPv6 hosts entries, the addresses in the LDAP +directory must be in their preferred form. The same is true for mac addresses +for the ethers database. Otherwise the address->entry lookups will not work. +For more details on the preferred form see + http://ldap.akbkhome.com/index.php/attribute/ipHostNumber.html +and + http://ldap.akbkhome.com/index.php/attribute/macAddress.html + +automounter map lookups (which are also defined in /etc/nsswitch.conf) are not +supported because the NSS interface is not used for these. The common autofs +implementation (on GNU/Linux) currently uses it's own method for getting the +maps from LDAP. + +Although aliases is exposed through NSS, most mailservers parse /etc/aliases +by themselves and getting aliases from LDAP requires some configuration in the +mailserver. + +The publickey, bootparams and netmasks are currently also unsupported. Some +investigation should be done if these are needed for anything, which +interfaces should be exported and how the LDAP schema part should look like. + +supported LDAP libraries +------------------------ + +The current version of nss-ldapd has been developed with OpenLDAP 2.4 but +adding support for other LDAP libraries with similar interfaces should not be +too hard. + +unsupported features +-------------------- + +Since nss-ldapd was forked from nss_ldap most of the features that came with +nss_ldap are available. However, not all features have extensively tested yet +and may cause problems. +- attribute value default and overrides have been removed (but may reappear + some day if requested) +- SSL/TLS support is untested but will be tested when the core code stabilizes +- the configuration file formats are not fully compatible +- nested groups are currently unsupported +- rootbinddn/rootbindpw support is removed and is not likely to return + +In general, the focus is to have the functionality that is present be well +tested and supported. + + +INSTALLATION +============ + +The nss-ldapd library uses autoconf and automake for building. Installing +nss-ldapd should be as simple as: + + % ./configure + % make + % make install + +That said, it is a good idea to go first through the options of configure by +running: + + % ./configure --help + +The last step (make install) should install the libnss_ldap.so.* file and the +daemon (nslcd). The boot process needs to be manually modified to start the +daemon at the right time. + + +CONFIGURATION +============= + +After installation the name service switch configuration file +(/etc/nsswitch.conf) needs to be modified to do name lookups using the new +module. Also, the nss-ldapd configuration file (specified at configure time) +needs to be modified to contain to the correct LDAP configuration. + +Editing nsswitch.conf consist mostly of adding ldap in the list of lookup +methods in the right place. See the nsswitch.conf(5) manual page for details +on the format. As an example the file could look a little like this: + + # the following contain normal unix user and group information + passwd: files ldap + group: files ldap + shadow: files ldap + + # hostname lookups through ldap before dns should work now + hosts: files ldap dns + networks: files ldap + + # normal flat-file definitions + protocols: files ldap + services: files ldap + ethers: files ldap + rpc: files ldap + netgroup: ldap + + # whether alias lookups really use NSS depends on the mail server + aliases: files ldap + +Furthermore a configuration file (by default /etc/nss-ldapd.conf) needs to be +made. The location of this file can be specified with configure. See the +shipped manual page for details on the format and options. It should at least +contain something like: + + # the location of LDAP server + uri ldap://localhost/ + + # search base for all queries. + base dc=example,dc=net + +service discovery through DNS +----------------------------- + +nss-ldapd supports looking up LDAP server names through DNS SRV records as +specified in RFC 2782. However, Priority and Weight are not considered +separately and a single list of servers in added as if they had been specified +with uri options in the configuration file. + +To use this feature specify DNS as an uri in the configuration file and +include something like the following in your zone: + + _ldap._tcp SRV 10 0 389 ldapserver + + +LDAP SCHEMA +=========== + +nss-ldapd supports a wide range of possible LDAP schema configurations. +Furthermore it can be customized heavily. The LDAP schema used is described in +RFC 2307. Groups with distinguished name members (instead of login names) (RFC +2307bis) are also supported, although use of memberUid has much better +performance. + +default attributes +------------------ + +This paragraph describes the mapping between the NSS lookups and the LDAP +database. The mapping may be modified by changeging the nss-ldapd.conf +configuration file. See the nss-ldapd.conf(5) manual page for details. + +aliases (objectClass=nisMailAlias) + cn - alias name + rfc822MailMember - members of the alias (recipients) +ethers (objectClass=ieee802Device) + cn - host name + macAddress - ethernet address +group (objectClass=posixGroup) + cn - group name + userPassword - password + gidNumber - gid + memberUid - members (user names) + uniqueMember - members (DN values) +hosts (objectClass=ipHost) + cn - host name (and aliases) + ipHostNumber - addresses +netgroup (objectClass=nisNetgroup) + cn - netgroup name + nisNetgroupTriple - triplets describing netgroup entries + memberNisNetgroup - reference to other netgroup +networks (objectClass=ipNetwork) + cn - network name + ipNetworkNumber - network address + ipNetmaskNumber - network netmask +passwd (objectClass=posixAccount) + uid - account name + userPassword - password + uidNumber - uid + gidNumber - gid + gecos - gecos + cn - gecos (if gecos is unset) + homeDirectory - home directory + loginShell - shell +protocols (objectClass=ipProtocol) + cn - protocol name + ipProtocolNumber - protocol number +rpc (oncRpc) + cn - rpc name + oncRpcNumber - rpc number +services (objectClass=ipService) + cn - service name + ipServicePort - service port + ipServiceProtocol - service protocol +shadow (objectClass=shadowAccount) + uid - use name + userPassword - password + shadowLastChange - last change of password + shadowMax - days before password may be changed + shadowMin - days after which password must be changed + shadowWarning - expiry warning + shadowInactive - account is disabled if no password is changed + shadowExpire - account expiration + shadowFlag - reserved field + +using Microsoft Active Directory +-------------------------------- + +When using Microsoft Active Directory server (typically on Microsoft Windows +2000) some changes need to be made to the nss-ldapd.conf configuration file. +The included sample configuration file has some commented out attribute +mappings for such a set-up. + + +MISC NOTES +========== + +Most values in the NSS databases are considered case-sensitive (e.g. the user +"Foo" is a different user from "foo"). Values in an LDAP database are however +case-insensitive. This may cause problems in some corner cases, especially +when nscd is used for caching. For example, when doing a lookup for the user +"Foo" the user "foo" will be returned if it exists in the database. + + +REPORTING BUGS +============== + +If you find any bugs or missing features please send email to + arthur@ch.tudelft.nl +If you are using the Debian package you are encouraged to use the BTS. +Please include as much information as needed (platform, output of configure +if compilation fails, output of the failure, etc). Patches are more than +welcome (also see the file HACKING). diff --git a/contrib/slapd-modules/nssov/nss-ldapd/TODO b/contrib/slapd-modules/nssov/nss-ldapd/TODO new file mode 100644 index 0000000000..0743adc816 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/TODO @@ -0,0 +1,59 @@ +probably before we can call this stable +--------------------------------------- +* fix usage of strerror() as it is not thread safe +* fix race condition when setting signal mask in common/tio.c + (using pthread_sigmask() adds a dependency on the pthread library, + we should probably just do locking) +* find problem with reachability of LDAP server +* find out why HAVE_GSSPAI is not always set to what configure outputs +* have the daemon run under a special uid/gid + +other items +----------- +* set up (test) connection to LDAP server before creating socket +* Debian packaging: maybe remove stuff from /etc/nsswitch.conf on remove or + purge (maybe prompt?) +* probably document that you should use libpam-ldap for authentication without + exposing the passwords through NSS +* document test suite (instructions for setting up environment (server), LDIF + file, nsswitch.conf and nss-ldapd.conf) +* write more unit tests +* maybe support bootparams (check README also) +* maybe support publickey (check README also) +* maybe support netmasks (check README also) +* maybe implement a connection object in the myldap module that is shared + by different sessions (sessions need to be cleaned up) +* add sanity checking code (e.g. not too large buffer allocation and checking + that host, user, etc do not contain funky characters) in all server modules +* log some statistics: "passwd=100 shadow=10 host=20 rpc=10" (10 req/minute) +* in the server: once the request is done pass the flushing of the buffers to + a separate thread so our workers are available to handle new requests +* reconfigure or upgrade of Debian package should restart nslcd instead of + stop and later on start +* tune the filter and parameter buffer sizes +* maybe document how to set up automounting in LDAP (Linux and Solaris) +* make sure to translate timelimit 0 into timelimit -1 where needed +* split out idle checking into separate function so we may be able to call it + periodically from elsewhere (e.g. the main loop) +* add an option to create an extra socket somewhere (so it may be used with + chroot jails) +* make I/O timeout between NSS lib and daemon configurable with configure +* ethers: also look in ipHostNumber attribute to look up an IPv4 (IPv6) + address and return it as an alternative entry +* protocols/rpc: the description attribute should be used as an alias? +* do more checks with failing LDAP connections (e.g. killing connections) +* maybe make myldap code thread-safe (use locking) +* review changes in nss_ldap and merge any useful changes +* maybe rate-limit LDAP entry warnings +* consider returning the canonical value as it is stored in LDAP, not + the requested value (they can differ in case) +* test non-ASCII characters in fields (mostly cn) +* implement attribute defaults (for when they're missing from the directory) +* implement attribute overrides (to always return a specific value, no matter + what the directory says) +* see if we can use LD_LIBRARY_PATH to run our tests in so we don't need to + install NSS library in system path +* only parse configuration options if they are available on the platform +* have some more general mechanism to disable NSS module in nslcd +* do not use LDAP_DEPRECATED enabled functions +* support searchbase autodetection diff --git a/contrib/slapd-modules/nssov/nss-ldapd/aclocal.m4 b/contrib/slapd-modules/nssov/nss-ldapd/aclocal.m4 new file mode 100644 index 0000000000..d50fe319ca --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/aclocal.m4 @@ -0,0 +1,903 @@ +# generated automatically by aclocal 1.10.1 -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +m4_if(AC_AUTOCONF_VERSION, [2.61],, +[m4_warning([this file was generated for autoconf 2.61. +You have another version of autoconf. It may work, but is not guaranteed to. +If you have problems, you may need to regenerate the build system entirely. +To do so, use the procedure documented by the package, typically `autoreconf'.])]) + +# Copyright (C) 2002, 2003, 2005, 2006, 2007 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_AUTOMAKE_VERSION(VERSION) +# ---------------------------- +# Automake X.Y traces this macro to ensure aclocal.m4 has been +# generated from the m4 files accompanying Automake X.Y. +# (This private macro should not be called outside this file.) +AC_DEFUN([AM_AUTOMAKE_VERSION], +[am__api_version='1.10' +dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to +dnl require some minimum version. Point them to the right macro. +m4_if([$1], [1.10.1], [], + [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl +]) + +# _AM_AUTOCONF_VERSION(VERSION) +# ----------------------------- +# aclocal traces this macro to find the Autoconf version. +# This is a private macro too. Using m4_define simplifies +# the logic in aclocal, which can simply ignore this definition. +m4_define([_AM_AUTOCONF_VERSION], []) + +# AM_SET_CURRENT_AUTOMAKE_VERSION +# ------------------------------- +# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. +# This function is AC_REQUIREd by AC_INIT_AUTOMAKE. +AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], +[AM_AUTOMAKE_VERSION([1.10.1])dnl +m4_ifndef([AC_AUTOCONF_VERSION], + [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl +_AM_AUTOCONF_VERSION(AC_AUTOCONF_VERSION)]) + +# AM_AUX_DIR_EXPAND -*- Autoconf -*- + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets +# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to +# `$srcdir', `$srcdir/..', or `$srcdir/../..'. +# +# Of course, Automake must honor this variable whenever it calls a +# tool from the auxiliary directory. The problem is that $srcdir (and +# therefore $ac_aux_dir as well) can be either absolute or relative, +# depending on how configure is run. This is pretty annoying, since +# it makes $ac_aux_dir quite unusable in subdirectories: in the top +# source directory, any form will work fine, but in subdirectories a +# relative path needs to be adjusted first. +# +# $ac_aux_dir/missing +# fails when called from a subdirectory if $ac_aux_dir is relative +# $top_srcdir/$ac_aux_dir/missing +# fails if $ac_aux_dir is absolute, +# fails when called from a subdirectory in a VPATH build with +# a relative $ac_aux_dir +# +# The reason of the latter failure is that $top_srcdir and $ac_aux_dir +# are both prefixed by $srcdir. In an in-source build this is usually +# harmless because $srcdir is `.', but things will broke when you +# start a VPATH build or use an absolute $srcdir. +# +# So we could use something similar to $top_srcdir/$ac_aux_dir/missing, +# iff we strip the leading $srcdir from $ac_aux_dir. That would be: +# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` +# and then we would define $MISSING as +# MISSING="\${SHELL} $am_aux_dir/missing" +# This will work as long as MISSING is not called from configure, because +# unfortunately $(top_srcdir) has no meaning in configure. +# However there are other variables, like CC, which are often used in +# configure, and could therefore not use this "fixed" $ac_aux_dir. +# +# Another solution, used here, is to always expand $ac_aux_dir to an +# absolute PATH. The drawback is that using absolute paths prevent a +# configured tree to be moved without reconfiguration. + +AC_DEFUN([AM_AUX_DIR_EXPAND], +[dnl Rely on autoconf to set up CDPATH properly. +AC_PREREQ([2.50])dnl +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` +]) + +# AM_CONDITIONAL -*- Autoconf -*- + +# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 8 + +# AM_CONDITIONAL(NAME, SHELL-CONDITION) +# ------------------------------------- +# Define a conditional. +AC_DEFUN([AM_CONDITIONAL], +[AC_PREREQ(2.52)dnl + ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], + [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl +AC_SUBST([$1_TRUE])dnl +AC_SUBST([$1_FALSE])dnl +_AM_SUBST_NOTMAKE([$1_TRUE])dnl +_AM_SUBST_NOTMAKE([$1_FALSE])dnl +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi +AC_CONFIG_COMMANDS_PRE( +[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then + AC_MSG_ERROR([[conditional "$1" was never defined. +Usually this means the macro was only invoked conditionally.]]) +fi])]) + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 9 + +# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be +# written in clear, in which case automake, when reading aclocal.m4, +# will think it sees a *use*, and therefore will trigger all it's +# C support machinery. Also note that it means that autoscan, seeing +# CC etc. in the Makefile, will ask for an AC_PROG_CC use... + + +# _AM_DEPENDENCIES(NAME) +# ---------------------- +# See how the compiler implements dependency checking. +# NAME is "CC", "CXX", "GCJ", or "OBJC". +# We try a few techniques and use that to set a single cache variable. +# +# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was +# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular +# dependency, and given that the user is not expected to run this macro, +# just rely on AC_PROG_CC. +AC_DEFUN([_AM_DEPENDENCIES], +[AC_REQUIRE([AM_SET_DEPDIR])dnl +AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl +AC_REQUIRE([AM_MAKE_INCLUDE])dnl +AC_REQUIRE([AM_DEP_TRACK])dnl + +ifelse([$1], CC, [depcc="$CC" am_compiler_list=], + [$1], CXX, [depcc="$CXX" am_compiler_list=], + [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], + [$1], UPC, [depcc="$UPC" am_compiler_list=], + [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], + [depcc="$$1" am_compiler_list=]) + +AC_CACHE_CHECK([dependency style of $depcc], + [am_cv_$1_dependencies_compiler_type], +[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_$1_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_$1_dependencies_compiler_type=none +fi +]) +AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) +AM_CONDITIONAL([am__fastdep$1], [ + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) +]) + + +# AM_SET_DEPDIR +# ------------- +# Choose a directory name for dependency files. +# This macro is AC_REQUIREd in _AM_DEPENDENCIES +AC_DEFUN([AM_SET_DEPDIR], +[AC_REQUIRE([AM_SET_LEADING_DOT])dnl +AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl +]) + + +# AM_DEP_TRACK +# ------------ +AC_DEFUN([AM_DEP_TRACK], +[AC_ARG_ENABLE(dependency-tracking, +[ --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors]) +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi +AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) +AC_SUBST([AMDEPBACKSLASH])dnl +_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl +]) + +# Generate code to set up dependency tracking. -*- Autoconf -*- + +# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +#serial 3 + +# _AM_OUTPUT_DEPENDENCY_COMMANDS +# ------------------------------ +AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], +[for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`AS_DIRNAME("$mf")` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`AS_DIRNAME(["$file"])` + AS_MKDIR_P([$dirpart/$fdir]) + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done +])# _AM_OUTPUT_DEPENDENCY_COMMANDS + + +# AM_OUTPUT_DEPENDENCY_COMMANDS +# ----------------------------- +# This macro should only be invoked once -- use via AC_REQUIRE. +# +# This code is only required when automatic dependency tracking +# is enabled. FIXME. This creates each `.P' file that we will +# need in order to bootstrap the dependency handling code. +AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], +[AC_CONFIG_COMMANDS([depfiles], + [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], + [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) +]) + +# Do all the work for Automake. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, +# 2005, 2006, 2008 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 13 + +# This macro actually does too much. Some checks are only needed if +# your package does certain things. But this isn't really a big deal. + +# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) +# AM_INIT_AUTOMAKE([OPTIONS]) +# ----------------------------------------------- +# The call with PACKAGE and VERSION arguments is the old style +# call (pre autoconf-2.50), which is being phased out. PACKAGE +# and VERSION should now be passed to AC_INIT and removed from +# the call to AM_INIT_AUTOMAKE. +# We support both call styles for the transition. After +# the next Automake release, Autoconf can make the AC_INIT +# arguments mandatory, and then we can depend on a new Autoconf +# release and drop the old call support. +AC_DEFUN([AM_INIT_AUTOMAKE], +[AC_PREREQ([2.60])dnl +dnl Autoconf wants to disallow AM_ names. We explicitly allow +dnl the ones we care about. +m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl +AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl +AC_REQUIRE([AC_PROG_INSTALL])dnl +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi +AC_SUBST([CYGPATH_W]) + +# Define the identity of the package. +dnl Distinguish between old-style and new-style calls. +m4_ifval([$2], +[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl + AC_SUBST([PACKAGE], [$1])dnl + AC_SUBST([VERSION], [$2])], +[_AM_SET_OPTIONS([$1])dnl +dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. +m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, + [m4_fatal([AC_INIT should be called with package and version arguments])])dnl + AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl + AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl + +_AM_IF_OPTION([no-define],, +[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl + +# Some tools Automake needs. +AC_REQUIRE([AM_SANITY_CHECK])dnl +AC_REQUIRE([AC_ARG_PROGRAM])dnl +AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) +AM_MISSING_PROG(AUTOCONF, autoconf) +AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) +AM_MISSING_PROG(AUTOHEADER, autoheader) +AM_MISSING_PROG(MAKEINFO, makeinfo) +AM_PROG_INSTALL_SH +AM_PROG_INSTALL_STRIP +AC_REQUIRE([AM_PROG_MKDIR_P])dnl +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +AC_REQUIRE([AC_PROG_AWK])dnl +AC_REQUIRE([AC_PROG_MAKE_SET])dnl +AC_REQUIRE([AM_SET_LEADING_DOT])dnl +_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], + [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], + [_AM_PROG_TAR([v7])])]) +_AM_IF_OPTION([no-dependencies],, +[AC_PROVIDE_IFELSE([AC_PROG_CC], + [_AM_DEPENDENCIES(CC)], + [define([AC_PROG_CC], + defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_CXX], + [_AM_DEPENDENCIES(CXX)], + [define([AC_PROG_CXX], + defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl +AC_PROVIDE_IFELSE([AC_PROG_OBJC], + [_AM_DEPENDENCIES(OBJC)], + [define([AC_PROG_OBJC], + defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl +]) +]) + + +# When config.status generates a header, we must update the stamp-h file. +# This file resides in the same directory as the config header +# that is generated. The stamp files are numbered to have different names. + +# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the +# loop where config.status creates the headers, so we can generate +# our stamp files there. +AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], +[# Compute $1's index in $config_headers. +_am_arg=$1 +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_SH +# ------------------ +# Define $install_sh. +AC_DEFUN([AM_PROG_INSTALL_SH], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} +AC_SUBST(install_sh)]) + +# Copyright (C) 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# Check whether the underlying file-system supports filenames +# with a leading dot. For instance MS-DOS doesn't. +AC_DEFUN([AM_SET_LEADING_DOT], +[rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null +AC_SUBST([am__leading_dot])]) + +# Check to see how 'make' treats includes. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# AM_MAKE_INCLUDE() +# ----------------- +# Check to see how make treats includes. +AC_DEFUN([AM_MAKE_INCLUDE], +[am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +AC_MSG_CHECKING([for style of include used by $am_make]) +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi +AC_SUBST([am__include]) +AC_SUBST([am__quote]) +AC_MSG_RESULT([$_am_result]) +rm -f confinc confmf +]) + +# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_PROG_CC_C_O +# -------------- +# Like AC_PROG_CC_C_O, but changed for automake. +AC_DEFUN([AM_PROG_CC_C_O], +[AC_REQUIRE([AC_PROG_CC_C_O])dnl +AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([compile])dnl +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi +dnl Make sure AC_PROG_CC is never called again, or it will override our +dnl setting of CC. +m4_define([AC_PROG_CC], + [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) +]) + +# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- + +# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 5 + +# AM_MISSING_PROG(NAME, PROGRAM) +# ------------------------------ +AC_DEFUN([AM_MISSING_PROG], +[AC_REQUIRE([AM_MISSING_HAS_RUN]) +$1=${$1-"${am_missing_run}$2"} +AC_SUBST($1)]) + + +# AM_MISSING_HAS_RUN +# ------------------ +# Define MISSING if not defined so far and test if it supports --run. +# If it does, set am_missing_run to use it, otherwise, to nothing. +AC_DEFUN([AM_MISSING_HAS_RUN], +[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl +AC_REQUIRE_AUX_FILE([missing])dnl +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + AC_MSG_WARN([`missing' script is too old or missing]) +fi +]) + +# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_MKDIR_P +# --------------- +# Check for `mkdir -p'. +AC_DEFUN([AM_PROG_MKDIR_P], +[AC_PREREQ([2.60])dnl +AC_REQUIRE([AC_PROG_MKDIR_P])dnl +dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, +dnl while keeping a definition of mkdir_p for backward compatibility. +dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. +dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of +dnl Makefile.ins that do not define MKDIR_P, so we do our own +dnl adjustment using top_builddir (which is defined more often than +dnl MKDIR_P). +AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl +case $mkdir_p in + [[\\/$]]* | ?:[[\\/]]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac +]) + +# Helper functions for option handling. -*- Autoconf -*- + +# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 3 + +# _AM_MANGLE_OPTION(NAME) +# ----------------------- +AC_DEFUN([_AM_MANGLE_OPTION], +[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) + +# _AM_SET_OPTION(NAME) +# ------------------------------ +# Set option NAME. Presently that only means defining a flag for this option. +AC_DEFUN([_AM_SET_OPTION], +[m4_define(_AM_MANGLE_OPTION([$1]), 1)]) + +# _AM_SET_OPTIONS(OPTIONS) +# ---------------------------------- +# OPTIONS is a space-separated list of Automake options. +AC_DEFUN([_AM_SET_OPTIONS], +[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) + +# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) +# ------------------------------------------- +# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. +AC_DEFUN([_AM_IF_OPTION], +[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) + +# Check to make sure that the build environment is sane. -*- Autoconf -*- + +# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 +# Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 4 + +# AM_SANITY_CHECK +# --------------- +AC_DEFUN([AM_SANITY_CHECK], +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$[*]" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$[*]" != "X $srcdir/configure conftest.file" \ + && test "$[*]" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "$[2]" = conftest.file + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +AC_MSG_RESULT(yes)]) + +# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# AM_PROG_INSTALL_STRIP +# --------------------- +# One issue with vendor `install' (even GNU) is that you can't +# specify the program used to strip binaries. This is especially +# annoying in cross-compiling environments, where the build's strip +# is unlikely to handle the host's binaries. +# Fortunately install-sh will honor a STRIPPROG variable, so we +# always use install-sh in `make install-strip', and initialize +# STRIPPROG with the value of the STRIP variable (set by the user). +AC_DEFUN([AM_PROG_INSTALL_STRIP], +[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +dnl Don't test for $cross_compiling = yes, because it might be `maybe'. +if test "$cross_compiling" != no; then + AC_CHECK_TOOL([STRIP], [strip], :) +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" +AC_SUBST([INSTALL_STRIP_PROGRAM])]) + +# Copyright (C) 2006 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# _AM_SUBST_NOTMAKE(VARIABLE) +# --------------------------- +# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. +# This macro is traced by Automake. +AC_DEFUN([_AM_SUBST_NOTMAKE]) + +# Check how to create a tarball. -*- Autoconf -*- + +# Copyright (C) 2004, 2005 Free Software Foundation, Inc. +# +# This file is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# serial 2 + +# _AM_PROG_TAR(FORMAT) +# -------------------- +# Check how to create a tarball in format FORMAT. +# FORMAT should be one of `v7', `ustar', or `pax'. +# +# Substitute a variable $(am__tar) that is a command +# writing to stdout a FORMAT-tarball containing the directory +# $tardir. +# tardir=directory && $(am__tar) > result.tar +# +# Substitute a variable $(am__untar) that extract such +# a tarball read from stdin. +# $(am__untar) < result.tar +AC_DEFUN([_AM_PROG_TAR], +[# Always define AMTAR for backward compatibility. +AM_MISSING_PROG([AMTAR], [tar]) +m4_if([$1], [v7], + [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], + [m4_case([$1], [ustar],, [pax],, + [m4_fatal([Unknown tar format])]) +AC_MSG_CHECKING([how to create a $1 tar archive]) +# Loop over all known methods to create a tar archive until one works. +_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' +_am_tools=${am_cv_prog_tar_$1-$_am_tools} +# Do not fold the above two line into one, because Tru64 sh and +# Solaris sh will not grok spaces in the rhs of `-'. +for _am_tool in $_am_tools +do + case $_am_tool in + gnutar) + for _am_tar in tar gnutar gtar; + do + AM_RUN_LOG([$_am_tar --version]) && break + done + am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' + am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' + am__untar="$_am_tar -xf -" + ;; + plaintar) + # Must skip GNU tar: if it does not support --format= it doesn't create + # ustar tarball either. + (tar --version) >/dev/null 2>&1 && continue + am__tar='tar chf - "$$tardir"' + am__tar_='tar chf - "$tardir"' + am__untar='tar xf -' + ;; + pax) + am__tar='pax -L -x $1 -w "$$tardir"' + am__tar_='pax -L -x $1 -w "$tardir"' + am__untar='pax -r' + ;; + cpio) + am__tar='find "$$tardir" -print | cpio -o -H $1 -L' + am__tar_='find "$tardir" -print | cpio -o -H $1 -L' + am__untar='cpio -i -H $1 -d' + ;; + none) + am__tar=false + am__tar_=false + am__untar=false + ;; + esac + + # If the value was cached, stop now. We just wanted to have am__tar + # and am__untar set. + test -n "${am_cv_prog_tar_$1}" && break + + # tar/untar a dummy directory, and stop if the command works + rm -rf conftest.dir + mkdir conftest.dir + echo GrepMe > conftest.dir/file + AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) + rm -rf conftest.dir + if test -s conftest.tar; then + AM_RUN_LOG([$am__untar /dev/null 2>&1 && break + fi +done +rm -rf conftest.dir + +AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) +AC_MSG_RESULT([$am_cv_prog_tar_$1])]) +AC_SUBST([am__tar]) +AC_SUBST([am__untar]) +]) # _AM_PROG_TAR + +m4_include([m4/acx_pthread.m4]) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.am new file mode 100644 index 0000000000..a813da528c --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.am @@ -0,0 +1,28 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +noinst_LIBRARIES = libtio.a libdict.a + +AM_CPPFLAGS=-I$(top_srcdir) +AM_CFLAGS = -fPIC + +libtio_a_SOURCES = tio.c tio.h + +libdict_a_SOURCES = dict.c dict.h \ + set.c set.h diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.in new file mode 100644 index 0000000000..bf1f9b41ac --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/Makefile.in @@ -0,0 +1,447 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = common +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libdict_a_AR = $(AR) $(ARFLAGS) +libdict_a_LIBADD = +am_libdict_a_OBJECTS = dict.$(OBJEXT) set.$(OBJEXT) +libdict_a_OBJECTS = $(am_libdict_a_OBJECTS) +libtio_a_AR = $(AR) $(ARFLAGS) +libtio_a_LIBADD = +am_libtio_a_OBJECTS = tio.$(OBJEXT) +libtio_a_OBJECTS = $(am_libtio_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libdict_a_SOURCES) $(libtio_a_SOURCES) +DIST_SOURCES = $(libdict_a_SOURCES) $(libtio_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LIBRARIES = libtio.a libdict.a +AM_CPPFLAGS = -I$(top_srcdir) +AM_CFLAGS = -fPIC +libtio_a_SOURCES = tio.c tio.h +libdict_a_SOURCES = dict.c dict.h \ + set.c set.h + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu common/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu common/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libdict.a: $(libdict_a_OBJECTS) $(libdict_a_DEPENDENCIES) + -rm -f libdict.a + $(libdict_a_AR) libdict.a $(libdict_a_OBJECTS) $(libdict_a_LIBADD) + $(RANLIB) libdict.a +libtio.a: $(libtio_a_OBJECTS) $(libtio_a_DEPENDENCIES) + -rm -f libtio.a + $(libtio_a_AR) libtio.a $(libtio_a_OBJECTS) $(libtio_a_LIBADD) + $(RANLIB) libtio.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/set.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tio.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/dict.c b/contrib/slapd-modules/nssov/nss-ldapd/common/dict.c new file mode 100644 index 0000000000..b2a6ab2416 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/dict.c @@ -0,0 +1,267 @@ +/* + dict.c - dictionary functions + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "dict.h" + +/* + This module uses a hashtable to store it's key to value mappings. The + structure is basically as follows: + + [struct dictionary] + \- holds an array of pointers to a linked list of [struct dict_entry] + \- each entry has a key/value mapping + + The hashmap can be resized when the total number of elements in the hashmap + exceeds a certain load factor. + + All the keys are copied in a separate linked list of buffers where each new + buffer that is allocated is larger than the previous one. The first buffer + in the linked list is always the current one. + + Note that the initial sizes of hashtable and the loadfactor still need to + be tuned to the use in this application. +*/ + +/* an entry stores one key/value pair */ +struct dict_entry { + uint32_t hash; /* used for quick matching and rehashing */ + const char *key; /* a reference to a copy of the key */ + void *value; /* the stored value */ + struct dict_entry *next; +}; + +/* the initial size of the hashtable */ +#define DICT_INITSIZE 7 + +/* load factor at which point to grow hashtable */ +#define DICT_LOADPERCENTAGE 400 + +/* the dictionary is a hashtable */ +struct dictionary { + int size; /* size of the hashtable */ + int num; /* total number of keys stored */ + struct dict_entry **table; /* the hashtable */ + int loop_idx; /* for looping */ + struct dict_entry *loop_entry; /* for looping */ +}; + +/* Simple hash function that computes the hash value of a lower-cased + string. */ +static uint32_t stringhash(const char *str) +{ + uint32_t hash=0; + while (*str!='\0') + hash=3*hash+tolower(*str++); + return hash; +} + +/* Grow the hashtable. */ +static void growhashtable(DICT *dict) +{ + int i; + int newsize; + struct dict_entry **newtable; + struct dict_entry *entry,*tmp; + newsize=dict->size*3+1; + /* allocate room for new hashtable */ + newtable=(struct dict_entry **)malloc(newsize*sizeof(struct dict_entry *)); + if (newtable==NULL) + return; /* allocating memory failed continue to fill the existing table */ + /* clear new table */ + for (i=0;isize;i++) + { + /* go over elements in linked list */ + entry=dict->table[i]; + while (entry!=NULL) + { + tmp=entry; + entry=entry->next; + /* put in new position */ + tmp->next=newtable[tmp->hash%newsize]; + newtable[tmp->hash%newsize]=tmp; + } + } + /* free the old hashtable */ + free(dict->table); + /* put new hashtable in place */ + dict->size=newsize; + dict->table=newtable; +} + +DICT *dict_new(void) +{ + struct dictionary *dict; + int i; + /* allocate room for dictionary information */ + dict=(struct dictionary *)malloc(sizeof(struct dictionary)); + if (dict==NULL) + return NULL; + dict->size=DICT_INITSIZE; + dict->num=0; + /* allocate initial hashtable */ + dict->table=(struct dict_entry **)malloc(DICT_INITSIZE*sizeof(struct dict_entry *)); + if (dict->table==NULL) + { + free(dict); + return NULL; + } + /* clear the hashtable */ + for (i=0;itable[i]=NULL; + /* we're done */ + return dict; +} + +void dict_free(DICT *dict) +{ + struct dict_entry *entry,*etmp; + int i; + /* free hashtable entries */ + for (i=0;isize;i++) + { + entry=dict->table[i]; + while (entry!=NULL) + { + etmp=entry; + entry=entry->next; + free(etmp); + } + } + /* free the hashtable */ + free(dict->table); + /* free dictionary struct itself */ + free(dict); +} + +void *dict_get(DICT *dict,const char *key) +{ + uint32_t hash; + struct dict_entry *entry; + /* calculate the hash */ + hash=stringhash(key); + /* loop over the linked list in the hashtable */ + for (entry=dict->table[hash%dict->size];entry!=NULL;entry=entry->next) + { + if ( (entry->hash==hash) && + (strcasecmp(entry->key,key)==0) ) + return entry->value; + } + /* no matches found */ + return NULL; +} + +int dict_put(DICT *dict,const char *key,void *value) +{ + uint32_t hash; + int l; + char *buf; + int idx; + struct dict_entry *entry,*prev; + /* check if we should grow the hashtable */ + if ( dict->num >= ((dict->size*DICT_LOADPERCENTAGE)/100) ) + growhashtable(dict); + /* calculate the hash and position in the hashtable */ + hash=stringhash(key); + idx=hash%dict->size; + /* check if the entry is already present */ + for (entry=dict->table[idx],prev=NULL; + entry!=NULL; + prev=entry,entry=entry->next) + { + if ( (entry->hash==hash) && + (strcasecmp(entry->key,key)==0) ) + { + /* check if we should unset the entry */ + if (value==NULL) + { + /* remove from linked list */ + if (prev==NULL) + dict->table[idx]=entry->next; + else + prev->next=entry->next; + /* free entry memory and register removal */ + free(entry); + dict->num--; + return 0; + } + /* just set the new value */ + entry->value=value; + return 0; + } + } + /* if entry should be unset we're done */ + if (value==NULL) + return 0; + /* entry is not present, make new entry */ + l=strlen(key)+1; + buf=(char *)malloc(sizeof(struct dict_entry)+l); + if (buf==NULL) + return -1; + entry=(struct dict_entry *)buf; + buf+=sizeof(struct dict_entry); + strcpy(buf,key); + entry->hash=hash; + entry->key=buf; + entry->value=value; + /* insert into hashtable/linked list */ + entry->next=dict->table[idx]; + dict->table[idx]=entry; + /* increment number of stored items */ + dict->num++; + return 0; +} + +void dict_loop_first(DICT *dict) +{ + dict->loop_idx=0; + dict->loop_entry=NULL; +} + +const char *dict_loop_next(DICT *dict,const char **key,void **value) +{ + struct dict_entry *entry; + /* find non-empty entry */ + while ( (dict->loop_idxsize) && (dict->loop_entry==NULL) ) + dict->loop_entry=dict->table[dict->loop_idx++]; + if (dict->loop_entry==NULL) + return NULL; /* no more entries to check */ + /* save current result and go to next entry */ + entry=dict->loop_entry; + dict->loop_entry=entry->next; + /* return results */ + if (key!=NULL) + *key=entry->key; + if (value!=NULL) + *value=entry->value; + return entry->key; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/dict.h b/contrib/slapd-modules/nssov/nss-ldapd/common/dict.h new file mode 100644 index 0000000000..10dd7b2e15 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/dict.h @@ -0,0 +1,75 @@ +/* + dict.h - dictionary functions + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _DICT_H +#define _DICT_H + +#include "compat/attrs.h" + +/* + These functions provide a mapping between a case insensitive + string and a pointer. +*/ +typedef struct dictionary DICT; + +/* Create a new instance of a dictionary. Returns NULL + in case of memory allocation errors. */ +DICT *dict_new(void) + LIKE_MALLOC MUST_USE; + +/* Add a relation in the dictionary. The key is duplicated + and can be reused by the caller. The pointer is just stored. + This function returns non-0 in case of memory allocation + errors. If the key was previously in use the value + is replaced. All key comparisons are case insensitive. */ +int dict_put(DICT *dict,const char *key,void *value); + +/* Look up a key in the dictionary and return the associated + value. NULL is returned if the key is not found in the dictionary. + All key comparisons are case insensitive. */ +void *dict_get(DICT *dict,const char *key) + MUST_USE; + +/* Delete a key-value association from the dictionary. + All key comparisons are case insensitive. */ +/*void dict_del(DICT *dict,const char *key);*/ + +/* Remove the dictionary from memory. All allocated storage + for the dictionary and the keys is freed. + Note that values are not freed. This is the responsibility + of the caller. */ +void dict_free(DICT *dict); + +/* Function for looping over all dictionary keys and values. + This resets the search to the beginning of the dictionary. + This is required before calling dict_loop_next(); */ +void dict_loop_first(DICT *dict); + +/* Function for looping over all dictionary keys and values. + This returns a stored key. NULL is returned when all + keys have been returned. The key and value are + stored in the key and value parameters if they aren't + NULL. */ +const char *dict_loop_next(DICT *dict,const char **key,void **value) + MUST_USE; + +#endif /* _DICT_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/set.c b/contrib/slapd-modules/nssov/nss-ldapd/common/set.c new file mode 100644 index 0000000000..9efc582ca3 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/set.c @@ -0,0 +1,64 @@ +/* + set.c - set functions + This file is part of the nss-ldapd library. + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include + +#include "set.h" +#include "dict.h" + +SET *set_new(void) +{ + return (SET *)dict_new(); +} + +int set_add(SET *set,const char *value) +{ + return dict_put((DICT *)set,value,set); +} + +int set_contains(SET *set,const char *value) +{ + return dict_get((DICT *)set,value)!=NULL; +} + +void set_free(SET *set) +{ + dict_free((DICT *)set); +} + +void set_loop_first(SET *set) +{ + dict_loop_first((DICT *)set); +} + +const char *set_loop_next(SET *set) +{ + const char *value=NULL; + if (dict_loop_next((DICT *)set,&value,NULL)==NULL) + return NULL; + return value; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/set.h b/contrib/slapd-modules/nssov/nss-ldapd/common/set.h new file mode 100644 index 0000000000..f867815f18 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/set.h @@ -0,0 +1,65 @@ +/* + set.h - set functions + This file is part of the nss-ldapd library. + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _SET_H +#define _SET_H + +#include "compat/attrs.h" + +/* + These functions provide a set of string in an unordered + collection. +*/ +typedef struct set SET; + +/* Create a new instance of a set. Returns NULL + in case of memory allocation errors. */ +SET *set_new(void) + LIKE_MALLOC MUST_USE; + +/* Add a string in the set. The value is duplicated + and can be reused by the caller. + This function returns non-0 in case of memory allocation + errors. All value comparisons are case insensitive. */ +int set_add(SET *set,const char *value); + +/* Return non-zero if the value is in the set. + All value comparisons are case insensitive. */ +int set_contains(SET *set,const char *value) + MUST_USE; + +/* Remove the set from memory. All allocated storage + for the set and the values is freed. */ +void set_free(SET *set); + +/* Function for looping over all set values. + This resets the search to the beginning of the set. + This is required before calling set_loop_next(); */ +void set_loop_first(SET *set); + +/* Function for looping over all set values. + This returns a stored value. NULL is returned when all + values have been returned. */ +const char *set_loop_next(SET *set) + MUST_USE; + +#endif /* _SET_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/tio.c b/contrib/slapd-modules/nssov/nss-ldapd/common/tio.c new file mode 100644 index 0000000000..e4b0d30f84 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/tio.c @@ -0,0 +1,488 @@ +/* + tio.c - timed io functions + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "tio.h" + +/* for platforms that don't have ETIME use ETIMEDOUT */ +#ifndef ETIME +#define ETIME ETIMEDOUT +#endif /* ETIME */ + +/* structure that holds a buffer + the buffer contains the data that is between the application and the + file descriptor that is used for efficient transfer + the buffer is built up as follows: + |.....********......| + ^start ^size + ^--len--^ */ +struct tio_buffer { + uint8_t *buffer; + size_t size; /* the size of the buffer */ + size_t maxsize; /* the maximum size of the buffer */ + size_t start; /* the start of the data (before start is unused) */ + size_t len; /* size of the data (from the start) */ +}; + +/* structure that holds all the state for files */ +struct tio_fileinfo { + int fd; + struct tio_buffer readbuffer; + struct tio_buffer writebuffer; + struct timeval readtimeout; + struct timeval writetimeout; + int read_resettable; /* whether the tio_reset() function can be called */ +#ifdef DEBUG_TIO_STATS + /* this is used to collect statistics on the use of the streams + and can be used to tune the buffer sizes */ + size_t byteswritten; + size_t bytesread; +#endif /* DEBUG_TIO_STATS */ +}; + +/* add the second timeval to the first modifing the first */ +static inline void tio_tv_add(struct timeval *tv1, const struct timeval *tv2) +{ + /* BUG: we hope that this does not overflow */ + tv1->tv_usec+=tv2->tv_usec; + if (tv1->tv_usec>1000000) + { + tv1->tv_usec-=1000000; + tv1->tv_sec+=1; + } + tv1->tv_sec+=tv2->tv_sec; +} + +/* build a timeval for comparison to when the operation should be finished */ +static inline void tio_tv_prepare(struct timeval *deadline, const struct timeval *timeout) +{ + if (gettimeofday(deadline,NULL)) + { + /* just blank it in case of errors */ + deadline->tv_sec=0; + deadline->tv_usec=0; + return; + } + tio_tv_add(deadline,timeout); +} + +/* update the timeval to the value that is remaining before deadline + returns non-zero if there is no more time before the deadline */ +static inline int tio_tv_remaining(struct timeval *tv, const struct timeval *deadline) +{ + /* get the current time */ + if (gettimeofday(tv,NULL)) + { + /* 1 second default if gettimeofday() is broken */ + tv->tv_sec=1; + tv->tv_usec=0; + return 0; + } + /* check if we're too late */ + if ( (tv->tv_sec>deadline->tv_sec) || + ( (tv->tv_sec==deadline->tv_sec) && (tv->tv_usec>deadline->tv_usec) ) ) + return -1; + /* update tv */ + tv->tv_sec=deadline->tv_sec-tv->tv_sec; + if (tv->tv_usectv_usec) + tv->tv_usec=deadline->tv_usec-tv->tv_usec; + else + { + tv->tv_sec--; + tv->tv_usec=1000000+deadline->tv_usec-tv->tv_usec; + } + return 0; +} + +/* open a new TFILE based on the file descriptor */ +TFILE *tio_fdopen(int fd,struct timeval *readtimeout,struct timeval *writetimeout, + size_t initreadsize,size_t maxreadsize, + size_t initwritesize,size_t maxwritesize) +{ + struct tio_fileinfo *fp; + fp=(struct tio_fileinfo *)malloc(sizeof(struct tio_fileinfo)); + if (fp==NULL) + return NULL; + fp->fd=fd; + /* initialize read buffer */ + fp->readbuffer.buffer=(uint8_t *)malloc(initreadsize); + if (fp->readbuffer.buffer==NULL) + { + free(fp); + return NULL; + } + fp->readbuffer.size=initreadsize; + fp->readbuffer.maxsize=maxreadsize; + fp->readbuffer.start=0; + fp->readbuffer.len=0; + /* initialize write buffer */ + fp->writebuffer.buffer=(uint8_t *)malloc(initwritesize); + if (fp->writebuffer.buffer==NULL) + { + free(fp->readbuffer.buffer); + free(fp); + return NULL; + } + fp->writebuffer.size=initwritesize; + fp->writebuffer.maxsize=maxwritesize; + fp->writebuffer.start=0; + fp->writebuffer.len=0; + /* initialize other attributes */ + fp->readtimeout.tv_sec=readtimeout->tv_sec; + fp->readtimeout.tv_usec=readtimeout->tv_usec; + fp->writetimeout.tv_sec=writetimeout->tv_sec; + fp->writetimeout.tv_usec=writetimeout->tv_usec; + fp->read_resettable=0; +#ifdef DEBUG_TIO_STATS + fp->byteswritten=0; + fp->bytesread=0; +#endif /* DEBUG_TIO_STATS */ + return fp; +} + +/* wait for any activity on the specified file descriptor using + the specified deadline */ +static int tio_select(int fd, int readfd, const struct timeval *deadline) +{ + struct timeval tv; + fd_set fdset; + int rv; + while (1) + { + /* prepare our filedescriptorset */ + FD_ZERO(&fdset); + FD_SET(fd,&fdset); + /* figure out the time we need to wait */ + if (tio_tv_remaining(&tv,deadline)) + { + errno=ETIME; + return -1; + } + /* wait for activity */ + if (readfd) + rv=select(FD_SETSIZE,&fdset,NULL,NULL,&tv); + else + rv=select(FD_SETSIZE,NULL,&fdset,NULL,&tv); + if (rv>0) + return 0; /* we have activity */ + else if (rv==0) + { + /* no file descriptors were available within the specified time */ + errno=ETIME; + return -1; + } + else if (errno!=EINTR) + /* some error ocurred */ + return -1; + /* we just try again on EINTR */ + } +} + +/* do a read on the file descriptor, returning the data in the buffer + if no data was read in the specified time an error is returned */ +int tio_read(TFILE *fp, void *buf, size_t count) +{ + struct timeval deadline; + int rv; + uint8_t *tmp; + size_t newsz; + /* have a more convenient storage type for the buffer */ + uint8_t *ptr=(uint8_t *)buf; + /* build a time by which we should be finished */ + tio_tv_prepare(&deadline,&(fp->readtimeout)); + /* loop until we have returned all the needed data */ + while (1) + { + /* check if we have enough data in the buffer */ + if (fp->readbuffer.len >= count) + { + if (count>0) + { + if (ptr!=NULL) + memcpy(ptr,fp->readbuffer.buffer+fp->readbuffer.start,count); + /* adjust buffer position */ + fp->readbuffer.start+=count; + fp->readbuffer.len-=count; + } + return 0; + } + /* empty what we have and continue from there */ + if (fp->readbuffer.len>0) + { + if (ptr!=NULL) + { + memcpy(ptr,fp->readbuffer.buffer+fp->readbuffer.start,fp->readbuffer.len); + ptr+=fp->readbuffer.len; + } + count-=fp->readbuffer.len; + fp->readbuffer.start+=fp->readbuffer.len; + fp->readbuffer.len=0; + } + /* after this point until the read fp->readbuffer.len is 0 */ + if (!fp->read_resettable) + { + /* the stream is not resettable, re-use the buffer */ + fp->readbuffer.start=0; + } + else if (fp->readbuffer.start>=(fp->readbuffer.size-4)) + { + /* buffer is running empty, try to grow buffer */ + if (fp->readbuffer.sizereadbuffer.maxsize) + { + newsz=fp->readbuffer.size*2; + if (newsz>fp->readbuffer.maxsize) + newsz=fp->readbuffer.maxsize; + tmp=realloc(fp->readbuffer.buffer,newsz); + if (tmp!=NULL) + { + fp->readbuffer.buffer=tmp; + fp->readbuffer.size=newsz; + } + } + /* if buffer still does not contain enough room, clear resettable */ + if (fp->readbuffer.start>=(fp->readbuffer.size-4)) + { + fp->readbuffer.start=0; + fp->read_resettable=0; + } + } + /* wait until we have input */ + if (tio_select(fp->fd,1,&deadline)) + return -1; + /* read the input in the buffer */ + rv=read(fp->fd,fp->readbuffer.buffer+fp->readbuffer.start,fp->readbuffer.size-fp->readbuffer.start); + /* check for errors */ + if ((rv==0)||((rv<0)&&(errno!=EINTR)&&(errno!=EAGAIN))) + return -1; /* something went wrong with the read */ + /* skip the read part in the buffer */ + fp->readbuffer.len=rv; +#ifdef DEBUG_TIO_STATS + fp->bytesread+=rv; +#endif /* DEBUG_TIO_STATS */ + } +} + +/* Read and discard the specified number of bytes from the stream. */ +int tio_skip(TFILE *fp, size_t count) +{ + return tio_read(fp,NULL,count); +} + +/* the caller has assured us that we can write to the file descriptor + and we give it a shot */ +static int tio_writebuf(TFILE *fp) +{ + int rv; + struct sigaction act,oldact; + /* FIXME: we have a race condition here (setting and restoring the signal mask), this is a critical region that should be locked */ + /* set up sigaction */ + memset(&act,0,sizeof(struct sigaction)); + act.sa_sigaction=NULL; + act.sa_handler=SIG_IGN; + sigemptyset(&act.sa_mask); + act.sa_flags=SA_RESTART; + /* ignore SIGPIPE */ + if (sigaction(SIGPIPE,&act,&oldact)!=0) + return -1; /* error setting signal handler */ + /* write the buffer */ + rv=write(fp->fd,fp->writebuffer.buffer+fp->writebuffer.start,fp->writebuffer.len); + /* restore the old handler for SIGPIPE */ + if (sigaction(SIGPIPE,&oldact,NULL)!=0) + return -1; /* error restoring signal handler */ + /* check for errors */ + if ((rv==0)||((rv<0)&&(errno!=EINTR)&&(errno!=EAGAIN))) + return -1; /* something went wrong with the write */ + /* skip the written part in the buffer */ + if (rv>0) + { + fp->writebuffer.start+=rv; + fp->writebuffer.len-=rv; +#ifdef DEBUG_TIO_STATS + fp->byteswritten+=rv; +#endif /* DEBUG_TIO_STATS */ + /* reset start if len is 0 */ + if (fp->writebuffer.len==0) + fp->writebuffer.start=0; + /* move contents of the buffer to the front if it will save enough room */ + if (fp->writebuffer.start>=(fp->writebuffer.size/4)) + { + memmove(fp->writebuffer.buffer,fp->writebuffer.buffer+fp->writebuffer.start,fp->writebuffer.len); + fp->writebuffer.start=0; + } + } + return 0; +} + +/* write all the data in the buffer to the stream */ +int tio_flush(TFILE *fp) +{ + struct timeval deadline; + /* build a time by which we should be finished */ + tio_tv_prepare(&deadline,&(fp->writetimeout)); + /* loop until we have written our buffer */ + while (fp->writebuffer.len > 0) + { + /* wait until we can write */ + if (tio_select(fp->fd,0,&deadline)) + return -1; + /* write one block */ + if (tio_writebuf(fp)) + return -1; + } + return 0; +} + +/* try a single write of data in the buffer if the file descriptor + will accept data */ +static int tio_flush_nonblock(TFILE *fp) +{ + struct timeval tv; + fd_set fdset; + int rv; + /* prepare our filedescriptorset */ + FD_ZERO(&fdset); + FD_SET(fp->fd,&fdset); + /* set the timeout to 0 to poll */ + tv.tv_sec=0; + tv.tv_usec=0; + /* wait for activity */ + rv=select(FD_SETSIZE,NULL,&fdset,NULL,&tv); + /* check if any file descriptors were ready (timeout) or we were + interrupted */ + if ((rv==0)||((rv<0)&&(errno==EINTR))) + return 0; + /* any other errors? */ + if (rv<0) + return -1; + /* so file descriptor will accept writes */ + return tio_writebuf(fp); +} + +int tio_write(TFILE *fp, const void *buf, size_t count) +{ + size_t fr; + uint8_t *tmp; + size_t newsz; + const uint8_t *ptr=(const uint8_t *)buf; + /* keep filling the buffer until we have bufferred everything */ + while (count>0) + { + /* figure out free size in buffer */ + fr=fp->writebuffer.size-(fp->writebuffer.start+fp->writebuffer.len); + if (count <= fr) + { + /* the data fits in the buffer */ + memcpy(fp->writebuffer.buffer+fp->writebuffer.start+fp->writebuffer.len,ptr,count); + fp->writebuffer.len+=count; + return 0; + } + else if (fr > 0) + { + /* fill the buffer with data that will fit */ + memcpy(fp->writebuffer.buffer+fp->writebuffer.start+fp->writebuffer.len,ptr,fr); + fp->writebuffer.len+=fr; + ptr+=fr; + count-=fr; + } + /* try to flush some of the data that is in the buffer */ + if (tio_flush_nonblock(fp)) + return -1; + /* if we have room now, try again */ + if (fp->writebuffer.size>(fp->writebuffer.start+fp->writebuffer.len)) + continue; + /* try to grow the buffer */ + if (fp->writebuffer.sizewritebuffer.maxsize) + { + newsz=fp->writebuffer.size*2; + if (newsz>fp->writebuffer.maxsize) + newsz=fp->writebuffer.maxsize; + tmp=realloc(fp->writebuffer.buffer,newsz); + if (tmp!=NULL) + { + fp->writebuffer.buffer=tmp; + fp->writebuffer.size=newsz; + continue; /* try again */ + } + } + /* write the buffer to the stream */ + if (tio_flush(fp)) + return -1; + } + return 0; +} + +int tio_close(TFILE *fp) +{ + int retv; + /* write any buffered data */ + retv=tio_flush(fp); +#ifdef DEBUG_TIO_STATS + /* dump statistics to stderr */ + fprintf(stderr,"DEBUG_TIO_STATS READ=%d WRITTEN=%d\n",fp->bytesread,fp->byteswritten); +#endif /* DEBUG_TIO_STATS */ + /* close file descriptor */ + if (close(fp->fd)) + retv=-1; + /* free any allocated buffers */ + free(fp->readbuffer.buffer); + free(fp->writebuffer.buffer); + /* free the tio struct itself */ + free(fp); + /* return the result of the earlier operations */ + return retv; +} + +void tio_mark(TFILE *fp) +{ + /* move any data in the buffer to the start of the buffer */ + if ((fp->readbuffer.start>0)&&(fp->readbuffer.len>0)) + { + memmove(fp->readbuffer.buffer,fp->readbuffer.buffer+fp->readbuffer.start,fp->readbuffer.len); + fp->readbuffer.start=0; + } + /* mark the stream as resettable */ + fp->read_resettable=1; +} + +int tio_reset(TFILE *fp) +{ + /* check if the stream is (still) resettable */ + if (!fp->read_resettable) + return -1; + /* reset the buffer */ + fp->readbuffer.len+=fp->readbuffer.start; + fp->readbuffer.start=0; + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/common/tio.h b/contrib/slapd-modules/nssov/nss-ldapd/common/tio.h new file mode 100644 index 0000000000..d6c8d9c2ab --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/common/tio.h @@ -0,0 +1,81 @@ +/* + tio.h - timed io functions + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +/* + + TODO: Add some documentation here. + + the SIGPIPE signal should be ignored (is ignored in this code) + + This library is not thread safe. You cannot share TFILE objects between + threads and expect to be able to read and write from them in different + threads. All the state is in the TFILE object so calls to this library on + different objects can be done in parallel. + +*/ + +#ifndef _TIO_H +#define _TIO_H + +#include +#include + +#include "compat/attrs.h" + +/* This is a generic file handle used for reading and writing + (something like FILE from stdio.h). */ +typedef struct tio_fileinfo TFILE; + +/* Open a new TFILE based on the file descriptor. The timeout is set for any + operation. The timeout value is copied so may be dereferenced after the + call. */ +TFILE *tio_fdopen(int fd,struct timeval *readtimeout,struct timeval *writetimeout, + size_t initreadsize,size_t maxreadsize, + size_t initwritesize,size_t maxwritesize) + LIKE_MALLOC MUST_USE; + +/* Read the specified number of bytes from the stream. */ +int tio_read(TFILE *fp,void *buf,size_t count); + +/* Read and discard the specified number of bytes from the stream. */ +int tio_skip(TFILE *fp,size_t count); + +/* Write the specified buffer to the stream. */ +int tio_write(TFILE *fp,const void *buf,size_t count); + +/* Write out all buffered data to the stream. */ +int tio_flush(TFILE *fp); + +/* Flush the streams and closes the underlying file descriptor. */ +int tio_close(TFILE *fp); + +/* Store the current position in the stream so that we can jump back to it + with the tio_reset() function. */ +void tio_mark(TFILE *fp); + +/* Rewinds the stream to the point set by tio_mark(). Note that this only + resets the read stream and not the write stream. This function returns + whether the reset was successful (this function may fail if the buffers + were full). */ +int tio_reset(TFILE *fp); + +#endif /* _TIO_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.am new file mode 100644 index 0000000000..601b65b7d7 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.am @@ -0,0 +1,31 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +noinst_LIBRARIES = libcompat.a + +AM_CPPFLAGS=-I$(top_srcdir) +AM_CFLAGS = -fPIC + +EXTRA_DIST = getopt_long.c getopt_long.h \ + daemon.c daemon.h \ + pagectrl.c pagectrl.h \ + ether.c ether.h + +libcompat_a_SOURCES = getpeercred.c getpeercred.h +libcompat_a_LIBADD = @LIBOBJS@ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.in new file mode 100644 index 0000000000..901663bb58 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/Makefile.in @@ -0,0 +1,445 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = compat +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in daemon.c \ + ether.c getopt_long.c pagectrl.c +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +LIBRARIES = $(noinst_LIBRARIES) +AR = ar +ARFLAGS = cru +libcompat_a_AR = $(AR) $(ARFLAGS) +libcompat_a_DEPENDENCIES = @LIBOBJS@ +am_libcompat_a_OBJECTS = getpeercred.$(OBJEXT) +libcompat_a_OBJECTS = $(am_libcompat_a_OBJECTS) +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(libcompat_a_SOURCES) +DIST_SOURCES = $(libcompat_a_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +noinst_LIBRARIES = libcompat.a +AM_CPPFLAGS = -I$(top_srcdir) +AM_CFLAGS = -fPIC +EXTRA_DIST = getopt_long.c getopt_long.h \ + daemon.c daemon.h \ + pagectrl.c pagectrl.h \ + ether.c ether.h + +libcompat_a_SOURCES = getpeercred.c getpeercred.h +libcompat_a_LIBADD = @LIBOBJS@ +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu compat/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu compat/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstLIBRARIES: + -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES) +libcompat.a: $(libcompat_a_OBJECTS) $(libcompat_a_DEPENDENCIES) + -rm -f libcompat.a + $(libcompat_a_AR) libcompat.a $(libcompat_a_OBJECTS) $(libcompat_a_LIBADD) + $(RANLIB) libcompat.a + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/daemon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/ether.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/getopt_long.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@$(DEPDIR)/pagectrl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getpeercred.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(LIBRARIES) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf $(DEPDIR) ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstLIBRARIES ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am install-info \ + install-info-am install-man install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/attrs.h b/contrib/slapd-modules/nssov/nss-ldapd/compat/attrs.h new file mode 100644 index 0000000000..492f45c2ea --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/attrs.h @@ -0,0 +1,91 @@ +/* + attrs.h - wrapper macros for the gcc __attribute__(()) directive + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _COMPAT_ATTRS_H +#define _COMPAT_ATTRS_H 1 + +/* macro for testing the version of GCC */ +#define GCC_VERSION(major,minor) \ + ((__GNUC__ > (major)) || (__GNUC__ == (major) && __GNUC_MINOR__ >= (minor))) + +/* These are macros to use some gcc-specific flags in case the're available + and otherwise define them to empty strings. This allows us to give + the compiler some extra information. + See http://gcc.gnu.org/onlinedocs/gcc/Attribute-Syntax.html + for a list of attributes supported by gcc */ + +/* this is used to flag function parameters that are not used in the function + body. */ +#if GCC_VERSION(3,0) +#define UNUSED(x) x __attribute__((__unused__)) +#else +#define UNUSED(x) x +#endif + +/* this is used to add extra format checking to the function calls as if this + was a printf()-like function */ +#if GCC_VERSION(3,0) +#define LIKE_PRINTF(format_idx,arg_idx) \ + __attribute__((__format__(__printf__,format_idx,arg_idx))) +#else +#define LIKE_PRINTF(format_idx,arg_idx) /* no attribute */ +#endif + +/* indicates that the function is "pure": it's result is purely based on + the parameters and has no side effects or used static data */ +#if GCC_VERSION(3,0) +#define PURE __attribute__((__pure__)) +#else +#define PURE /* no attribute */ +#endif + +/* the function returns a new data structure that has been freshly + allocated */ +#if GCC_VERSION(3,0) +#define LIKE_MALLOC __attribute__((__malloc__)) +#else +#define LIKE_MALLOC /* no attribute */ +#endif + +/* the function's return value should be used by the caller */ +#if GCC_VERSION(3,4) +#define MUST_USE __attribute__((__warn_unused_result__)) +#else +#define MUST_USE /* no attribute */ +#endif + +/* the function's return value should be used by the caller */ +#if GCC_VERSION(2,5) +#define NORETURN __attribute__((__noreturn__)) +#else +#define NORETURN /* no attribute */ +#endif + +/* define __STRING if it's not yet defined */ +#ifndef __STRING +#ifdef __STDC__ +#define __STRING(x) #x +#else /* __STDC__ */ +#define __STRING(x) "x" +#endif /* not __STDC__ */ +#endif /* not __STRING */ + +#endif /* not _COMPAT_ATTRS_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.c b/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.c new file mode 100644 index 0000000000..cd8e0f3413 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.c @@ -0,0 +1,71 @@ +/* + daemon.c - implementation of daemon() for systems that lack it + + Copyright (C) 2002, 2003, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "daemon.h" + +#include +#include +#include +#include + +int daemon(int nochdir,int noclose) +{ + /* change directory */ + if (!nochdir) + if (chdir("/")!=0) + return -1; + /* fork() and exit() to detach from the parent process */ + switch (fork()) + { + case 0: /* we are the child */ + break; + case -1: /* we are the parent, but have an error */ + return -1; + default: /* we are the parent and we're done*/ + _exit(0); + } + /* become process leader */ + if (setsid()<0) + { + return -1; + } + /* fork again so we cannot allocate a pty */ + switch (fork()) + { + case 0: /* we are the child */ + break; + case -1: /* we are the parent, but have an error */ + return -1; + default: /* we are the parent and we're done*/ + _exit(0); + } + /* close stdin, stdout and stderr and reconnect to /dev/null */ + if (!noclose) + { + close(0); /* stdin */ + close(1); /* stdout */ + close(2); /* stderr */ + open("/dev/null",O_RDWR); /* stdin, fd=0 */ + dup(0); /* stdout, fd=1 */ + dup(0); /* stderr, fd=2 */ + } + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.h b/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.h new file mode 100644 index 0000000000..4d0f33a569 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/daemon.h @@ -0,0 +1,31 @@ +/* + daemon.h - definition of daemon() for systems that lack it + + Copyright (C) 2002, 2003, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _DAEMON_H +#define _DAEMON_H 1 + +#include + +/* deamonize process, optionally chdir to / and optionally close stdin, + strdout and stderr and redirect them to /dev/null */ +int daemon(int nochdir,int noclose); + +#endif /* not _DAEMON_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.c b/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.c new file mode 100644 index 0000000000..1374f97e12 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.c @@ -0,0 +1,52 @@ +/* + ether.c - useful ethernet functions for systems lacking those + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include + +#include "ether.h" + +/* these functions are not really reentrant */ + +#ifndef HAVE_ETHER_NTOA_R +char *ether_ntoa_r(const struct ether_addr *addr,char *buf) +{ + char *tmp; + tmp=ether_ntoa(addr); + if (tmp==NULL) + return NULL; + strcpy(buf,tmp); + return buf; +} +#endif /* not HAVE_ETHER_NTOA_R */ + +#ifndef HAVE_ETHER_ATON_R +struct ether_addr *ether_aton_r(const char *asc,struct ether_addr *addr) +{ + struct ether_addr *tmp; + tmp=ether_aton(asc); + if (tmp==NULL) + return NULL; + memcpy(addr,tmp,sizeof(struct ether_addr)); + return addr; +} +#endif /* not HAVE_ETHER_ATON_R */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.h b/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.h new file mode 100644 index 0000000000..fc1525e7ad --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/ether.h @@ -0,0 +1,49 @@ +/* + ether.h - ethernet definitions for systems lacking those + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _COMPAT_ETHER_H +#define _COMPAT_ETHER_H 1 + +#include +#include +#include +#include +#include +#ifdef HAVE_NETINET_ETHER_H +#include +#endif + +#ifndef HAVE_STRUCT_ETHER_ADDR +struct ether_addr { + uint8_t ether_addr_octet[6]; +}; +#endif /* not HAVE_STRUCT_ETHER_ADDR */ + +#ifndef HAVE_ETHER_NTOA_R +char *ether_ntoa_r(const struct ether_addr *addr,char *buf); +#endif /* not HAVE_ETHER_NTOA_R */ + +#ifndef HAVE_ETHER_ATON_R +struct ether_addr *ether_aton_r(const char *asc,struct ether_addr *addr); +#endif /* not HAVE_ETHER_ATON_R */ + +#endif /* not _COMPAT_ETHER_H */ + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/getopt_long.c b/contrib/slapd-modules/nssov/nss-ldapd/compat/getopt_long.c new file mode 100644 index 0000000000..a276dd538b --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/getopt_long.c @@ -0,0 +1,92 @@ +/* + getopt_long.c - implementation of getopt_long() for systems that lack it + + Copyright (C) 2001, 2002, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include +#include +#include + +#include "getopt_long.h" + +/* this is a (poor) getopt_long() replacement for systems that don't have it + (getopt_long() is generaly a GNU extention) + this implementation is by no meens flawless, especialy the optional arguments + to options and options following filenames is not quite right, allso + minimal error checking is provided + */ +int getopt_long(int argc,char * const argv[], + const char *optstring, + const struct option *longopts,int *longindex) +{ + int i; /* for looping through options */ + int l; /* for length */ + + /* first check if there realy is a -- option */ + if ( (optind>0)&&(optind +#include +#include +#include +#ifdef HAVE_SYS_UCRED_H +#include +#endif /* HAVE SYS_UCRED_H */ +#include +#ifdef HAVE_UCRED_H +#include +#endif /* HAVE_UCRED_H */ + +#include "getpeercred.h" + +/* Note: most of this code is untested, except for the first + implementation (it may even fail to compile) */ + +int getpeercred(int sock,uid_t *uid,gid_t *gid,pid_t *pid) +{ +#if defined(SO_PEERCRED) + socklen_t l; + struct ucred cred; + /* initialize client information (in case getsockopt() breaks) */ + cred.pid=(pid_t)0; + cred.uid=(uid_t)-1; + cred.gid=(gid_t)-1; + /* look up process information from peer */ + l=(socklen_t)sizeof(struct ucred); + if (getsockopt(sock,SOL_SOCKET,SO_PEERCRED,&cred,&l) < 0) + return -1; /* errno already set */ + /* return the data */ + if (uid!=NULL) *uid=cred.uid; + if (gid!=NULL) *gid=cred.gid; + if (pid!=NULL) *pid=cred.pid; + return 0; +#elif defined(LOCAL_PEERCRED) + socklen_t l; + struct xucred cred; + /* look up process information from peer */ + l=(socklen_t)sizeof(struct xucred); + if (getsockopt(sock,0,LOCAL_PEERCRED,&cred,&l) < 0) + return -1; /* errno already set */ + if (cred.cr_version!=XUCRED_VERSION) + { + errno=EINVAL; + return -1; + } + /* return the data */ + if (uid!=NULL) *uid=cred.uid; + if (gid!=NULL) *gid=cred.gid; + if (pid!=NULL) *pid=(pid_t)-1; + return 0; +#elif defined(HAVE_GETPEERUCRED) + ucred_t *cred=NULL; + if (getpeerucred(client,&cred)) + return -1; + /* save the data */ + if (uid!=NULL) *uid=ucred_geteuid(&cred); + if (gid!=NULL) *gid=ucred_getegid(&cred); + if (pid!=NULL) *pid=ucred_getpid(&cred); + /* free cred and return */ + ucred_free(&ucred); + return 0; +#elif defined(HAVE_GETPEEREID) + uid_t tuid; + gid_t tgid; + if (uid==NULL) uid=&tuid; + if (gid==NULL) gid=&tguid; + if (getpeereid(sock,uid,gid)) + return -1; + /* return the data */ + if (uid!=NULL) *uid=cred.uid; + if (gid!=NULL) *gid=cred.gid; + if (pid!=NULL) *pid=-1; /* we return a -1 pid because we have no usable pid */ + return 0; +#else + /* nothing found that is supported */ + errno=ENOSYS; + return -1; +#endif +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/getpeercred.h b/contrib/slapd-modules/nssov/nss-ldapd/compat/getpeercred.h new file mode 100644 index 0000000000..2db6b5d443 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/getpeercred.h @@ -0,0 +1,35 @@ +/* + getpeercred.h - function for determining information about the + other end of a unix socket + This file is part of the nss-ldapd library. + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _COMPAT_GETPEERCRED_H +#define _COMPAT_GETPEERCRED_H 1 + +/* This function tries to determine the (effective) user id, group id + and process id of the other end of the specified socket. + Any of the uid, gid and pid paramaters may be NULL to not update + that information. + On success, zero is returned. On error, -1 is returned, and errno + is set appropriately. */ +int getpeercred(int sock,uid_t *uid,gid_t *gid,pid_t *pid); + +#endif /* not _COMPAT_GETPEERCRED_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.c b/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.c new file mode 100644 index 0000000000..9dff696395 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.c @@ -0,0 +1,217 @@ +/* + pagectrl.c - provide a replacement ldap_create_page_control() function. + This file was part of the nss_ldap library which has been + forked into the nss-ldapd library. + + Copyright (C) 2002 Max Caines + This software is not subject to any license of the University + of Wolverhampton. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "pagectrl.h" + +#ifndef LDAP_CONTROL_PAGE_OID +#define LDAP_CONTROL_PAGE_OID "1.2.840.113556.1.4.319" +#endif + +#ifndef HAVE_LDAP_CREATE_PAGE_CONTROL +/*--- + ldap_create_page_control + + Create and encode the Paged Results control. + + ld (IN) An LDAP session handle, as obtained from a call to + ldap_init(). + + pagesize (IN) The number of entries to return in each page + + cookiep (IN) Pointer to a berVal structure that the server uses to + determine the current location in the + result set (opaque). Set to NULL the + first time. + + iscritical (IN) Is this control critical to the search? + + ctrlp (OUT) A result parameter that will be assigned the address + of an LDAPControl structure that contains the + PagedResult control created by this function. + The memory occupied by the LDAPControl structure + SHOULD be freed when it is no longer in use by + calling ldap_control_free(). + + + Ber encoding + + PageResult ::= SEQUENCE { + pageSize INTEGER + cookie OCTET STRING } + + + Note: The first time the Page control is created, the cookie + should be set to a zero-length string. The cookie obtained + from calling ldap_parse_page_control() should be used as + the cookie in the next ldap_create_page_control call. + + ---*/ + +int +ldap_create_page_control (LDAP * ld, + unsigned long pagesize, + struct berval *cookiep, + int iscritical, LDAPControl ** ctrlp) +{ + ber_tag_t tag; + BerElement *ber; + BerElement *ldap_alloc_ber_with_options (LDAP * ld); + int rc; + + if ((ld == NULL) || (ctrlp == NULL)) + { + return (LDAP_PARAM_ERROR); + } + + if ((ber = ldap_alloc_ber_with_options (ld)) == NULL) + { + return (LDAP_NO_MEMORY); + } + + tag = ber_printf (ber, "{i", pagesize); + if (tag == LBER_ERROR) + goto exit; + + if (cookiep == NULL) + tag = ber_printf (ber, "o", "", 0); + else + tag = ber_printf (ber, "O", cookiep); + if (tag == LBER_ERROR) + goto exit; + + tag = ber_printf (ber, /*{ */ "N}"); + if (tag == LBER_ERROR) + goto exit; + + rc = ldap_create_control (LDAP_CONTROL_PAGE_OID, ber, iscritical, ctrlp); + + ber_free (ber, 1); + return (rc); + +exit: + ber_free (ber, 1); + return (LDAP_ENCODING_ERROR); +} +#endif /* not HAVE_LDAP_CREATE_PAGE_CONTROL */ + +#ifndef HAVE_LDAP_PARSE_PAGE_CONTROL +/*--- + ldap_parse_page_control + + Decode the Virtual List View control return information. + + ld (IN) An LDAP session handle. + + ctrls (IN) The address of a NULL-terminated array of + LDAPControl structures, typically obtained + by a call to ldap_parse_result(). + + list_countp (OUT) This result parameter is filled in with the number + of entries returned in this page + + cookiep (OUT) This result parameter is filled in with the address + of a struct berval that contains the server- + generated cookie. + The returned cookie SHOULD be used in the next call + to create a Page sort control. The struct berval + returned SHOULD be disposed of by calling ber_bvfree() + when it is no longer needed. + +---*/ +int +ldap_parse_page_control (LDAP * ld, + LDAPControl ** ctrls, + unsigned long *list_countp, struct berval **cookiep) +{ + BerElement *ber; + LDAPControl *pControl; + int i; + unsigned long count; + ber_tag_t tag; + + if (cookiep) + { + *cookiep = NULL; /* Make sure we return a NULL if error occurs. */ + } + + if (ld == NULL) + { + return (LDAP_PARAM_ERROR); + } + + if (ctrls == NULL) + { + return (LDAP_CONTROL_NOT_FOUND); + } + + /* Search the list of control responses for a Page control. */ + for (i = 0; ctrls[i]; i++) + { + pControl = ctrls[i]; + if (!strcmp (LDAP_CONTROL_PAGE_OID, pControl->ldctl_oid)) + goto foundPageControl; + } + + /* No page control was found. */ + return (LDAP_CONTROL_NOT_FOUND); + +foundPageControl: + /* Create a BerElement from the berval returned in the control. */ + ber = ber_init (&pControl->ldctl_value); + + if (ber == NULL) + { + return (LDAP_NO_MEMORY); + } + + /* Extract the data returned in the control. */ + tag = ber_scanf (ber, "{iO" /*} */ , &count, cookiep); + + if (tag == LBER_ERROR) + { + ber_free (ber, 1); + return (LDAP_DECODING_ERROR); + } + + ber_free (ber, 1); + + /* Return data to the caller for items that were requested. */ + if (list_countp) + { + *list_countp = count; + } + + return (LDAP_SUCCESS); +} +#endif /* not HAVE_LDAP_PARSE_PAGE_CONTROL */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.h b/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.h new file mode 100644 index 0000000000..cd64b778e4 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compat/pagectrl.h @@ -0,0 +1,45 @@ +/* + pagectrl.h - provide a replacement ldap_create_page_control() function. + This file was part of the nss_ldap library which has been + forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _LDAP_NSS_LDAP_PAGECTRL_H +#define _LDAP_NSS_LDAP_PAGECTRL_H + +#ifndef HAVE_LDAP_CREATE_PAGE_CONTROL +int +ldap_create_page_control( LDAP *ld, + unsigned long pagesize, + struct berval *cookiep, + int iscritical, + LDAPControl **ctrlp ); +#endif /* not HAVE_LDAP_CREATE_PAGE_CONTROL */ + +#ifndef HAVE_LDAP_PARSE_PAGE_CONTROL +int +ldap_parse_page_control( + LDAP *ld, + LDAPControl **ctrls, + unsigned long *list_countp, + struct berval **cookiep ); +#endif /* not HAVE_LDAP_PARSE_PAGE_CONTROL */ + +#endif /* _LDAP_NSS_LDAP_UTIL_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/compile b/contrib/slapd-modules/nssov/nss-ldapd/compile new file mode 100755 index 0000000000..1b1d232169 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/compile @@ -0,0 +1,142 @@ +#! /bin/sh +# Wrapper for compilers which do not understand `-c -o'. + +scriptversion=2005-05-14.22 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand `-c -o'. +Remove `-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file `INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; +esac + +ofile= +cfile= +eat= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as `compile cc -o foo foo.c'. + # So we strip `-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no `-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # `.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` + +# Create the lock directory. +# Note: use `[/.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/config.guess b/contrib/slapd-modules/nssov/nss-ldapd/config.guess new file mode 100755 index 0000000000..f32079abda --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/config.guess @@ -0,0 +1,1526 @@ +#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-23' + +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Originally written by Per Bothner . +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit build system type. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] + +Output the configuration name of the system \`$me' is run on. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.guess ($timestamp) + +Originally written by Per Bothner. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" >&2 + exit 1 ;; + * ) + break ;; + esac +done + +if test $# != 0; then + echo "$me: too many arguments$help" >&2 + exit 1 +fi + +trap 'exit 1' 1 2 15 + +# CC_FOR_BUILD -- compiler used by this script. Note that the use of a +# compiler to aid in system detection is discouraged as it requires +# temporary files to be created and, as you can see below, it is a +# headache to deal with in a portable fashion. + +# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still +# use `HOST_CC' if defined, but it is deprecated. + +# Portable tmp directory creation inspired by the Autoconf team. + +set_cc_for_build=' +trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +: ${TMPDIR=/tmp} ; + { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || + { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || + { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || + { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; +dummy=$tmp/dummy ; +tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; +case $CC_FOR_BUILD,$HOST_CC,$CC in + ,,) echo "int x;" > $dummy.c ; + for c in cc gcc c89 c99 ; do + if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then + CC_FOR_BUILD="$c"; break ; + fi ; + done ; + if test x"$CC_FOR_BUILD" = x ; then + CC_FOR_BUILD=no_compiler_found ; + fi + ;; + ,,*) CC_FOR_BUILD=$CC ;; + ,*,*) CC_FOR_BUILD=$HOST_CC ;; +esac ; set_cc_for_build= ;' + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 1994-08-24) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # NetBSD (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # + # Note: NetBSD doesn't particularly care about the vendor + # portion of the name. We always set it to "unknown". + sysctl="sysctl -n hw.machine_arch" + UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ + /usr/sbin/$sysctl 2>/dev/null || echo unknown)` + case "${UNAME_MACHINE_ARCH}" in + armeb) machine=armeb-unknown ;; + arm*) machine=arm-unknown ;; + sh3el) machine=shl-unknown ;; + sh3eb) machine=sh-unknown ;; + sh5el) machine=sh5le-unknown ;; + *) machine=${UNAME_MACHINE_ARCH}-unknown ;; + esac + # The Operating System including object format, if it has switched + # to ELF recently, or will in the future. + case "${UNAME_MACHINE_ARCH}" in + arm*|i386|m68k|ns32k|sh3*|sparc|vax) + eval $set_cc_for_build + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + ;; + *) + os=netbsd + ;; + esac + # The OS release + # Debian GNU/NetBSD machines have a different userland, and + # thus, need a distinct triplet. However, they do not need + # kernel version information, so it can be replaced with a + # suitable tag, in the style of linux-gnu. + case "${UNAME_VERSION}" in + Debian*) + release='-gnu' + ;; + *) + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + ;; + esac + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit ;; + *:OpenBSD:*:*) + UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` + echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} + exit ;; + *:ekkoBSD:*:*) + echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} + exit ;; + *:SolidBSD:*:*) + echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} + exit ;; + macppc:MirBSD:*:*) + echo powerpc-unknown-mirbsd${UNAME_RELEASE} + exit ;; + *:MirBSD:*:*) + echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} + exit ;; + alpha:OSF1:*:*) + case $UNAME_RELEASE in + *4.0) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + ;; + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + ;; + esac + # According to Compaq, /usr/sbin/psrinfo has been available on + # OSF/1 and Tru64 systems produced since 1995. I hope that + # covers most systems running today. This code pipes the CPU + # types through head -n 1, so we only detect the type of CPU 0. + ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` + case "$ALPHA_CPU_TYPE" in + "EV4 (21064)") + UNAME_MACHINE="alpha" ;; + "EV4.5 (21064)") + UNAME_MACHINE="alpha" ;; + "LCA4 (21066/21068)") + UNAME_MACHINE="alpha" ;; + "EV5 (21164)") + UNAME_MACHINE="alphaev5" ;; + "EV5.6 (21164A)") + UNAME_MACHINE="alphaev56" ;; + "EV5.6 (21164PC)") + UNAME_MACHINE="alphapca56" ;; + "EV5.7 (21164PC)") + UNAME_MACHINE="alphapca57" ;; + "EV6 (21264)") + UNAME_MACHINE="alphaev6" ;; + "EV6.7 (21264A)") + UNAME_MACHINE="alphaev67" ;; + "EV6.8CB (21264C)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8AL (21264B)") + UNAME_MACHINE="alphaev68" ;; + "EV6.8CX (21264D)") + UNAME_MACHINE="alphaev68" ;; + "EV6.9A (21264/EV69A)") + UNAME_MACHINE="alphaev69" ;; + "EV7 (21364)") + UNAME_MACHINE="alphaev7" ;; + "EV7.9 (21364A)") + UNAME_MACHINE="alphaev79" ;; + esac + # A Pn.n version is a patched version. + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-unknown-sysv4 + exit ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit ;; + *:[Mm]orph[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-morphos + exit ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit ;; + *:z/VM:*:*) + echo s390-ibm-zvmoe + exit ;; + *:OS400:*:*) + echo powerpc-ibm-os400 + exit ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit ;; + arm:riscos:*:*|arm:RISCOS:*:*) + echo arm-unknown-riscos + exit ;; + SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit ;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit ;; + DRS?6000:unix:4.0:6*) + echo sparc-icl-nx6 + exit ;; + DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) + case `/usr/bin/uname -p` in + sparc) echo sparc-icl-nx7; exit ;; + esac ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; + m68k:machten:*:*) + echo m68k-apple-machten${UNAME_RELEASE} + exit ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && + dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && + SYSTEM_NAME=`$dummy $dummyarg` && + { echo "$SYSTEM_NAME"; exit; } + echo mips-mips-riscos${UNAME_RELEASE} + exit ;; + Motorola:PowerMAX_OS:*:*) + echo powerpc-motorola-powermax + exit ;; + Motorola:*:4.3:PL8-*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) + echo powerpc-harris-powermax + exit ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i*86:AIX:*:*) + echo i386-ibm-aix + exit ;; + ia64:AIX:*:*) + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} + exit ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` + then + echo "$SYSTEM_NAME" + else + echo rs6000-ibm-aix3.2.5 + fi + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit ;; + *:AIX:*:[456]) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit ;; + 9000/[34678]??:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + if [ -x /usr/bin/getconf ]; then + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 + 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 + 532) # CPU_PA_RISC2_0 + case "${sc_kernel_bits}" in + 32) HP_ARCH="hppa2.0n" ;; + 64) HP_ARCH="hppa2.0w" ;; + '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 + esac ;; + esac + fi + if [ "${HP_ARCH}" = "" ]; then + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include + #include + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` + test -z "$HP_ARCH" && HP_ARCH=hppa + fi ;; + esac + if [ ${HP_ARCH} = "hppa2.0w" ] + then + eval $set_cc_for_build + + # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating + # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler + # generating 64-bit code. GNU and HP use different nomenclature: + # + # $ CC_FOR_BUILD=cc ./config.guess + # => hppa2.0w-hp-hpux11.23 + # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess + # => hppa64-hp-hpux11.23 + + if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | + grep __LP64__ >/dev/null + then + HP_ARCH="hppa2.0w" + else + HP_ARCH="hppa64" + fi + fi + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit ;; + ia64:HP-UX:*:*) + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ia64-hp-hpux${HPUX_REV} + exit ;; + 3050*:HI-UX:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + echo unknown-hitachi-hiuxwe2 + exit ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit ;; + *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit ;; + i*86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ + -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*T3E:*:*:*) + echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + *:UNICOS/mp:*:*) + echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit ;; + F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) + FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + 5000:UNIX_System_V:4.*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; + i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit ;; + *:FreeBSD:*:*) + case ${UNAME_MACHINE} in + pc98) + echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + amd64) + echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + *) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; + esac + exit ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit ;; + *:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit ;; + i*:windows32*:*) + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 + exit ;; + i*:PW*:*) + echo ${UNAME_MACHINE}-pc-pw32 + exit ;; + *:Interix*:[3456]*) + case ${UNAME_MACHINE} in + x86) + echo i586-pc-interix${UNAME_RELEASE} + exit ;; + EM64T | authenticamd) + echo x86_64-unknown-interix${UNAME_RELEASE} + exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; + esac ;; + [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) + echo i${UNAME_MACHINE}-pc-mks + exit ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i586-pc-interix + exit ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit ;; + amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) + echo x86_64-unknown-cygwin + exit ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; + *:GNU:*:*) + # the GNU system + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit ;; + *:GNU/*:*:*) + # other systems with GNU libc and userland + echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu + exit ;; + i*86:Minix:*:*) + echo ${UNAME_MACHINE}-pc-minix + exit ;; + arm*:Linux:*:*) + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi + exit ;; + avr32*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + cris:Linux:*:*) + echo cris-axis-linux-gnu + exit ;; + crisv32:Linux:*:*) + echo crisv32-axis-linux-gnu + exit ;; + frv:Linux:*:*) + echo frv-unknown-linux-gnu + exit ;; + ia64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m32r*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + m68*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + mips:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips + #undef mipsel + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mipsel + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + mips64:Linux:*:*) + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #undef CPU + #undef mips64 + #undef mips64el + #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) + CPU=mips64el + #else + #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) + CPU=mips64 + #else + CPU= + #endif + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^CPU/{ + s: ::g + p + }'`" + test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } + ;; + or32:Linux:*:*) + echo or32-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu + exit ;; + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; + parisc:Linux:*:* | hppa:Linux:*:*) + # Look for CPU level + case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in + PA7*) echo hppa1.1-unknown-linux-gnu ;; + PA8*) echo hppa2.0-unknown-linux-gnu ;; + *) echo hppa-unknown-linux-gnu ;; + esac + exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; + s390:Linux:*:* | s390x:Linux:*:*) + echo ${UNAME_MACHINE}-ibm-linux + exit ;; + sh64*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sh*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + sparc:Linux:*:* | sparc64:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + vax:Linux:*:*) + echo ${UNAME_MACHINE}-dec-linux-gnu + exit ;; + x86_64:Linux:*:*) + echo x86_64-unknown-linux-gnu + exit ;; + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + # Set LC_ALL=C to ensure ld outputs messages in English. + ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ + | sed -ne '/supported targets:/!d + s/[ ][ ]*/ /g + s/.*supported targets: *// + s/ .*// + p'` + case "$ld_supported_targets" in + elf32-i386) + TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" + ;; + a.out-i386-linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit ;; + coff-i386) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit ;; + "") + # Either a pre-BFD a.out linker (linux-gnuoldld) or + # one that does not give us useful --help. + echo "${UNAME_MACHINE}-pc-linux-gnuoldld" + exit ;; + esac + # Determine whether the default compiler is a.out or elf + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #include + #ifdef __ELF__ + # ifdef __GLIBC__ + # if __GLIBC__ >= 2 + LIBC=gnu + # else + LIBC=gnulibc1 + # endif + # else + LIBC=gnulibc1 + # endif + #else + #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) + LIBC=gnu + #else + LIBC=gnuaout + #endif + #endif + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' + /^LIBC/{ + s: ::g + p + }'`" + test x"${LIBC}" != x && { + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" + exit + } + test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } + ;; + i*86:DYNIX/ptx:4*:*) + # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. + # earlier versions are messed up and put the nodename in both + # sysname and nodename. + echo i386-sequent-sysv4 + exit ;; + i*86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit ;; + i*86:OS/2:*:*) + # If we were able to find `uname', then EMX Unix compatibility + # is probably installed. + echo ${UNAME_MACHINE}-pc-os2-emx + exit ;; + i*86:XTS-300:*:STOP) + echo ${UNAME_MACHINE}-unknown-stop + exit ;; + i*86:atheos:*:*) + echo ${UNAME_MACHINE}-unknown-atheos + exit ;; + i*86:syllable:*:*) + echo ${UNAME_MACHINE}-pc-syllable + exit ;; + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit ;; + i*86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit ;; + i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit ;; + i*86:*:5:[678]*) + # UnixWare 7.x, OpenUNIX and OpenServer 6. + case `/bin/uname -X | grep "^Machine"` in + *486*) UNAME_MACHINE=i486 ;; + *Pentium) UNAME_MACHINE=i586 ;; + *Pent*|*Celeron) UNAME_MACHINE=i686 ;; + esac + echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} + exit ;; + i*86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` + (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit ;; + mc68k:UNIX:SYSTEM5:3.51m) + echo m68k-convergent-sysv + exit ;; + M680?0:D-NIX:5.3:*) + echo m68k-diab-dnix + exit ;; + M68*:*:R3V[5678]*:*) + test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; + 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit ;; + rs6000:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit ;; + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + echo powerpc-unknown-lynxos${UNAME_RELEASE} + exit ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit ;; + PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says + echo i586-unisys-sysv4 + exit ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes . + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit ;; + i*86:VOS:*:*) + # From Paul.Green@stratus.com. + echo ${UNAME_MACHINE}-stratus-vos + exit ;; + *:VOS:*:*) + # From Paul.Green@stratus.com. + echo hppa1.1-stratus-vos + exit ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit ;; + news*:NEWS-OS:6*:*) + echo mips-sony-newsos6 + exit ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit ;; + SX-6:SUPER-UX:*:*) + echo sx6-nec-superux${UNAME_RELEASE} + exit ;; + SX-7:SUPER-UX:*:*) + echo sx7-nec-superux${UNAME_RELEASE} + exit ;; + SX-8:SUPER-UX:*:*) + echo sx8-nec-superux${UNAME_RELEASE} + exit ;; + SX-8R:SUPER-UX:*:*) + echo sx8r-nec-superux${UNAME_RELEASE} + exit ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit ;; + *:Darwin:*:*) + UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown + case $UNAME_PROCESSOR in + unknown) UNAME_PROCESSOR=powerpc ;; + esac + echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} + exit ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + UNAME_PROCESSOR=`uname -p` + if test "$UNAME_PROCESSOR" = "x86"; then + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc + fi + echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} + exit ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit ;; + NSE-?:NONSTOP_KERNEL:*:*) + echo nse-tandem-nsk${UNAME_RELEASE} + exit ;; + NSR-?:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit ;; + *:NonStop-UX:*:*) + echo mips-compaq-nonstopux + exit ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit ;; + *:Plan9:*:*) + # "uname -m" is not consistent, so use $cputype instead. 386 + # is converted to i386 for consistency with other x86 + # operating systems. + if test "$cputype" = "386"; then + UNAME_MACHINE=i386 + else + UNAME_MACHINE="$cputype" + fi + echo ${UNAME_MACHINE}-unknown-plan9 + exit ;; + *:TOPS-10:*:*) + echo pdp10-unknown-tops10 + exit ;; + *:TENEX:*:*) + echo pdp10-unknown-tenex + exit ;; + KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) + echo pdp10-dec-tops20 + exit ;; + XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) + echo pdp10-xkl-tops20 + exit ;; + *:TOPS-20:*:*) + echo pdp10-unknown-tops20 + exit ;; + *:ITS:*:*) + echo pdp10-unknown-its + exit ;; + SEI:*:*:SEIUX) + echo mips-sei-seiux${UNAME_RELEASE} + exit ;; + *:DragonFly:*:*) + echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit ;; + *:*VMS:*:*) + UNAME_MACHINE=`(uname -p) 2>/dev/null` + case "${UNAME_MACHINE}" in + A*) echo alpha-dec-vms ; exit ;; + I*) echo ia64-dec-vms ; exit ;; + V*) echo vax-dec-vms ; exit ;; + esac ;; + *:XENIX:*:SysV) + echo i386-pc-xenix + exit ;; + i*86:skyos:*:*) + echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' + exit ;; + i*86:rdos:*:*) + echo ${UNAME_MACHINE}-pc-rdos + exit ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +eval $set_cc_for_build +cat >$dummy.c < +# include +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix\n"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +# if !defined (ultrix) +# include +# if defined (BSD) +# if BSD == 43 + printf ("vax-dec-bsd4.3\n"); exit (0); +# else +# if BSD == 199006 + printf ("vax-dec-bsd4.3reno\n"); exit (0); +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# endif +# else + printf ("vax-dec-bsd\n"); exit (0); +# endif +# else + printf ("vax-dec-ultrix\n"); exit (0); +# endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && + { echo "$SYSTEM_NAME"; exit; } + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit ;; + c34*) + echo c34-convex-bsd + exit ;; + c38*) + echo c38-convex-bsd + exit ;; + c4*) + echo c4-convex-bsd + exit ;; + esac +fi + +cat >&2 < in order to provide the needed +information to handle your system. + +config.guess timestamp = $timestamp + +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null` + +hostinfo = `(hostinfo) 2>/dev/null` +/bin/universe = `(/bin/universe) 2>/dev/null` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` +/bin/arch = `(/bin/arch) 2>/dev/null` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` + +UNAME_MACHINE = ${UNAME_MACHINE} +UNAME_RELEASE = ${UNAME_RELEASE} +UNAME_SYSTEM = ${UNAME_SYSTEM} +UNAME_VERSION = ${UNAME_VERSION} +EOF + +exit 1 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/config.h.in b/contrib/slapd-modules/nssov/nss-ldapd/config.h.in new file mode 100644 index 0000000000..0140ccb250 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/config.h.in @@ -0,0 +1,338 @@ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Define to 1 if you have the header file. */ +#undef HAVE_ALIASES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the `daemon' function. */ +#undef HAVE_DAEMON + +/* Define to 1 if you have the `ether_aton' function. */ +#undef HAVE_ETHER_ATON + +/* Define to 1 if you have the `ether_aton_r' function. */ +#undef HAVE_ETHER_ATON_R + +/* Define to 1 if you have the `ether_ntoa' function. */ +#undef HAVE_ETHER_NTOA + +/* Define to 1 if you have the `ether_ntoa_r' function. */ +#undef HAVE_ETHER_NTOA_R + +/* Define to 1 if you have the `gethostbyname' function. */ +#undef HAVE_GETHOSTBYNAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_GETOPT_H + +/* Define to 1 if you have the `getopt_long' function. */ +#undef HAVE_GETOPT_LONG + +/* Define to 1 if you have the `getpeereid' function. */ +#undef HAVE_GETPEEREID + +/* Define to 1 if you have the `getpeerucred' function. */ +#undef HAVE_GETPEERUCRED + +/* Define to 1 if you have the header file. */ +#undef HAVE_GRP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSAPI_GSSAPI_KRB5_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSAPI_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSLDAP_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_GSSSASL_H + +/* Define to 1 if you have the `gss_krb5_ccache_name' function. */ +#undef HAVE_GSS_KRB5_CCACHE_NAME + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LBER_H + +/* Define to 1 if you have the `ldap_abandon' function. */ +#undef HAVE_LDAP_ABANDON + +/* Define to 1 if you have the `ldap_controls_free' function. */ +#undef HAVE_LDAP_CONTROLS_FREE + +/* Define to 1 if you have the `ldap_control_free' function. */ +#undef HAVE_LDAP_CONTROL_FREE + +/* Define to 1 if you have the `ldap_create_control' function. */ +#undef HAVE_LDAP_CREATE_CONTROL + +/* Define to 1 if you have the `ldap_create_page_control' function. */ +#undef HAVE_LDAP_CREATE_PAGE_CONTROL + +/* Define to 1 if you have the `ldap_domain2dn' function. */ +#undef HAVE_LDAP_DOMAIN2DN + +/* Define to 1 if you have the `ldap_domain2hostlist' function. */ +#undef HAVE_LDAP_DOMAIN2HOSTLIST + +/* Define to 1 if you have the `ldap_err2string' function. */ +#undef HAVE_LDAP_ERR2STRING + +/* Define to 1 if you have the `ldap_explode_dn' function. */ +#undef HAVE_LDAP_EXPLODE_DN + +/* Define to 1 if you have the `ldap_explode_rdn' function. */ +#undef HAVE_LDAP_EXPLODE_RDN + +/* Define to 1 if you have the `ldap_get_dn' function. */ +#undef HAVE_LDAP_GET_DN + +/* Define to 1 if you have the `ldap_get_option' function. */ +#undef HAVE_LDAP_GET_OPTION + +/* Define to 1 if you have the `ldap_get_values' function. */ +#undef HAVE_LDAP_GET_VALUES + +/* Define to 1 if you have the header file. */ +#undef HAVE_LDAP_H + +/* Define to 1 if you have the `ldap_initialize' function. */ +#undef HAVE_LDAP_INITIALIZE + +/* Define to 1 if you have the `ldap_memfree' function. */ +#undef HAVE_LDAP_MEMFREE + +/* Define to 1 if you have the `ldap_msgfree' function. */ +#undef HAVE_LDAP_MSGFREE + +/* Define to 1 if you have the `ldap_parse_page_control' function. */ +#undef HAVE_LDAP_PARSE_PAGE_CONTROL + +/* Define to 1 if you have the `ldap_parse_result' function. */ +#undef HAVE_LDAP_PARSE_RESULT + +/* Define to 1 if you have the `ldap_result' function. */ +#undef HAVE_LDAP_RESULT + +/* Define to 1 if you have the `ldap_sasl_interactive_bind_s' function. */ +#undef HAVE_LDAP_SASL_INTERACTIVE_BIND_S + +/* Define to 1 if you have the `ldap_search_ext' function. */ +#undef HAVE_LDAP_SEARCH_EXT + +/* Define to 1 if you have the `ldap_set_option' function. */ +#undef HAVE_LDAP_SET_OPTION + +/* Define to 1 if you have the `ldap_set_rebind_proc' function. */ +#undef HAVE_LDAP_SET_REBIND_PROC + +/* Define to 1 if you have the `ldap_simple_bind_s' function. */ +#undef HAVE_LDAP_SIMPLE_BIND_S + +/* Define to 1 if you have the header file. */ +#undef HAVE_LDAP_SSL_H + +/* Define to 1 if you have the `ldap_unbind' function. */ +#undef HAVE_LDAP_UNBIND + +/* Define to 1 if you have the `ldap_value_free' function. */ +#undef HAVE_LDAP_VALUE_FREE + +/* Define to 1 if you have the `pthread' library (-lpthread). */ +#undef HAVE_LIBPTHREAD + +/* Define to 1 if you have the `sasl2' library (-lsasl2). */ +#undef HAVE_LIBSASL2 + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NETINET_ETHER_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NSS_H + +/* Define if you have POSIX threads libraries and header files. */ +#undef HAVE_PTHREAD + +/* Define to 1 if you have the `pthread_atfork' function. */ +#undef HAVE_PTHREAD_ATFORK + +/* Define to 1 if you have the header file. */ +#undef HAVE_PTHREAD_H + +/* Define to 1 if you have the `sasl_auxprop_request' function. */ +#undef HAVE_SASL_AUXPROP_REQUEST + +/* Define to 1 if you have the header file. */ +#undef HAVE_SASL_H + +/* Define to 1 if you have a `sasl_interact_t' definition. */ +#undef HAVE_SASL_INTERACT_T + +/* Define to 1 if you have the header file. */ +#undef HAVE_SASL_SASL_H + +/* Define to 1 if you have the `setgroups' function. */ +#undef HAVE_SETGROUPS + +/* Define to 1 if you have the header file. */ +#undef HAVE_SHADOW_H + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have a `struct ether_addr' definition. */ +#undef HAVE_STRUCT_ETHER_ADDR + +/* Define to 1 if you have a `struct ucred' definition. */ +#undef HAVE_STRUCT_UCRED + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SOCKET_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UCRED_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_UN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UCRED_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `__nss_configure_lookup' function. */ +#undef HAVE___NSS_CONFIGURE_LOOKUP + +/* Define to the number of arguments to ldap_set_rebindproc. */ +#undef LDAP_SET_REBIND_PROC_ARGS + +/* Define to 1 if your C compiler doesn't accept -c and -o together. */ +#undef NO_MINUS_C_MINUS_O + +/* The location of the pidfile used for checking availability of the nslcd. */ +#undef NSLCD_PIDFILE + +/* The location of the socket used for communicating. */ +#undef NSLCD_SOCKET + +/* Path to LDAP configuration file. */ +#undef NSS_LDAP_PATH_CONF + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define to necessary symbol if this constant uses a non-standard name on + your system. */ +#undef PTHREAD_CREATE_JOINABLE + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if on AIX 3. + System headers sometimes define this. + We just want to avoid a redefinition error message. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif + +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Enable extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif + +/* Define to empty if compiler does not support `__thread' keyword. */ +#undef __thread + +/* Define to empty if `const' does not conform to ANSI C. */ +#undef const + +/* Define to `int' if doesn't define. */ +#undef gid_t + +/* Define to `int' if does not define. */ +#undef mode_t + +/* Define to `unsigned int' if does not define. */ +#undef size_t + +/* Define to `sockaddr_in' if not defined elsewhere. */ +#undef sockaddr_storage + +/* Define to `size_t' if not defined elswhere. */ +#undef socklen_t + +/* Define to `int' if doesn't define. */ +#undef uid_t diff --git a/contrib/slapd-modules/nssov/nss-ldapd/config.sub b/contrib/slapd-modules/nssov/nss-ldapd/config.sub new file mode 100755 index 0000000000..6759825a5b --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/config.sub @@ -0,0 +1,1658 @@ +#! /bin/sh +# Configuration validation subroutine script. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. + +timestamp='2008-01-16' + +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA +# 02110-1301, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + + +# Please send patches to . Submit a context +# diff and a properly formatted ChangeLog entry. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +me=`echo "$0" | sed -e 's,.*/,,'` + +usage="\ +Usage: $0 [OPTION] CPU-MFR-OPSYS + $0 [OPTION] ALIAS + +Canonicalize a configuration name. + +Operation modes: + -h, --help print this help, then exit + -t, --time-stamp print date of last modification, then exit + -v, --version print version number, then exit + +Report bugs and patches to ." + +version="\ +GNU config.sub ($timestamp) + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + +This is free software; see the source for copying conditions. There is NO +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." + +help=" +Try \`$me --help' for more information." + +# Parse command line +while test $# -gt 0 ; do + case $1 in + --time-stamp | --time* | -t ) + echo "$timestamp" ; exit ;; + --version | -v ) + echo "$version" ; exit ;; + --help | --h* | -h ) + echo "$usage"; exit ;; + -- ) # Stop option processing + shift; break ;; + - ) # Use stdin as input. + break ;; + -* ) + echo "$me: invalid option $1$help" + exit 1 ;; + + *local*) + # First pass through any local machine types. + echo $1 + exit ;; + + * ) + break ;; + esac +done + +case $# in + 0) echo "$me: missing argument$help" >&2 + exit 1;; + 1) ;; + *) echo "$me: too many arguments$help" >&2 + exit 1;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ + uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple | -axis | -knuth | -cray) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -chorusos*) + os=-chorusos + basic_machine=$1 + ;; + -chorusrdb) + os=-chorusrdb + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco6) + os=-sco5v6 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco5v6*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + 1750a | 580 \ + | a29k \ + | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ + | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ + | am33_2.0 \ + | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ + | bfin \ + | c4x | clipper \ + | d10v | d30v | dlx | dsp16xx \ + | fido | fr30 | frv \ + | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ + | i370 | i860 | i960 | ia64 \ + | ip2k | iq2000 \ + | m32c | m32r | m32rle | m68000 | m68k | m88k \ + | maxq | mb | microblaze | mcore | mep \ + | mips | mipsbe | mipseb | mipsel | mipsle \ + | mips16 \ + | mips64 | mips64el \ + | mips64vr | mips64vrel \ + | mips64orion | mips64orionel \ + | mips64vr4100 | mips64vr4100el \ + | mips64vr4300 | mips64vr4300el \ + | mips64vr5000 | mips64vr5000el \ + | mips64vr5900 | mips64vr5900el \ + | mipsisa32 | mipsisa32el \ + | mipsisa32r2 | mipsisa32r2el \ + | mipsisa64 | mipsisa64el \ + | mipsisa64r2 | mipsisa64r2el \ + | mipsisa64sb1 | mipsisa64sb1el \ + | mipsisa64sr71k | mipsisa64sr71kel \ + | mipstx39 | mipstx39el \ + | mn10200 | mn10300 \ + | mt \ + | msp430 \ + | nios | nios2 \ + | ns16k | ns32k \ + | or32 \ + | pdp10 | pdp11 | pj | pjl \ + | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ + | pyramid \ + | score \ + | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh64 | sh64le \ + | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ + | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ + | spu | strongarm \ + | tahoe | thumb | tic4x | tic80 | tron \ + | v850 | v850e \ + | we32k \ + | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ + | z8k) + basic_machine=$basic_machine-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12) + # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown + os=-none + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; + ms1) + basic_machine=mt-unknown + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + 580-* \ + | a29k-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ + | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ + | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ + | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ + | avr-* | avr32-* \ + | bfin-* | bs2000-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | clipper-* | craynv-* | cydra-* \ + | d10v-* | d30v-* | dlx-* \ + | elxsi-* \ + | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ + | h8300-* | h8500-* \ + | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ + | i*86-* | i860-* | i960-* | ia64-* \ + | ip2k-* | iq2000-* \ + | m32c-* | m32r-* | m32rle-* \ + | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ + | m88110-* | m88k-* | maxq-* | mcore-* \ + | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ + | mips16-* \ + | mips64-* | mips64el-* \ + | mips64vr-* | mips64vrel-* \ + | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* \ + | mips64vr4300-* | mips64vr4300el-* \ + | mips64vr5000-* | mips64vr5000el-* \ + | mips64vr5900-* | mips64vr5900el-* \ + | mipsisa32-* | mipsisa32el-* \ + | mipsisa32r2-* | mipsisa32r2el-* \ + | mipsisa64-* | mipsisa64el-* \ + | mipsisa64r2-* | mipsisa64r2el-* \ + | mipsisa64sb1-* | mipsisa64sb1el-* \ + | mipsisa64sr71k-* | mipsisa64sr71kel-* \ + | mipstx39-* | mipstx39el-* \ + | mmix-* \ + | mt-* \ + | msp430-* \ + | nios-* | nios2-* \ + | none-* | np1-* | ns16k-* | ns32k-* \ + | orion-* \ + | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ + | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ + | pyramid-* \ + | romp-* | rs6000-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ + | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ + | sparclite-* \ + | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ + | tahoe-* | thumb-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tron-* \ + | v850-* | v850e-* | vax-* \ + | we32k-* \ + | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ + | xstormy16-* | xtensa*-* \ + | ymp-* \ + | z8k-*) + ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + abacus) + basic_machine=abacus-unknown + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amd64) + basic_machine=x86_64-pc + ;; + amd64-*) + basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-unknown + ;; + amigaos | amigados) + basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + c90) + basic_machine=c90-cray + os=-unicos + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | j90) + basic_machine=j90-cray + os=-unicos + ;; + craynv) + basic_machine=craynv-cray + os=-unicosmp + ;; + cr16) + basic_machine=cr16-unknown + os=-elf + ;; + crds | unos) + basic_machine=m68k-crds + ;; + crisv32 | crisv32-* | etraxfs*) + basic_machine=crisv32-axis + ;; + cris | cris-* | etrax*) + basic_machine=cris-axis + ;; + crx) + basic_machine=crx-unknown + os=-elf + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + decsystem10* | dec10*) + basic_machine=pdp10-dec + os=-tops10 + ;; + decsystem20* | dec20*) + basic_machine=pdp10-dec + os=-tops20 + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + djgpp) + basic_machine=i586-pc + os=-msdosdjgpp + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + go32) + basic_machine=i386-pc + os=-go32 + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + mingw32) + basic_machine=i386-pc + os=-mingw32 + ;; + mingw32ce) + basic_machine=arm-unknown + os=-mingw32ce + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + morphos) + basic_machine=powerpc-unknown + os=-morphos + ;; + msdos) + basic_machine=i386-pc + os=-msdos + ;; + ms1-*) + basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + nonstopux) + basic_machine=mips-compaq + os=-nonstopux + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + openrisc | openrisc-*) + basic_machine=or32-unknown + ;; + os400) + basic_machine=powerpc-ibm + os=-os400 + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pc98) + basic_machine=i386-pc + ;; + pc98-*) + basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2 | pentiumiii | pentium3) + basic_machine=i686-pc + ;; + pentium4) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentium4-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64) basic_machine=powerpc64-unknown + ;; + ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppc64le | powerpc64little | ppc64-le | powerpc64-little) + basic_machine=powerpc64le-unknown + ;; + ppc64le-* | powerpc64little-*) + basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + pw32) + basic_machine=i586-unknown + os=-pw32 + ;; + rdos) + basic_machine=i386-pc + os=-rdos + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + s390 | s390-*) + basic_machine=s390-ibm + ;; + s390x | s390x-*) + basic_machine=s390x-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sb1) + basic_machine=mipsisa64sb1-unknown + ;; + sb1el) + basic_machine=mipsisa64sb1el-unknown + ;; + sde) + basic_machine=mipsisa32-sde + os=-elf + ;; + sei) + basic_machine=mips-sei + os=-seiux + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sh5el) + basic_machine=sh5le-unknown + ;; + sh64) + basic_machine=sh64-unknown + ;; + sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=alphaev5-cray + os=-unicos + ;; + t90) + basic_machine=t90-cray + os=-unicos + ;; + tic54x | c54x*) + basic_machine=tic54x-unknown + os=-coff + ;; + tic55x | c55x*) + basic_machine=tic55x-unknown + os=-coff + ;; + tic6x | c6x*) + basic_machine=tic6x-unknown + os=-coff + ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + toad1) + basic_machine=pdp10-xkl + os=-tops20 + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + tpf) + basic_machine=s390x-ibm + os=-tpf + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xbox) + basic_machine=i686-pc + os=-mingw32 + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + ymp) + basic_machine=ymp-cray + os=-unicos + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + romp) + basic_machine=romp-ibm + ;; + mmix) + basic_machine=mmix-knuth + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp10) + # there are many clones, so DEC is not a safe bet + basic_machine=pdp10-unknown + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + basic_machine=sh-unknown + ;; + sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + *-unknown) + # Make sure to match an already-canonicalized machine name. + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ + | -openbsd* | -solidbsd* \ + | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ + | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ + | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ + | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ + | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ + | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ + | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i*86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto-qnx*) + ;; + -nto*) + os=`echo $os | sed -e 's|nto|nto-qnx|'` + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux-dietlibc) + os=-linux-dietlibc + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -os400*) + os=-os400 + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -atheos*) + os=-atheos + ;; + -syllable*) + os=-syllable + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -nova*) + os=-rtmk-nova + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk*) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -tpf*) + os=-tpf + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + os=-mint + ;; + -aros*) + os=-aros + ;; + -kaos*) + os=-kaos + ;; + -zvmoe) + os=-zvmoe + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + score-*) + os=-elf + ;; + spu-*) + os=-elf + ;; + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + c4x-* | tic4x-*) + os=-coff + ;; + # This must come before the *-dec entry. + pdp10-*) + os=-tops20 + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mep-*) + os=-elf + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + or32-*) + os=-coff + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-haiku) + os=-haiku + ;; + *-ibm) + os=-aix + ;; + *-knuth) + os=-mmixware + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -os400*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -tpf*) + vendor=ibm + ;; + -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) + vendor=atari + ;; + -vos*) + vendor=stratus + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os +exit + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "timestamp='" +# time-stamp-format: "%:y-%02m-%02d" +# time-stamp-end: "'" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/configure b/contrib/slapd-modules/nssov/nss-ldapd/configure new file mode 100755 index 0000000000..d3f95b1aff --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/configure @@ -0,0 +1,13713 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by GNU Autoconf 2.61 for nss-ldapd 0.6.2. +# +# Report bugs to . +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This configure script is derived from configure.ac which is free software; +# you can redistribute it and/or modify it under the terms of the GNU Lesser +# General Public License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. See the +# configure.ac file for more details. +# +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + case $as_dir in + /*) + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + + +exec 7<&0 &1 + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +# +# Initializations. +# +ac_default_prefix=/usr/local +ac_clean_files= +ac_config_libobj_dir=. +LIBOBJS= +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Identity of this package. +PACKAGE_NAME='nss-ldapd' +PACKAGE_TARNAME='nss-ldapd' +PACKAGE_VERSION='0.6.2' +PACKAGE_STRING='nss-ldapd 0.6.2' +PACKAGE_BUGREPORT='arthur@ch.tudelft.nl' + +ac_unique_file="nslcd.h" +ac_default_prefix= +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#ifdef HAVE_SYS_TYPES_H +# include +#endif +#ifdef HAVE_SYS_STAT_H +# include +#endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +# include +# endif +# include +#endif +#ifdef HAVE_STRINGS_H +# include +#endif +#ifdef HAVE_INTTYPES_H +# include +#endif +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif" + +ac_config_libobj_dir=compat +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +RELEASE_MONTH +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +am__isrc +CYGPATH_W +PACKAGE +VERSION +ACLOCAL +AUTOCONF +AUTOMAKE +AUTOHEADER +MAKEINFO +install_sh +STRIP +INSTALL_STRIP_PROGRAM +mkdir_p +AWK +SET_MAKE +am__leading_dot +AMTAR +am__tar +am__untar +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +DEPDIR +am__include +am__quote +AMDEP_TRUE +AMDEP_FALSE +AMDEPBACKSLASH +CCDEPMODE +am__fastdepCC_TRUE +am__fastdepCC_FALSE +CPP +RANLIB +GREP +EGREP +DOCBOOK2X_MAN +GENMAN_TRUE +GENMAN_FALSE +NSS_LDAP_PATH_CONF +NSLCD_PIDFILE +NSLCD_SOCKET +LIBOBJS +acx_pthread_config +PTHREAD_CC +PTHREAD_LIBS +PTHREAD_CFLAGS +nss_ldap_so_LIBS +nslcd_LIBS +LTLIBOBJS' +ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datarootdir='${prefix}/share' +datadir='${datarootdir}' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +includedir='${prefix}/include' +oldincludedir='/usr/include' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' + +ac_prev= +ac_dashdash= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval $ac_prev=\$ac_option + ac_prev= + continue + fi + + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=*) + datadir=$ac_optarg ;; + + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst | --locals) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + eval $ac_envvar=\$ac_optarg + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir +do + eval ac_val=\$$ac_var + case $ac_val in + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r "$srcdir/$ac_unique_file"; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } +fi +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + { (exit 1); exit 1; }; } + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures nss-ldapd 0.6.2 to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/nss-ldapd] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +System types: + --build=BUILD configure for building on BUILD [guessed] + --host=HOST cross-compile to build programs to run on HOST [BUILD] + --target=TARGET configure for building compilers for TARGET [HOST] +_ACEOF +fi + +if test -n "$ac_init_help"; then + case $ac_init_help in + short | recursive ) echo "Configuration of nss-ldapd 0.6.2:";; + esac + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --disable-dependency-tracking speeds up one-time build + --enable-dependency-tracking do not reject slow dependency extractors + --enable-debug enable extensive debugging and logging + --enable-warnings enable extra compiler warnings (gcc) + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-ldap-lib=TYPE select ldap library + (auto|netscape5|netscape4|netscape3|umich|openldap) + [auto] + --with-ldap-conf-file=PATH + path to LDAP configuration file + [/etc/nss-ldapd.conf] + --with-nslcd-pidfile=PATH + path to pidfile [/var/run/nslcd/nslcd.pid] + --with-nslcd-socket=PATH + path to socket [/var/run/nslcd/socket] + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +Report bugs to . +_ACEOF +ac_status=$? +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d "$ac_dir" || continue + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } + done +fi + +test -n "$ac_init_help" && exit $ac_status +if $ac_init_version; then + cat <<\_ACEOF +nss-ldapd configure 0.6.2 +generated by GNU Autoconf 2.61 + +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. + +Copyright (C) 2006 Luke Howard +Copyright (C) 2006 West Consulting +Copyright (C) 2006, 2007, 2008 Arthur de Jong + +This configure script is derived from configure.ac which is free software; +you can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. See the +configure.ac file for more details. +_ACEOF + exit +fi +cat >config.log <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by nss-ldapd $as_me 0.6.2, which was +generated by GNU Autoconf 2.61. Invocation command line was + + $ $0 $@ + +_ACEOF +exec 5>>config.log +{ +cat <<_ASUNAME +## --------- ## +## Platform. ## +## --------- ## + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done +IFS=$as_save_IFS + +} >&5 + +cat >&5 <<_ACEOF + + +## ----------- ## +## Core tests. ## +## ----------- ## + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Strip out --silent because we don't want to record it for future runs. +# Also quote any args containing shell meta-characters. +# Make two passes to allow for proper duplicate-argument suppression. +ac_configure_args= +ac_configure_args0= +ac_configure_args1= +ac_must_keep_next=false +for ac_pass in 1 2 +do + for ac_arg + do + case $ac_arg in + -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + continue ;; + *\'*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case $ac_pass in + 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; + 2) + ac_configure_args1="$ac_configure_args1 '$ac_arg'" + if test $ac_must_keep_next = true; then + ac_must_keep_next=false # Got value, back to normal. + else + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac + fi + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + esac + done +done +$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + + cat <<\_ASBOX +## ---------------- ## +## Cache variables. ## +## ---------------- ## +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + sed -n \ + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( + *) + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) + echo + + cat <<\_ASBOX +## ----------------- ## +## Output variables. ## +## ----------------- ## +_ASBOX + echo + for ac_var in $ac_subst_vars + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + + if test -n "$ac_subst_files"; then + cat <<\_ASBOX +## ------------------- ## +## File substitutions. ## +## ------------------- ## +_ASBOX + echo + for ac_var in $ac_subst_files + do + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" + done | sort + echo + fi + + if test -s confdefs.h; then + cat <<\_ASBOX +## ----------- ## +## confdefs.h. ## +## ----------- ## +_ASBOX + echo + cat confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status +' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -f -r conftest* confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" +fi +shift +for ac_site_file +do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in $ac_precious_vars; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + + + + + + + + + + + + + + + + + + + + + + + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +RELEASE_MONTH="May 2008" + + + +ac_aux_dir= +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { (exit 1); exit 1; }; } +fi + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + +# Make sure we can run config.sub. +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { (exit 1); exit 1; }; } + +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac +build=$ac_cv_build +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac +host=$ac_cv_host +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac + + +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { (exit 1); exit 1; }; } +fi + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac +target=$ac_cv_target +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac + + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + + +# display notice and initialize automake +{ echo "$as_me:$LINENO: configuring nss-ldapd 0.6.2" >&5 +echo "$as_me: configuring nss-ldapd 0.6.2" >&6;} +am__api_version='1.10' + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +{ echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6; } +# Just in case +sleep 1 +echo timestamp > conftest.file +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftest.file` + fi + rm -f conftest.file + if test "$*" != "X $srcdir/configure conftest.file" \ + && test "$*" != "X conftest.file $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftest.file + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +test "$program_prefix" != NONE && + program_transform_name="s&^&$program_prefix&;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s&\$&$program_suffix&;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed + +# expand $ac_aux_dir to an absolute path +am_aux_dir=`cd $ac_aux_dir && pwd` + +test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" +# Use eval to expand $SHELL +if eval "$MISSING --run true"; then + am_missing_run="$MISSING --run " +else + am_missing_run= + { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 +echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} +fi + +{ echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 +echo $ECHO_N "checking for a thread-safe mkdir -p... $ECHO_C" >&6; } +if test -z "$MKDIR_P"; then + if test "${ac_cv_path_mkdir+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in mkdir gmkdir; do + for ac_exec_ext in '' $ac_executable_extensions; do + { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue + case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( + 'mkdir (GNU coreutils) '* | \ + 'mkdir (coreutils) '* | \ + 'mkdir (fileutils) '4.1*) + ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext + break 3;; + esac + done + done +done +IFS=$as_save_IFS + +fi + + if test "${ac_cv_path_mkdir+set}" = set; then + MKDIR_P="$ac_cv_path_mkdir -p" + else + # As a last resort, use the slow shell script. Don't cache a + # value for MKDIR_P within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + test -d ./--version && rmdir ./--version + MKDIR_P="$ac_install_sh -d" + fi +fi +{ echo "$as_me:$LINENO: result: $MKDIR_P" >&5 +echo "${ECHO_T}$MKDIR_P" >&6; } + +mkdir_p="$MKDIR_P" +case $mkdir_p in + [\\/$]* | ?:[\\/]*) ;; + */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; +esac + +for ac_prog in gawk mawk nawk awk +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_AWK+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AWK"; then + ac_cv_prog_AWK="$AWK" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_AWK="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +AWK=$ac_cv_prog_AWK +if test -n "$AWK"; then + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$AWK" && break +done + +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +SHELL = /bin/sh +all: + @echo '@@@%%%=$(MAKE)=@@@%%%' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac +rm -f conftest.make +fi +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + SET_MAKE= +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + SET_MAKE="MAKE=${MAKE-make}" +fi + +rm -rf .tst 2>/dev/null +mkdir .tst 2>/dev/null +if test -d .tst; then + am__leading_dot=. +else + am__leading_dot=_ +fi +rmdir .tst 2>/dev/null + +if test "`cd $srcdir && pwd`" != "`pwd`"; then + # Use -I$(srcdir) only when $(srcdir) != ., so that make's output + # is not polluted with repeated "-I." + am__isrc=' -I$(srcdir)' + # test to see if srcdir already configured + if test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } + fi +fi + +# test whether we have cygpath +if test -z "$CYGPATH_W"; then + if (cygpath --version) >/dev/null 2>/dev/null; then + CYGPATH_W='cygpath -w' + else + CYGPATH_W=echo + fi +fi + + +# Define the identity of the package. + PACKAGE=nss-ldapd + VERSION=0.6.2 + + +cat >>confdefs.h <<_ACEOF +#define PACKAGE "$PACKAGE" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +#define VERSION "$VERSION" +_ACEOF + +# Some tools Automake needs. + +ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} + + +AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} + + +AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} + + +AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} + + +MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} + +install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} + +# Installed binaries are usually stripped using `strip' when the user +# run `make install-strip'. However `strip' might not be the right +# tool to use in cross-compilation environments, therefore Automake +# will honor the `STRIP' environment variable to overrule this program. +if test "$cross_compiling" != no; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. +set dummy ${ac_tool_prefix}strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$STRIP"; then + ac_cv_prog_STRIP="$STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_STRIP="${ac_tool_prefix}strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +STRIP=$ac_cv_prog_STRIP +if test -n "$STRIP"; then + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_STRIP"; then + ac_ct_STRIP=$STRIP + # Extract the first word of "strip", so it can be a program name with args. +set dummy strip; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_STRIP"; then + ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_STRIP="strip" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP +if test -n "$ac_ct_STRIP"; then + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_STRIP" = x; then + STRIP=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi +else + STRIP="$ac_cv_prog_STRIP" +fi + +fi +INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" + +# We need awk for the "check" target. The system "awk" is bad on +# some platforms. +# Always define AMTAR for backward compatibility. + +AMTAR=${AMTAR-"${am_missing_run}tar"} + +am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' + + + + + + +# create a config.h file (Automake will add -DHAVE_CONFIG_H) +ac_config_headers="$ac_config_headers config.h" + + +# check for programs +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + fi +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl.exe + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl.exe +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$ac_ct_CC" && break +done + + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe b.out" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' +do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; + [ab].out ) + # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; + * ) + break;; + esac +done +test "$ac_cv_exeext" = no && ac_cv_exeext= + +else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +See \`config.log' for more details." >&5 +echo "$as_me: error: C compiler cannot create executables +See \`config.log' for more details." >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext + +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'. +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + +rm -f a.out a.exe conftest$ac_cv_exeext b.out +ac_clean_files=$ac_clean_files_save +# Check that the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in conftest.exe conftest conftest.*; do + test -f "$ac_file" || continue + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_compiler_gnu=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +DEPDIR="${am__leading_dot}deps" + +ac_config_commands="$ac_config_commands depfiles" + + +am_make=${MAKE-make} +cat > confinc << 'END' +am__doit: + @echo done +.PHONY: am__doit +END +# If we don't find an include directive, just comment out the code. +{ echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 +echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6; } +am__include="#" +am__quote= +_am_result=none +# First try GNU make style include. +echo "include confinc" > confmf +# We grep out `Entering directory' and `Leaving directory' +# messages which can occur if `w' ends up in MAKEFLAGS. +# In particular we don't look at `^make:' because GNU make might +# be invoked under some other name (usually "gmake"), in which +# case it prints its new name instead of `make'. +if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then + am__include=include + am__quote= + _am_result=GNU +fi +# Now try BSD make style include. +if test "$am__include" = "#"; then + echo '.include "confinc"' > confmf + if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then + am__include=.include + am__quote="\"" + _am_result=BSD + fi +fi + + +{ echo "$as_me:$LINENO: result: $_am_result" >&5 +echo "${ECHO_T}$_am_result" >&6; } +rm -f confinc confmf + +# Check whether --enable-dependency-tracking was given. +if test "${enable_dependency_tracking+set}" = set; then + enableval=$enable_dependency_tracking; +fi + +if test "x$enable_dependency_tracking" != xno; then + am_depcomp="$ac_aux_dir/depcomp" + AMDEPBACKSLASH='\' +fi + if test "x$enable_dependency_tracking" != xno; then + AMDEP_TRUE= + AMDEP_FALSE='#' +else + AMDEP_TRUE='#' + AMDEP_FALSE= +fi + + + +depcc="$CC" am_compiler_list= + +{ echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 +echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6; } +if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then + # We make a subdir and do the tests there. Otherwise we can end up + # making bogus files that we don't know about and never remove. For + # instance it was reported that on HP-UX the gcc test will end up + # making a dummy file named `D' -- because `-MD' means `put the output + # in D'. + mkdir conftest.dir + # Copy depcomp to subdir because otherwise we won't find it if we're + # using a relative directory. + cp "$am_depcomp" conftest.dir + cd conftest.dir + # We will build objects and dependencies in a subdirectory because + # it helps to detect inapplicable dependency modes. For instance + # both Tru64's cc and ICC support -MD to output dependencies as a + # side effect of compilation, but ICC will put the dependencies in + # the current directory while Tru64 will put them in the object + # directory. + mkdir sub + + am_cv_CC_dependencies_compiler_type=none + if test "$am_compiler_list" = ""; then + am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` + fi + for depmode in $am_compiler_list; do + # Setup a source with many dependencies, because some compilers + # like to wrap large dependency lists on column 80 (with \), and + # we should not choose a depcomp mode which is confused by this. + # + # We need to recreate these files for each test, as the compiler may + # overwrite some of them when testing with obscure command lines. + # This happens at least with the AIX C compiler. + : > sub/conftest.c + for i in 1 2 3 4 5 6; do + echo '#include "conftst'$i'.h"' >> sub/conftest.c + # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with + # Solaris 8's {/usr,}/bin/sh. + touch sub/conftst$i.h + done + echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf + + case $depmode in + nosideeffect) + # after this tag, mechanisms are not by side-effect, so they'll + # only be used when explicitly requested + if test "x$enable_dependency_tracking" = xyes; then + continue + else + break + fi + ;; + none) break ;; + esac + # We check with `-c' and `-o' for the sake of the "dashmstdout" + # mode. It turns out that the SunPro C++ compiler does not properly + # handle `-M -o', and we need to detect this. + if depmode=$depmode \ + source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ + depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ + $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ + >/dev/null 2>conftest.err && + grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings + # or remarks (even with -Werror). So we grep stderr for any message + # that says an option was ignored or not supported. + # When given -MP, icc 7.0 and 7.1 complain thusly: + # icc: Command line warning: ignoring option '-M'; no argument required + # The diagnosis changed in icc 8.0: + # icc: Command line remark: option '-MP' not supported + if (grep 'ignoring option' conftest.err || + grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else + am_cv_CC_dependencies_compiler_type=$depmode + break + fi + fi + done + + cd .. + rm -rf conftest.dir +else + am_cv_CC_dependencies_compiler_type=none +fi + +fi +{ echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 +echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6; } +CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type + + if + test "x$enable_dependency_tracking" != xno \ + && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then + am__fastdepCC_TRUE= + am__fastdepCC_FALSE='#' +else + am__fastdepCC_TRUE='#' + am__fastdepCC_FALSE= +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Broken: fails on valid input. +continue +fi + +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # Passes both tests. +ac_preproc_ok=: +break +fi + +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic +# ./install, which can be erroneously created by make from ./install.sh. +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done +IFS=$as_save_IFS + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the value is a relative name. + INSTALL=$ac_install_sh + fi +fi +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. +set dummy ${ac_tool_prefix}ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +RANLIB=$ac_cv_prog_RANLIB +if test -n "$RANLIB"; then + { echo "$as_me:$LINENO: result: $RANLIB" >&5 +echo "${ECHO_T}$RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +fi +if test -z "$ac_cv_prog_RANLIB"; then + ac_ct_RANLIB=$RANLIB + # Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_RANLIB"; then + ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ac_ct_RANLIB="ranlib" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB +if test -n "$ac_ct_RANLIB"; then + { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 +echo "${ECHO_T}$ac_ct_RANLIB" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + if test "x$ac_ct_RANLIB" = x; then + RANLIB=":" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + RANLIB=$ac_ct_RANLIB + fi +else + RANLIB="$ac_cv_prog_RANLIB" +fi + +if test "x$CC" != xcc; then + { echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 +echo $ECHO_N "checking whether $CC and cc understand -c and -o together... $ECHO_C" >&6; } +else + { echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 +echo $ECHO_N "checking whether cc understands -c and -o together... $ECHO_C" >&6; } +fi +set dummy $CC; ac_cc=`echo $2 | + sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +# Make sure it works both with $CC and with simple cc. +# We do the test twice because some compilers refuse to overwrite an +# existing .o file with -o, though they will create one. +ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' +rm -f conftest2.* +if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; +then + eval ac_cv_prog_cc_${ac_cc}_c_o=yes + if test "x$CC" != xcc; then + # Test first that cc exists at all. + if { ac_try='cc -c conftest.$ac_ext >&5' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' + rm -f conftest2.* + if { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + test -f conftest2.$ac_objext && { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; + then + # cc works too. + : + else + # cc exists but doesn't like -o. + eval ac_cv_prog_cc_${ac_cc}_c_o=no + fi + fi + fi +else + eval ac_cv_prog_cc_${ac_cc}_c_o=no +fi +rm -f core conftest* + +fi +if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +cat >>confdefs.h <<\_ACEOF +#define NO_MINUS_C_MINUS_O 1 +_ACEOF + +fi + +# FIXME: we rely on the cache variable name because +# there is no other way. +set dummy $CC +ac_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` +if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" != yes"; then + # Losing compiler, so override with the script. + # FIXME: It is wrong to rewrite CC. + # But if we don't then we get into trouble of one sort or another. + # A longer-term fix would be to have automake use am__CC in this case, + # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" + CC="$am_aux_dir/compile $CC" +fi + + + +cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + + + +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + + +{ echo "$as_me:$LINENO: checking for AIX" >&5 +echo $ECHO_N "checking for AIX... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifdef _AIX + yes +#endif + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "yes" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f conftest* + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_header_stdc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +#define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +if test "${ac_cv_header_minix_config_h+set}" = set; then + { echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +echo $ECHO_N "checking minix/config.h usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +echo $ECHO_N "checking minix/config.h presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for minix/config.h" >&5 +echo $ECHO_N "checking for minix/config.h... $ECHO_C" >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +echo "${ECHO_T}$ac_cv_header_minix_config_h" >&6; } + +fi +if test $ac_cv_header_minix_config_h = yes; then + MINIX=yes +else + MINIX= +fi + + +if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + +fi + + + + + + + + + + + + { echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +echo $ECHO_N "checking whether it is safe to define __EXTENSIONS__... $ECHO_C" >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +echo "${ECHO_T}$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + + +# checks for tool to convert docbook to man +for ac_prog in docbook2x-man +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_DOCBOOK2X_MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $DOCBOOK2X_MAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_DOCBOOK2X_MAN="$DOCBOOK2X_MAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_DOCBOOK2X_MAN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +DOCBOOK2X_MAN=$ac_cv_path_DOCBOOK2X_MAN +if test -n "$DOCBOOK2X_MAN"; then + { echo "$as_me:$LINENO: result: $DOCBOOK2X_MAN" >&5 +echo "${ECHO_T}$DOCBOOK2X_MAN" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$DOCBOOK2X_MAN" && break +done + +if test "x${DOCBOOK2X_MAN}" = x +then + { echo "$as_me:$LINENO: WARNING: docbook2x-man not found: not generating man pages" >&5 +echo "$as_me: WARNING: docbook2x-man not found: not generating man pages" >&2;} +fi + if test "x${DOCBOOK2X_MAN}" != x; then + GENMAN_TRUE= + GENMAN_FALSE='#' +else + GENMAN_TRUE='#' + GENMAN_FALSE= +fi + + +# start with default options +nss_ldap_so_LIBS= +nslcd_LIBS= + +# check for debugging options +# Check whether --enable-debug was given. +if test "${enable_debug+set}" = set; then + enableval=$enable_debug; if test "x$enableval" != "xno" ; then CFLAGS="-g -DDEBUG $CFLAGS" ; fi +fi + + +DESIRED_CFLAGS="" + +# check for extra compiler warnings +# Check whether --enable-warnings was given. +if test "${enable_warnings+set}" = set; then + enableval=$enable_warnings; if test "x$enableval" != "no" + then + CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default -Wswitch-enum -Wfloat-equal -Wbad-function-cast -Wunreachable-code -Wredundant-decls" + DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra -Wdeclaration-after-statement -Werror-implicit-function-declaration" + fi +fi + + +test_gcc_flag() { + cat >conftest.$ac_ext <<_ACEOF +int main() {} +_ACEOF + $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o + return $ret +} + +for flag in $DESIRED_CFLAGS +do + { echo "$as_me:$LINENO: checking whether $CC accepts $flag" >&5 +echo $ECHO_N "checking whether $CC accepts $flag... $ECHO_C" >&6; } + if test_gcc_flag $flag + then + CFLAGS="$CFLAGS $flag" + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + fi +done + + +# Check whether --with-ldap-lib was given. +if test "${with_ldap_lib+set}" = set; then + withval=$with_ldap_lib; +fi + +if test -z "$with_ldap_lib" +then + with_ldap_lib=auto +fi + + +# Check whether --with-ldap-conf-file was given. +if test "${with_ldap_conf_file+set}" = set; then + withval=$with_ldap_conf_file; NSS_LDAP_PATH_CONF="$with_ldap_conf_file" +else + NSS_LDAP_PATH_CONF="/etc/nss-ldapd.conf" +fi + + +cat >>confdefs.h <<_ACEOF +#define NSS_LDAP_PATH_CONF "$NSS_LDAP_PATH_CONF" +_ACEOF + + + + +# Check whether --with-nslcd-pidfile was given. +if test "${with_nslcd_pidfile+set}" = set; then + withval=$with_nslcd_pidfile; NSLCD_PIDFILE="$with_nslcd_pidfile" +else + NSLCD_PIDFILE="/var/run/nslcd/nslcd.pid" +fi + + +cat >>confdefs.h <<_ACEOF +#define NSLCD_PIDFILE "$NSLCD_PIDFILE" +_ACEOF + + + + +# Check whether --with-nslcd-socket was given. +if test "${with_nslcd_socket+set}" = set; then + withval=$with_nslcd_socket; NSLCD_SOCKET="$with_nslcd_socket" +else + NSLCD_SOCKET="/var/run/nslcd/socket" +fi + + +cat >>confdefs.h <<_ACEOF +#define NSLCD_SOCKET "$NSLCD_SOCKET" +_ACEOF + + + +# checks for availability of header files + +for ac_header in lber.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in ldap.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #if HAVE_LBER_H + #include + #endif + + +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_Header=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: could not locate " >&5 +echo "$as_me: error: could not locate " >&2;} + { (exit 1); exit 1; }; } +fi + +done + + +for ac_header in ldap_ssl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in nss.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in pthread.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in shadow.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in aliases.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in netinet/ether.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in ctype.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in getopt.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/un.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in sasl.h sasl/sasl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in strings.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in gssldap.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in gsssasl.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + +for ac_header in gssapi/gssapi_krb5.h gssapi.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in grp.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/socket.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in sys/ucred.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +for ac_header in ucred.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ----------------------------------- ## +## Report this to arthur@ch.tudelft.nl ## +## ----------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +# set up directory with compatibility replacement files + + +# checks for availability of system libraries for nslcd +save_LIBS="$LIBS" +LIBS="$nslcd_LIBS" +{ echo "$as_me:$LINENO: checking for library containing gethostbyname" >&5 +echo $ECHO_N "checking for library containing gethostbyname... $ECHO_C" >&6; } +if test "${ac_cv_search_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gethostbyname (); +int +main () +{ +return gethostbyname (); + ; + return 0; +} +_ACEOF +for ac_lib in '' nsl socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_gethostbyname=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_gethostbyname+set}" = set; then + break +fi +done +if test "${ac_cv_search_gethostbyname+set}" = set; then + : +else + ac_cv_search_gethostbyname=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_search_gethostbyname" >&6; } +ac_res=$ac_cv_search_gethostbyname +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +{ echo "$as_me:$LINENO: checking for library containing socket" >&5 +echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; } +if test "${ac_cv_search_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_socket=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_socket+set}" = set; then + break +fi +done +if test "${ac_cv_search_socket+set}" = set; then + : +else + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5 +echo "${ECHO_T}$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +#AC_CHECK_LIB(resolv,main) +nslcd_LIBS="$LIBS" +LIBS="$save_LIBS" + +# check for availability of system libraries for nss part +save_LIBS="$LIBS" +LIBS="$nss_ldap_so_LIBS" +{ echo "$as_me:$LINENO: checking for library containing socket" >&5 +echo $ECHO_N "checking for library containing socket... $ECHO_C" >&6; } +if test "${ac_cv_search_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char socket (); +int +main () +{ +return socket (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_socket=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_socket+set}" = set; then + break +fi +done +if test "${ac_cv_search_socket+set}" = set; then + : +else + ac_cv_search_socket=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_socket" >&5 +echo "${ECHO_T}$ac_cv_search_socket" >&6; } +ac_res=$ac_cv_search_socket +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + +nss_ldap_so_LIBS="$LIBS" +LIBS="$save_LIBS" + +# TODO: simplify the above since we need a correct LIBS for the following +# tests + +# checks for availability of functions + +for ac_func in sigaction +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in snprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in gethostbyname +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in setgroups +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in getpeereid +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in getpeerucred +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in __nss_configure_lookup +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +# replace getopt_long() function if it is not on the system + +for ac_func in getopt_long +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac + +fi +done + + +# replace daemon() function if it is not on the system +{ echo "$as_me:$LINENO: checking for library containing daemon" >&5 +echo $ECHO_N "checking for library containing daemon... $ECHO_C" >&6; } +if test "${ac_cv_search_daemon+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char daemon (); +int +main () +{ +return daemon (); + ; + return 0; +} +_ACEOF +for ac_lib in '' bsd; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_daemon=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_daemon+set}" = set; then + break +fi +done +if test "${ac_cv_search_daemon+set}" = set; then + : +else + ac_cv_search_daemon=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_daemon" >&5 +echo "${ECHO_T}$ac_cv_search_daemon" >&6; } +ac_res=$ac_cv_search_daemon +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + +for ac_func in daemon +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" $ac_func.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS $ac_func.$ac_objext" + ;; +esac + +fi +done + + +# replace ether_ntoa_r() and ether_aton_r() if they are not found + + +for ac_func in ether_aton_r ether_ntoa_r +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + + +for ac_func in ether_aton ether_ntoa +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + case " $LIBOBJS " in + *" ether.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS ether.$ac_objext" + ;; +esac + +fi +done + + +# checks for types +{ echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; } +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset cs; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *pcpcc; + char **ppc; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + pcpcc = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++pcpcc; + ppc = (char**) pcpcc; + pcpcc = (char const *const *) ppc; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + if (s) return 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + if (!foo) return 0; + } + return !cs[0] && !zero.x; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_const=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6; } +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\_ACEOF +#define const +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; } +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +return *(signal (0, 0)) (0) == 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_signal=int +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_signal=void +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + +{ echo "$as_me:$LINENO: checking for mode_t" >&5 +echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; } +if test "${ac_cv_type_mode_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef mode_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_mode_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_mode_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5 +echo "${ECHO_T}$ac_cv_type_mode_t" >&6; } +if test $ac_cv_type_mode_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define mode_t int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for size_t" >&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6; } +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef size_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_size_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6; } +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <<_ACEOF +#define size_t unsigned int +_ACEOF + +fi + +{ echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5 +echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; } +if test "${ac_cv_type_uid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "uid_t" >/dev/null 2>&1; then + ac_cv_type_uid_t=yes +else + ac_cv_type_uid_t=no +fi +rm -f conftest* + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5 +echo "${ECHO_T}$ac_cv_type_uid_t" >&6; } +if test $ac_cv_type_uid_t = no; then + +cat >>confdefs.h <<\_ACEOF +#define uid_t int +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define gid_t int +_ACEOF + +fi + + +# check for support for the __thread keyword +{ echo "$as_me:$LINENO: checking whether $CC supports '__thread'" >&5 +echo $ECHO_N "checking whether $CC supports '__thread'... $ECHO_C" >&6; } +if test "${mn_cv_c___thread_supported+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +static __thread i; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + mn_cv_c___thread_supported=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + mn_cv_c___thread_supported=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $mn_cv_c___thread_supported" >&5 +echo "${ECHO_T}$mn_cv_c___thread_supported" >&6; } +if test $mn_cv_c___thread_supported != yes +then + { echo "$as_me:$LINENO: WARNING: $CC does not support '__thread' keyword" >&5 +echo "$as_me: WARNING: $CC does not support '__thread' keyword" >&2;} + +cat >>confdefs.h <<\_ACEOF +#define __thread +_ACEOF + +fi + +# check for support for the struct ether_addr structure +{ echo "$as_me:$LINENO: checking for struct ether_addr" >&5 +echo $ECHO_N "checking for struct ether_addr... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_ether_addr+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + #include + #include + +typedef struct ether_addr ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_ether_addr=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_ether_addr=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_ether_addr" >&5 +echo "${ECHO_T}$ac_cv_type_struct_ether_addr" >&6; } +if test $ac_cv_type_struct_ether_addr = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_ETHER_ADDR 1 +_ACEOF + +fi + + +# check to see if socklen_t is defined +{ echo "$as_me:$LINENO: checking for socklen_t" >&5 +echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6; } +if test "${ac_cv_type_socklen_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + +typedef socklen_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_socklen_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_socklen_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_socklen_t" >&5 +echo "${ECHO_T}$ac_cv_type_socklen_t" >&6; } +if test $ac_cv_type_socklen_t = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define socklen_t size_t +_ACEOF + +fi + + +# check to see if struct sockaddr_storage is defined +{ echo "$as_me:$LINENO: checking for struct sockaddr_storage" >&5 +echo $ECHO_N "checking for struct sockaddr_storage... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_sockaddr_storage+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + +typedef struct sockaddr_storage ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_sockaddr_storage=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_sockaddr_storage=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_sockaddr_storage" >&5 +echo "${ECHO_T}$ac_cv_type_struct_sockaddr_storage" >&6; } +if test $ac_cv_type_struct_sockaddr_storage = yes; then + : +else + +cat >>confdefs.h <<\_ACEOF +#define sockaddr_storage sockaddr_in +_ACEOF + +fi + + +# check for support for the struct ucred structure +{ echo "$as_me:$LINENO: checking for struct ucred" >&5 +echo $ECHO_N "checking for struct ucred... $ECHO_C" >&6; } +if test "${ac_cv_type_struct_ucred+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include + #include + +typedef struct ucred ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_struct_ucred=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_struct_ucred=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_struct_ucred" >&5 +echo "${ECHO_T}$ac_cv_type_struct_ucred" >&6; } +if test $ac_cv_type_struct_ucred = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_STRUCT_UCRED 1 +_ACEOF + +fi + + +{ echo "$as_me:$LINENO: checking for sasl_interact_t" >&5 +echo $ECHO_N "checking for sasl_interact_t... $ECHO_C" >&6; } +if test "${ac_cv_type_sasl_interact_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef sasl_interact_t ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_sasl_interact_t=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_sasl_interact_t=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_sasl_interact_t" >&5 +echo "${ECHO_T}$ac_cv_type_sasl_interact_t" >&6; } +if test $ac_cv_type_sasl_interact_t = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_SASL_INTERACT_T 1 +_ACEOF + +fi + + +# checks for LDAP library +save_LIBS="$LIBS" +LIBS="$nslcd_LIBS" +save_CFLAGS="$CFLAGS" + +# check threading stuff + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + { echo "$as_me:$LINENO: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5 +echo $ECHO_N "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... $ECHO_C" >&6; } + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pthread_join (); +int +main () +{ +return pthread_join (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + acx_pthread_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6; } + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + { echo "$as_me:$LINENO: checking whether pthreads work without any flags" >&5 +echo $ECHO_N "checking whether pthreads work without any flags... $ECHO_C" >&6; } + ;; + + -*) + { echo "$as_me:$LINENO: checking whether pthreads work with $flag" >&5 +echo $ECHO_N "checking whether pthreads work with $flag... $ECHO_C" >&6; } + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + # Extract the first word of "pthread-config", so it can be a program name with args. +set dummy pthread-config; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_acx_pthread_config+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$acx_pthread_config"; then + ac_cv_prog_acx_pthread_config="$acx_pthread_config" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_acx_pthread_config="yes" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + test -z "$ac_cv_prog_acx_pthread_config" && ac_cv_prog_acx_pthread_config="no" +fi +fi +acx_pthread_config=$ac_cv_prog_acx_pthread_config +if test -n "$acx_pthread_config"; then + { echo "$as_me:$LINENO: result: $acx_pthread_config" >&5 +echo "${ECHO_T}$acx_pthread_config" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + { echo "$as_me:$LINENO: checking for the pthreads library -l$flag" >&5 +echo $ECHO_N "checking for the pthreads library -l$flag... $ECHO_C" >&6; } + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + acx_pthread_ok=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + { echo "$as_me:$LINENO: result: $acx_pthread_ok" >&5 +echo "${ECHO_T}$acx_pthread_ok" >&6; } + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + { echo "$as_me:$LINENO: checking for joinable pthread attribute" >&5 +echo $ECHO_N "checking for joinable pthread attribute... $ECHO_C" >&6; } + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +int attr=$attr; return attr; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + attr_name=$attr; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + done + { echo "$as_me:$LINENO: result: $attr_name" >&5 +echo "${ECHO_T}$attr_name" >&6; } + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + +cat >>confdefs.h <<_ACEOF +#define PTHREAD_CREATE_JOINABLE $attr_name +_ACEOF + + fi + + { echo "$as_me:$LINENO: checking if more special flags are required for pthreads" >&5 +echo $ECHO_N "checking if more special flags are required for pthreads... $ECHO_C" >&6; } + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + { echo "$as_me:$LINENO: result: ${flag}" >&5 +echo "${ECHO_T}${flag}" >&6; } + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + for ac_prog in xlc_r cc_r +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_PTHREAD_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$PTHREAD_CC"; then + ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PTHREAD_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +PTHREAD_CC=$ac_cv_prog_PTHREAD_CC +if test -n "$PTHREAD_CC"; then + { echo "$as_me:$LINENO: result: $PTHREAD_CC" >&5 +echo "${ECHO_T}$PTHREAD_CC" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$PTHREAD_CC" && break +done +test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}" + + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + + + + + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_PTHREAD 1 +_ACEOF + + : +else + acx_pthread_ok=no + { { echo "$as_me:$LINENO: error: no support for pthreads" >&5 +echo "$as_me: error: no support for pthreads" >&2;} + { (exit 1); exit 1; }; } +fi +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +for ac_func in pthread_atfork +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +LIBS="$PTHREAD_LIBS $LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + +{ echo "$as_me:$LINENO: checking for gss_krb5_ccache_name in -lgssapi" >&5 +echo $ECHO_N "checking for gss_krb5_ccache_name in -lgssapi... $ECHO_C" >&6; } +if test "${ac_cv_lib_gssapi_gss_krb5_ccache_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgssapi $LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gss_krb5_ccache_name (); +int +main () +{ +return gss_krb5_ccache_name (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gssapi_gss_krb5_ccache_name=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gssapi_gss_krb5_ccache_name=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_gss_krb5_ccache_name" >&5 +echo "${ECHO_T}$ac_cv_lib_gssapi_gss_krb5_ccache_name" >&6; } +if test $ac_cv_lib_gssapi_gss_krb5_ccache_name = yes; then + LIBS="-lgssapi $LIBS" found_gssapi_lib=yes +fi + +if test -z "$found_gssapi_lib" +then + { echo "$as_me:$LINENO: checking for gss_krb5_ccache_name in -lgssapi_krb5" >&5 +echo $ECHO_N "checking for gss_krb5_ccache_name in -lgssapi_krb5... $ECHO_C" >&6; } +if test "${ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgssapi_krb5 $LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char gss_krb5_ccache_name (); +int +main () +{ +return gss_krb5_ccache_name (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name" >&5 +echo "${ECHO_T}$ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name" >&6; } +if test $ac_cv_lib_gssapi_krb5_gss_krb5_ccache_name = yes; then + LIBS="-lgssapi_krb5 $LIBS" +fi + +fi + +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \) +then + { echo "$as_me:$LINENO: checking for library containing ldap_search_ext" >&5 +echo $ECHO_N "checking for library containing ldap_search_ext... $ECHO_C" >&6; } +if test "${ac_cv_search_ldap_search_ext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_func_search_save_LIBS=$LIBS +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ldap_search_ext (); +int +main () +{ +return ldap_search_ext (); + ; + return 0; +} +_ACEOF +for ac_lib in '' ldap_r ldap; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_search_ldap_search_ext=$ac_res +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext + if test "${ac_cv_search_ldap_search_ext+set}" = set; then + break +fi +done +if test "${ac_cv_search_ldap_search_ext+set}" = set; then + : +else + ac_cv_search_ldap_search_ext=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_search_ldap_search_ext" >&5 +echo "${ECHO_T}$ac_cv_search_ldap_search_ext" >&6; } +ac_res=$ac_cv_search_ldap_search_ext +if test "$ac_res" != no; then + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + found_ldap_lib=yes +fi + +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \) +then + { echo "$as_me:$LINENO: checking for main in -lldap50" >&5 +echo $ECHO_N "checking for main in -lldap50... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldap50_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap50 -lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldap50_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldap50_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap50_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap50_main" >&6; } +if test $ac_cv_lib_ldap50_main = yes; then + LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=yes +fi + +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \) +then + { echo "$as_me:$LINENO: checking for main in -lldapssl41" >&5 +echo $ECHO_N "checking for main in -lldapssl41... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldapssl41_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldapssl41 -lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldapssl41_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldapssl41_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldapssl41_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldapssl41_main" >&6; } +if test $ac_cv_lib_ldapssl41_main = yes; then + LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=yes +fi + + if test -z "$found_ldap_lib" + then + { echo "$as_me:$LINENO: checking for main in -lldapssl40" >&5 +echo $ECHO_N "checking for main in -lldapssl40... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldapssl40_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldapssl40 -lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldapssl40_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldapssl40_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldapssl40_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldapssl40_main" >&6; } +if test $ac_cv_lib_ldapssl40_main = yes; then + LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=yes +fi + + fi + if test -z "$found_ldap_lib" + then + { echo "$as_me:$LINENO: checking for main in -lldap41" >&5 +echo $ECHO_N "checking for main in -lldap41... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldap41_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap41 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldap41_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldap41_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap41_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap41_main" >&6; } +if test $ac_cv_lib_ldap41_main = yes; then + LIBS="-lldap41 $LIBS" found_ldap_lib=yes need_pthread=no +fi + + fi + if test -z "$found_ldap_lib" + then + { echo "$as_me:$LINENO: checking for main in -lldap40" >&5 +echo $ECHO_N "checking for main in -lldap40... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldap40_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldap40 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldap40_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldap40_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldap40_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldap40_main" >&6; } +if test $ac_cv_lib_ldap40_main = yes; then + LIBS="-lldap40 $LIBS" found_ldap_lib=yes need_pthread=no +fi + + fi +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \) +then + { echo "$as_me:$LINENO: checking for main in -lldapssl30" >&5 +echo $ECHO_N "checking for main in -lldapssl30... $ECHO_C" >&6; } +if test "${ac_cv_lib_ldapssl30_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lldapssl30 -lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_ldapssl30_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_ldapssl30_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ldapssl30_main" >&5 +echo "${ECHO_T}$ac_cv_lib_ldapssl30_main" >&6; } +if test $ac_cv_lib_ldapssl30_main = yes; then + LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=yes +fi + +fi +if test -z "$found_ldap_lib" +then + { { echo "$as_me:$LINENO: error: could not locate a valid LDAP library" >&5 +echo "$as_me: error: could not locate a valid LDAP library" >&2;} + { (exit 1); exit 1; }; } +fi +if test "$need_pthread" = "yes" +then + +{ echo "$as_me:$LINENO: checking for main in -lpthread" >&5 +echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; } +if test "${ac_cv_lib_pthread_main+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + +int +main () +{ +return main (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_pthread_main=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_pthread_main=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; } +if test $ac_cv_lib_pthread_main = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPTHREAD 1 +_ACEOF + + LIBS="-lpthread $LIBS" + +fi + +fi +{ echo "$as_me:$LINENO: checking for ldap_gss_bind in -lgssldap" >&5 +echo $ECHO_N "checking for ldap_gss_bind in -lgssldap... $ECHO_C" >&6; } +if test "${ac_cv_lib_gssldap_ldap_gss_bind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgssldap $LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char ldap_gss_bind (); +int +main () +{ +return ldap_gss_bind (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_gssldap_ldap_gss_bind=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_gssldap_ldap_gss_bind=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_gssldap_ldap_gss_bind" >&5 +echo "${ECHO_T}$ac_cv_lib_gssldap_ldap_gss_bind" >&6; } +if test $ac_cv_lib_gssldap_ldap_gss_bind = yes; then + LIBS="-lgssldap $LIBS" +fi + + +{ echo "$as_me:$LINENO: checking for sasl_client_init in -lsasl2" >&5 +echo $ECHO_N "checking for sasl_client_init in -lsasl2... $ECHO_C" >&6; } +if test "${ac_cv_lib_sasl2_sasl_client_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsasl2 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char sasl_client_init (); +int +main () +{ +return sasl_client_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_sasl2_sasl_client_init=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_sasl2_sasl_client_init=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_sasl2_sasl_client_init" >&5 +echo "${ECHO_T}$ac_cv_lib_sasl2_sasl_client_init" >&6; } +if test $ac_cv_lib_sasl2_sasl_client_init = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBSASL2 1 +_ACEOF + + LIBS="-lsasl2 $LIBS" + +fi + + + +for ac_func in sasl_auxprop_request +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in gss_krb5_ccache_name +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +for ac_func in ldap_parse_result ldap_memfree ldap_controls_free ldap_control_free +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +for ac_func in ldap_explode_dn ldap_explode_rdn ldap_set_option ldap_get_option +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + + +for ac_func in ldap_abandon ldap_simple_bind_s ldap_unbind ldap_set_rebind_proc +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +for ac_func in ldap_sasl_interactive_bind_s ldap_initialize ldap_search_ext +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +for ac_func in ldap_create_control +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + +for ac_func in ldap_domain2hostlist ldap_domain2dn +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +for ac_func in ldap_get_values ldap_value_free ldap_get_dn +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + + + +for ac_func in ldap_err2string ldap_msgfree ldap_result +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + +# replace ldap_create_page_control() and ldap_parse_page_control() + + +for ac_func in ldap_create_page_control ldap_parse_page_control +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + case " $LIBOBJS " in + *" pagectrl.$ac_objext "* ) ;; + *) LIBOBJS="$LIBOBJS pagectrl.$ac_objext" + ;; +esac + +fi +done + + +# check the number of arguments that ldap_set_rebind_proc() uses +{ echo "$as_me:$LINENO: checking number of arguments to ldap_set_rebind_proc" >&5 +echo $ECHO_N "checking number of arguments to ldap_set_rebind_proc... $ECHO_C" >&6; } +if test "${nss_ldapd_cv_ldap_set_rebind_proc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + + #include + #include +int +main () +{ +ldap_set_rebind_proc(0, 0, 0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + nss_ldapd_cv_ldap_set_rebind_proc=3 +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + nss_ldapd_cv_ldap_set_rebind_proc=2 +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $nss_ldapd_cv_ldap_set_rebind_proc" >&5 +echo "${ECHO_T}$nss_ldapd_cv_ldap_set_rebind_proc" >&6; } + +cat >>confdefs.h <<_ACEOF +#define LDAP_SET_REBIND_PROC_ARGS $nss_ldapd_cv_ldap_set_rebind_proc +_ACEOF + + +CFLAGS="$save_CFLAGS" +nslcd_LIBS="$LIBS" +LIBS="$save_LIBS" + + + + +# generate files +ac_config_files="$ac_config_files Makefile compat/Makefile common/Makefile nss/Makefile nslcd/Makefile man/Makefile tests/Makefile" + +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overridden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, we kill variables containing newlines. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + + (set) 2>&1 | + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + ;; + esac | + sort +) | + sed ' + /^ac_cv_env_/b end + t clear + :clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} + cat confcache >$cache_file + else + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +DEFS=-DHAVE_CONFIG_H + +ac_libobjs= +ac_ltlibobjs= +for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue + # 1. Remove the extension, and $U if already installed. + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' +done +LIBOBJS=$ac_libobjs + +LTLIBOBJS=$ac_ltlibobjs + + +if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"AMDEP\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi +if test -z "${GENMAN_TRUE}" && test -z "${GENMAN_FALSE}"; then + { { echo "$as_me:$LINENO: error: conditional \"GENMAN\" was never defined. +Usually this means the macro was only invoked conditionally." >&5 +echo "$as_me: error: conditional \"GENMAN\" was never defined. +Usually this means the macro was only invoked conditionally." >&2;} + { (exit 1); exit 1; }; } +fi + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +ac_cs_recheck=false +ac_cs_silent=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh +fi + +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | + sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno + N + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + t loop + s/-\n.*// + ' >$as_me.lineno && + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" + # Exit status is that of the last command. + exit +} + + +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; +esac + +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null + +if mkdir -p . 2>/dev/null; then + as_mkdir_p=: +else + test -d ./-p && rmdir ./-p + as_mkdir_p=false +fi + +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" + + +exec 6>&1 + +# Save the log message, to keep $[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. +ac_log=" +This file was extended by nss-ldapd $as_me 0.6.2, which was +generated by GNU Autoconf 2.61. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# Files that config.status was made for. +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_commands="$ac_config_commands" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number and configuration settings, then exit + -q, --quiet do not print progress messages + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +nss-ldapd config.status 0.6.2 +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" + +Copyright (C) 2006 Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' +MKDIR_P='$MKDIR_P' +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_shift=: + ;; + *) + ac_option=$1 + ac_optarg=$2 + ac_shift=shift + ;; + esac + + case $ac_option in + # Handling of the options. + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + ac_cs_recheck=: ;; + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + $ac_shift + CONFIG_FILES="$CONFIG_FILES $ac_optarg" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + $ac_shift + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil | --si | --s) + ac_cs_silent=: ;; + + # This is an error. + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; + + esac + shift +done + +ac_configure_extra_args= + +if $ac_cs_silent; then + exec 6>/dev/null + ac_configure_extra_args="$ac_configure_extra_args --silent" +fi + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +if \$ac_cs_recheck; then + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +fi + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 + +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS +# +AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. +for ac_config_target in $ac_config_targets +do + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "compat/Makefile") CONFIG_FILES="$CONFIG_FILES compat/Makefile" ;; + "common/Makefile") CONFIG_FILES="$CONFIG_FILES common/Makefile" ;; + "nss/Makefile") CONFIG_FILES="$CONFIG_FILES nss/Makefile" ;; + "nslcd/Makefile") CONFIG_FILES="$CONFIG_FILES nslcd/Makefile" ;; + "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Have a temporary directory for convenience. Make it in the build tree +# simply because there is no reason against having it here, and in addition, +# creating and moving files from /tmp can sometimes cause problems. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. +$debug || +{ + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} +# Create a (secure) tmp directory for tmp files. + +{ + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") +} || +{ + echo "$me: cannot create a temporary directory in ." >&2 + { (exit 1); exit 1; } +} + +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "$CONFIG_FILES"; then + +_ACEOF + + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +RELEASE_MONTH!$RELEASE_MONTH$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +am__isrc!$am__isrc$ac_delim +CYGPATH_W!$CYGPATH_W$ac_delim +PACKAGE!$PACKAGE$ac_delim +VERSION!$VERSION$ac_delim +ACLOCAL!$ACLOCAL$ac_delim +AUTOCONF!$AUTOCONF$ac_delim +AUTOMAKE!$AUTOMAKE$ac_delim +AUTOHEADER!$AUTOHEADER$ac_delim +MAKEINFO!$MAKEINFO$ac_delim +install_sh!$install_sh$ac_delim +STRIP!$STRIP$ac_delim +INSTALL_STRIP_PROGRAM!$INSTALL_STRIP_PROGRAM$ac_delim +mkdir_p!$mkdir_p$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +am__leading_dot!$am__leading_dot$ac_delim +AMTAR!$AMTAR$ac_delim +am__tar!$am__tar$ac_delim +am__untar!$am__untar$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +DEPDIR!$DEPDIR$ac_delim +am__include!$am__include$ac_delim +am__quote!$am__quote$ac_delim +AMDEP_TRUE!$AMDEP_TRUE$ac_delim +AMDEP_FALSE!$AMDEP_FALSE$ac_delim +AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim +CCDEPMODE!$CCDEPMODE$ac_delim +am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim +am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim +CPP!$CPP$ac_delim +RANLIB!$RANLIB$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +DOCBOOK2X_MAN!$DOCBOOK2X_MAN$ac_delim +GENMAN_TRUE!$GENMAN_TRUE$ac_delim +GENMAN_FALSE!$GENMAN_FALSE$ac_delim +NSS_LDAP_PATH_CONF!$NSS_LDAP_PATH_CONF$ac_delim +NSLCD_PIDFILE!$NSLCD_PIDFILE$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof +_ACEOF + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +NSLCD_SOCKET!$NSLCD_SOCKET$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +acx_pthread_config!$acx_pthread_config$ac_delim +PTHREAD_CC!$PTHREAD_CC$ac_delim +PTHREAD_LIBS!$PTHREAD_LIBS$ac_delim +PTHREAD_CFLAGS!$PTHREAD_CFLAGS$ac_delim +nss_ldap_so_LIBS!$nss_ldap_so_LIBS$ac_delim +nslcd_LIBS!$nslcd_LIBS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 9; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-2.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; + esac + + ac_dir=`$as_dirname -- "$ac_file" || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + ac_builddir=. + +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix + +case $srcdir in + .) # We are building in place. + ac_srcdir=. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; +esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + + case $ac_mode in + :F) + # + # CONFIG_FILE + # + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + esac + ac_MKDIR_P=$MKDIR_P + case $MKDIR_P in + [\\/$]* | ?:[\\/]* ) ;; + */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; + esac +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +s&@MKDIR_P@&$ac_MKDIR_P&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed -f "$tmp/subs-2.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; + :H) + # + # CONFIG_HEADER + # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF + if test x"$ac_file" != x-; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + rm -f $ac_file + mv "$tmp/config.h" $ac_file + fi + else + echo "/* $configure_input */" + cat "$ac_result" + fi + rm -f "$tmp/out12" +# Compute $ac_file's index in $config_headers. +_am_arg=$ac_file +_am_stamp_count=1 +for _am_header in $config_headers :; do + case $_am_header in + $_am_arg | $_am_arg:* ) + break ;; + * ) + _am_stamp_count=`expr $_am_stamp_count + 1` ;; + esac +done +echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || +$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$_am_arg" : 'X\(//\)[^/]' \| \ + X"$_am_arg" : 'X\(//\)$' \| \ + X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || +echo X"$_am_arg" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'`/stamp-h$_am_stamp_count + ;; + + :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 +echo "$as_me: executing $ac_file commands" >&6;} + ;; + esac + + + case $ac_file$ac_mode in + "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do + # Strip MF so we end up with the name of the file. + mf=`echo "$mf" | sed -e 's/:.*$//'` + # Check whether this is an Automake generated Makefile or not. + # We used to match only the files named `Makefile.in', but + # some people rename them; so instead we look at the file content. + # Grep'ing the first line is not enough: some people post-process + # each Makefile.in and add a new line on top of each file to say so. + # Grep'ing the whole file is not good either: AIX grep has a line + # limit of 2048, but all sed's we know have understand at least 4000. + if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then + dirpart=`$as_dirname -- "$mf" || +$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$mf" : 'X\(//\)[^/]' \| \ + X"$mf" : 'X\(//\)$' \| \ + X"$mf" : 'X\(/\)' \| . 2>/dev/null || +echo X"$mf" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + else + continue + fi + # Extract the definition of DEPDIR, am__include, and am__quote + # from the Makefile without running `make'. + DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` + test -z "$DEPDIR" && continue + am__include=`sed -n 's/^am__include = //p' < "$mf"` + test -z "am__include" && continue + am__quote=`sed -n 's/^am__quote = //p' < "$mf"` + # When using ansi2knr, U may be empty or an underscore; expand it + U=`sed -n 's/^U = //p' < "$mf"` + # Find all dependency output files, they are included files with + # $(DEPDIR) in their names. We invoke sed twice because it is the + # simplest approach to changing $(DEPDIR) to its actual value in the + # expansion. + for file in `sed -n " + s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ + sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do + # Make sure the directory exists. + test -f "$dirpart/$file" && continue + fdir=`$as_dirname -- "$file" || +$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$file" : 'X\(//\)[^/]' \| \ + X"$file" : 'X\(//\)$' \| \ + X"$file" : 'X\(/\)' \| . 2>/dev/null || +echo X"$file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir=$dirpart/$fdir + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + as_dirs= + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break + done + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} + { (exit 1); exit 1; }; }; } + # echo "creating $dirpart/$file" + echo '# dummy' > "$dirpart/$file" + done +done + ;; + + esac +done # for ac_tag + + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + ac_config_status_args= + test "$silent" = yes && + ac_config_status_args="$ac_config_status_args --quiet" + exec 5>/dev/null + $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/configure.ac b/contrib/slapd-modules/nssov/nss-ldapd/configure.ac new file mode 100644 index 0000000000..e263c2936c --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/configure.ac @@ -0,0 +1,350 @@ +# configure.ac - process this file with autoconf to produce configure +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +AC_PREREQ(2.59) +AC_COPYRIGHT( +[Copyright (C) 2006 Luke Howard +Copyright (C) 2006 West Consulting +Copyright (C) 2006, 2007, 2008 Arthur de Jong + +This configure script is derived from configure.ac which is free software; +you can redistribute it and/or modify it under the terms of the GNU Lesser +General Public License as published by the Free Software Foundation; either +version 2.1 of the License, or (at your option) any later version. See the +configure.ac file for more details.]) + +# initialize and set version and bugreport address +AC_INIT([nss-ldapd],[0.6.2],[arthur@ch.tudelft.nl]) +RELEASE_MONTH="May 2008" +AC_SUBST(RELEASE_MONTH) +AC_CONFIG_SRCDIR([nslcd.h]) + +AC_CANONICAL_TARGET +AC_PREFIX_DEFAULT() + +# display notice and initialize automake +AC_MSG_NOTICE([configuring AC_PACKAGE_TARNAME AC_PACKAGE_VERSION]) +AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME,AC_PACKAGE_VERSION) + +# create a config.h file (Automake will add -DHAVE_CONFIG_H) +AC_CONFIG_HEADERS([config.h]) + +# check for programs +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_RANLIB +AM_PROG_CC_C_O +AC_USE_SYSTEM_EXTENSIONS + +# checks for tool to convert docbook to man +AC_PATH_PROGS(DOCBOOK2X_MAN, docbook2x-man) +if test "x${DOCBOOK2X_MAN}" = x +then + AC_MSG_WARN([docbook2x-man not found: not generating man pages]) +fi +AM_CONDITIONAL([GENMAN], [test "x${DOCBOOK2X_MAN}" != x]) + +# start with default options +nss_ldap_so_LIBS= +nslcd_LIBS= + +# check for debugging options +AC_ARG_ENABLE(debug, + AS_HELP_STRING([--enable-debug], + [enable extensive debugging and logging]), + [if test "x$enableval" != "xno" ; then CFLAGS="-g -DDEBUG $CFLAGS" ; fi]) + +DESIRED_CFLAGS="" + +# check for extra compiler warnings +AC_ARG_ENABLE(warnings, + AS_HELP_STRING([--enable-warnings], + [enable extra compiler warnings (gcc)]), + [if test "x$enableval" != "no" + then + CFLAGS="$CFLAGS -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wcast-align -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Waggregate-return -Wmissing-declarations -Wunused -Wformat=2 -Wswitch-default -Wswitch-enum -Wfloat-equal -Wbad-function-cast -Wunreachable-code -Wredundant-decls" + DESIRED_CFLAGS="$DESIRED_CFLAGS -Wextra -Wdeclaration-after-statement -Werror-implicit-function-declaration" + fi]) + +test_gcc_flag() { + AC_LANG_CONFTEST([int main() {}]) + $CC -c conftest.c $CFLAGS $@ > /dev/null 2> /dev/null + ret=$? + rm -f conftest.o + return $ret +} + +for flag in $DESIRED_CFLAGS +do + AC_MSG_CHECKING([whether $CC accepts $flag]) + if test_gcc_flag $flag + then + CFLAGS="$CFLAGS $flag" + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + fi +done + +AC_ARG_WITH(ldap-lib, + AS_HELP_STRING([--with-ldap-lib=TYPE], + [select ldap library (auto|netscape5|netscape4|netscape3|umich|openldap) @<:@auto@:>@])) +if test -z "$with_ldap_lib" +then + with_ldap_lib=auto +fi + +AC_ARG_WITH(ldap-conf-file, + AS_HELP_STRING([--with-ldap-conf-file=PATH], + [path to LDAP configuration file @<:@/etc/nss-ldapd.conf@:>@]), + [ NSS_LDAP_PATH_CONF="$with_ldap_conf_file" ], + [ NSS_LDAP_PATH_CONF="/etc/nss-ldapd.conf" ]) +AC_DEFINE_UNQUOTED(NSS_LDAP_PATH_CONF,"$NSS_LDAP_PATH_CONF",[Path to LDAP configuration file.]) +AC_SUBST(NSS_LDAP_PATH_CONF) + +AC_ARG_WITH(nslcd-pidfile, + AS_HELP_STRING([--with-nslcd-pidfile=PATH], + [path to pidfile @<:@/var/run/nslcd/nslcd.pid@:>@]), + [ NSLCD_PIDFILE="$with_nslcd_pidfile" ], + [ NSLCD_PIDFILE="/var/run/nslcd/nslcd.pid" ]) +AC_DEFINE_UNQUOTED(NSLCD_PIDFILE,"$NSLCD_PIDFILE",[The location of the pidfile used for checking availability of the nslcd.]) +AC_SUBST(NSLCD_PIDFILE) + +AC_ARG_WITH(nslcd-socket, + AS_HELP_STRING([--with-nslcd-socket=PATH], + [path to socket @<:@/var/run/nslcd/socket@:>@]), + [ NSLCD_SOCKET="$with_nslcd_socket" ], + [ NSLCD_SOCKET="/var/run/nslcd/socket" ]) +AC_DEFINE_UNQUOTED(NSLCD_SOCKET,"$NSLCD_SOCKET",[The location of the socket used for communicating.]) +AC_SUBST(NSLCD_SOCKET) + +# checks for availability of header files +AC_CHECK_HEADERS(lber.h) +AC_CHECK_HEADERS(ldap.h,,AC_MSG_ERROR([could not locate ]),[ + #if HAVE_LBER_H + #include + #endif + ]) +AC_CHECK_HEADERS(ldap_ssl.h) +AC_CHECK_HEADERS(nss.h) +AC_CHECK_HEADERS(pthread.h) +AC_CHECK_HEADERS(shadow.h) +AC_CHECK_HEADERS(aliases.h) +AC_CHECK_HEADERS(netinet/ether.h) +AC_CHECK_HEADERS(ctype.h) +AC_CHECK_HEADERS(getopt.h) +AC_CHECK_HEADERS(sys/un.h) +AC_CHECK_HEADERS(sasl.h sasl/sasl.h) +AC_CHECK_HEADERS(strings.h) +AC_CHECK_HEADERS(gssldap.h) +AC_CHECK_HEADERS(gsssasl.h) +AC_CHECK_HEADERS(gssapi/gssapi_krb5.h gssapi.h) +AC_CHECK_HEADERS(grp.h) +AC_CHECK_HEADERS(sys/socket.h) +AC_CHECK_HEADERS(sys/ucred.h) +AC_CHECK_HEADERS(ucred.h) + +# set up directory with compatibility replacement files +AC_CONFIG_LIBOBJ_DIR([compat]) + +# checks for availability of system libraries for nslcd +save_LIBS="$LIBS" +LIBS="$nslcd_LIBS" +AC_SEARCH_LIBS(gethostbyname,nsl socket) +AC_SEARCH_LIBS(socket,socket) +#AC_CHECK_LIB(resolv,main) +nslcd_LIBS="$LIBS" +LIBS="$save_LIBS" + +# check for availability of system libraries for nss part +save_LIBS="$LIBS" +LIBS="$nss_ldap_so_LIBS" +AC_SEARCH_LIBS(socket,socket) +nss_ldap_so_LIBS="$LIBS" +LIBS="$save_LIBS" + +# TODO: simplify the above since we need a correct LIBS for the following +# tests + +# checks for availability of functions +AC_CHECK_FUNCS(sigaction) +AC_CHECK_FUNCS(snprintf) +AC_CHECK_FUNCS(gethostbyname) +AC_CHECK_FUNCS(setgroups) +AC_CHECK_FUNCS(getpeereid) +AC_CHECK_FUNCS(getpeerucred) +AC_CHECK_FUNCS(__nss_configure_lookup) + + +# replace getopt_long() function if it is not on the system +AC_REPLACE_FUNCS(getopt_long) +# replace daemon() function if it is not on the system +AC_SEARCH_LIBS(daemon,bsd) +AC_REPLACE_FUNCS(daemon) +# replace ether_ntoa_r() and ether_aton_r() if they are not found +AC_CHECK_FUNCS(ether_aton_r ether_ntoa_r,,[AC_CHECK_FUNCS(ether_aton ether_ntoa) + AC_LIBOBJ(ether)]) + +# checks for types +AC_C_CONST +AC_TYPE_SIGNAL +AC_TYPE_MODE_T +AC_TYPE_SIZE_T +AC_TYPE_UID_T + +# check for support for the __thread keyword +AC_CACHE_CHECK([whether $CC supports '__thread'], [mn_cv_c___thread_supported], + [AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[static __thread i;]], []), + [mn_cv_c___thread_supported=yes], + [mn_cv_c___thread_supported=no])]) +if test $mn_cv_c___thread_supported != yes +then + AC_MSG_WARN([$CC does not support '__thread' keyword]) + AC_DEFINE(__thread,,[Define to empty if compiler does not support `__thread' keyword.]) +fi + +# check for support for the struct ether_addr structure +AC_CHECK_TYPE(struct ether_addr, + AC_DEFINE(HAVE_STRUCT_ETHER_ADDR,1,[Define to 1 if you have a `struct ether_addr' definition.]),,[ + #include + #include + #include + #include ]) + +# check to see if socklen_t is defined +AC_CHECK_TYPE(socklen_t,, + AC_DEFINE(socklen_t,size_t,[Define to `size_t' if not defined elswhere.]),[ + #include + #include ]) + +# check to see if struct sockaddr_storage is defined +AC_CHECK_TYPE(struct sockaddr_storage,, + AC_DEFINE(sockaddr_storage,sockaddr_in,[Define to `sockaddr_in' if not defined elsewhere.]),[ + #include + #include ]) + +# check for support for the struct ucred structure +AC_CHECK_TYPE(struct ucred, + AC_DEFINE(HAVE_STRUCT_UCRED,1,[Define to 1 if you have a `struct ucred' definition.]),,[ + #include + #include + #include ]) + +AC_CHECK_TYPE(sasl_interact_t, + AC_DEFINE(HAVE_SASL_INTERACT_T,1,[Define to 1 if you have a `sasl_interact_t' definition.])) + +# checks for LDAP library +save_LIBS="$LIBS" +LIBS="$nslcd_LIBS" +save_CFLAGS="$CFLAGS" + +# check threading stuff +ACX_PTHREAD(,AC_MSG_ERROR([no support for pthreads])) +AC_CHECK_FUNCS(pthread_atfork) + +LIBS="$PTHREAD_LIBS $LIBS" +CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + +AC_CHECK_LIB(gssapi, gss_krb5_ccache_name,[LIBS="-lgssapi $LIBS" found_gssapi_lib=yes],,$LIBS) +if test -z "$found_gssapi_lib" +then + AC_CHECK_LIB(gssapi_krb5, gss_krb5_ccache_name,[LIBS="-lgssapi_krb5 $LIBS"],,$LIBS) +fi + +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = umich -o $with_ldap_lib = openldap \) +then + AC_SEARCH_LIBS(ldap_search_ext,[ldap_r ldap],found_ldap_lib=yes,,) +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape5 \) +then + AC_CHECK_LIB(ldap50, main, LIBS="-lldap50 -lssldap50 -lssl3 -lnss3 -lnspr4 -lprldap50 -lplc4 -lplds4 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread) +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape4 \) +then + AC_CHECK_LIB(ldapssl41, main, LIBS="-lldapssl41 -lplc3 -lplds3 -lnspr3 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread) + if test -z "$found_ldap_lib" + then + AC_CHECK_LIB(ldapssl40, main, LIBS="-lldapssl40 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread) + fi + if test -z "$found_ldap_lib" + then + AC_CHECK_LIB(ldap41, main, LIBS="-lldap41 $LIBS" found_ldap_lib=yes need_pthread=no,,) + fi + if test -z "$found_ldap_lib" + then + AC_CHECK_LIB(ldap40, main, LIBS="-lldap40 $LIBS" found_ldap_lib=yes need_pthread=no,,) + fi +fi +if test -z "$found_ldap_lib" -a \( $with_ldap_lib = auto -o $with_ldap_lib = netscape3 \) +then + AC_CHECK_LIB(ldapssl30, main, LIBS="-lldapssl30 $LIBS" found_ldap_lib=yes need_pthread=yes,, -lpthread) +fi +if test -z "$found_ldap_lib" +then + AC_MSG_ERROR(could not locate a valid LDAP library) +fi +if test "$need_pthread" = "yes" +then + AC_CHECK_LIB(pthread, main) +fi +AC_CHECK_LIB(gssldap, ldap_gss_bind,[LIBS="-lgssldap $LIBS"],,$LIBS) +AC_CHECK_LIB(sasl2, sasl_client_init) + +AC_CHECK_FUNCS(sasl_auxprop_request) +AC_CHECK_FUNCS(gss_krb5_ccache_name) +AC_CHECK_FUNCS(ldap_parse_result ldap_memfree ldap_controls_free ldap_control_free) +AC_CHECK_FUNCS(ldap_explode_dn ldap_explode_rdn ldap_set_option ldap_get_option) +AC_CHECK_FUNCS(ldap_abandon ldap_simple_bind_s ldap_unbind ldap_set_rebind_proc) +AC_CHECK_FUNCS(ldap_sasl_interactive_bind_s ldap_initialize ldap_search_ext) +AC_CHECK_FUNCS(ldap_create_control) +AC_CHECK_FUNCS(ldap_domain2hostlist ldap_domain2dn) +AC_CHECK_FUNCS(ldap_get_values ldap_value_free ldap_get_dn) +AC_CHECK_FUNCS(ldap_err2string ldap_msgfree ldap_result) + +# replace ldap_create_page_control() and ldap_parse_page_control() +AC_CHECK_FUNCS(ldap_create_page_control ldap_parse_page_control,,[AC_LIBOBJ(pagectrl)]) + +# check the number of arguments that ldap_set_rebind_proc() uses +AC_CACHE_CHECK( + [number of arguments to ldap_set_rebind_proc], + nss_ldapd_cv_ldap_set_rebind_proc, + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[ + #include + #include ]], + [[ldap_set_rebind_proc(0, 0, 0);]])], + [nss_ldapd_cv_ldap_set_rebind_proc=3], + [nss_ldapd_cv_ldap_set_rebind_proc=2]) ]) +AC_DEFINE_UNQUOTED(LDAP_SET_REBIND_PROC_ARGS,$nss_ldapd_cv_ldap_set_rebind_proc, + [Define to the number of arguments to ldap_set_rebindproc.]) + +CFLAGS="$save_CFLAGS" +nslcd_LIBS="$LIBS" +LIBS="$save_LIBS" + +AC_SUBST(nss_ldap_so_LIBS) +AC_SUBST(nslcd_LIBS) + +# generate files +AC_CONFIG_FILES([Makefile compat/Makefile common/Makefile + nss/Makefile nslcd/Makefile man/Makefile tests/Makefile]) +AC_OUTPUT diff --git a/contrib/slapd-modules/nssov/nss-ldapd/depcomp b/contrib/slapd-modules/nssov/nss-ldapd/depcomp new file mode 100755 index 0000000000..e5f9736c72 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/depcomp @@ -0,0 +1,589 @@ +#! /bin/sh +# depcomp - compile a program generating dependencies as side-effects + +scriptversion=2007-03-29.01 + +# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007 Free Software +# Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Originally written by Alexandre Oliva . + +case $1 in + '') + echo "$0: No command. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: depcomp [--help] [--version] PROGRAM [ARGS] + +Run PROGRAMS ARGS to compile a file, generating dependencies +as side-effects. + +Environment variables: + depmode Dependency tracking mode. + source Source file read by `PROGRAMS ARGS'. + object Object file output by `PROGRAMS ARGS'. + DEPDIR directory where to store dependencies. + depfile Dependency file to output. + tmpdepfile Temporary file to use when outputing dependencies. + libtool Whether libtool is used (yes/no). + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "depcomp $scriptversion" + exit $? + ;; +esac + +if test -z "$depmode" || test -z "$source" || test -z "$object"; then + echo "depcomp: Variables source, object and depmode must be set" 1>&2 + exit 1 +fi + +# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. +depfile=${depfile-`echo "$object" | + sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} +tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} + +rm -f "$tmpdepfile" + +# Some modes work just like other modes, but use different flags. We +# parameterize here, but still list the modes in the big case below, +# to make depend.m4 easier to write. Note that we *cannot* use a case +# here, because this file can only contain one case statement. +if test "$depmode" = hp; then + # HP compiler uses -M and no extra arg. + gccflag=-M + depmode=gcc +fi + +if test "$depmode" = dashXmstdout; then + # This is just like dashmstdout with a different argument. + dashmflag=-xM + depmode=dashmstdout +fi + +case "$depmode" in +gcc3) +## gcc 3 implements dependency tracking that does exactly what +## we want. Yay! Note: for some reason libtool 1.4 doesn't like +## it if -MD -MP comes after the -MF stuff. Hmm. +## Unfortunately, FreeBSD c89 acceptance of flags depends upon +## the command line argument order; so add the flags where they +## appear in depend2.am. Note that the slowdown incurred here +## affects only configure: in makefiles, %FASTDEP% shortcuts this. + for arg + do + case $arg in + -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; + *) set fnord "$@" "$arg" ;; + esac + shift # fnord + shift # $arg + done + "$@" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + mv "$tmpdepfile" "$depfile" + ;; + +gcc) +## There are various ways to get dependency output from gcc. Here's +## why we pick this rather obscure method: +## - Don't want to use -MD because we'd like the dependencies to end +## up in a subdir. Having to rename by hand is ugly. +## (We might end up doing this anyway to support other compilers.) +## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like +## -MM, not -M (despite what the docs say). +## - Using -M directly means running the compiler twice (even worse +## than renaming). + if test -z "$gccflag"; then + gccflag=-MD, + fi + "$@" -Wp,"$gccflag$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + echo "$object : \\" > "$depfile" + alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz +## The second -e expression handles DOS-style file names with drive letters. + sed -e 's/^[^:]*: / /' \ + -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" +## This next piece of magic avoids the `deleted header file' problem. +## The problem is that when a header file which appears in a .P file +## is deleted, the dependency causes make to die (because there is +## typically no way to rebuild the header). We avoid this by adding +## dummy dependencies for each header file. Too bad gcc doesn't do +## this for us directly. + tr ' ' ' +' < "$tmpdepfile" | +## Some versions of gcc put a space before the `:'. On the theory +## that the space means something, we add a space to the output as +## well. +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp) + # This case exists only to let depend.m4 do its work. It works by + # looking at the text of this script. This case will never be run, + # since it is checked for above. + exit 1 + ;; + +sgi) + if test "$libtool" = yes; then + "$@" "-Wp,-MDupdate,$tmpdepfile" + else + "$@" -MDupdate "$tmpdepfile" + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + + if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files + echo "$object : \\" > "$depfile" + + # Clip off the initial element (the dependent). Don't try to be + # clever and replace this with sed code, as IRIX sed won't handle + # lines with more than a fixed number of characters (4096 in + # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; + # the IRIX cc adds comments like `#:fec' to the end of the + # dependency line. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ + tr ' +' ' ' >> $depfile + echo >> $depfile + + # The second pass generates a dummy entry for each header file. + tr ' ' ' +' < "$tmpdepfile" \ + | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ + >> $depfile + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +aix) + # The C for AIX Compiler uses -M and outputs the dependencies + # in a .u file. In older versions, this file always lives in the + # current directory. Also, the AIX compiler puts `$object:' at the + # start of each line; $object doesn't have directory information. + # Version 6 uses the directory in both cases. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.u + tmpdepfile2=$base.u + tmpdepfile3=$dir.libs/$base.u + "$@" -Wc,-M + else + tmpdepfile1=$dir$base.u + tmpdepfile2=$dir$base.u + tmpdepfile3=$dir$base.u + "$@" -M + fi + stat=$? + + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + # Each line is of the form `foo.o: dependent.h'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + # The sourcefile does not contain any dependencies, so just + # store a dummy comment line, to avoid errors with the Makefile + # "include basename.Plo" scheme. + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +icc) + # Intel's C compiler understands `-MD -MF file'. However on + # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c + # ICC 7.0 will fill foo.d with something like + # foo.o: sub/foo.c + # foo.o: sub/foo.h + # which is wrong. We want: + # sub/foo.o: sub/foo.c + # sub/foo.o: sub/foo.h + # sub/foo.c: + # sub/foo.h: + # ICC 7.1 will output + # foo.o: sub/foo.c sub/foo.h + # and will wrap long lines using \ : + # foo.o: sub/foo.c ... \ + # sub/foo.h ... \ + # ... + + "$@" -MD -MF "$tmpdepfile" + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile" + exit $stat + fi + rm -f "$depfile" + # Each line is of the form `foo.o: dependent.h', + # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. + # Do two passes, one to just change these to + # `$object: dependent.h' and one to simply `dependent.h:'. + sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" + # Some versions of the HPUX 10.20 sed can't process this invocation + # correctly. Breaking it into two sed invocations is a workaround. + sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | + sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +hp2) + # The "hp" stanza above does not work with aCC (C++) and HP's ia64 + # compilers, which have integrated preprocessors. The correct option + # to use with these is +Maked; it writes dependencies to a file named + # 'foo.d', which lands next to the object file, wherever that + # happens to be. + # Much of this is similar to the tru64 case; see comments there. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + if test "$libtool" = yes; then + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir.libs/$base.d + "$@" -Wc,+Maked + else + tmpdepfile1=$dir$base.d + tmpdepfile2=$dir$base.d + "$@" +Maked + fi + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" + # Add `dependent.h:' lines. + sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" "$tmpdepfile2" + ;; + +tru64) + # The Tru64 compiler uses -MD to generate dependencies as a side + # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. + # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put + # dependencies in `foo.d' instead, so we check for that too. + # Subdirectories are respected. + dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` + test "x$dir" = "x$object" && dir= + base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` + + if test "$libtool" = yes; then + # With Tru64 cc, shared objects can also be used to make a + # static library. This mechanism is used in libtool 1.4 series to + # handle both shared and static libraries in a single compilation. + # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. + # + # With libtool 1.5 this exception was removed, and libtool now + # generates 2 separate objects for the 2 libraries. These two + # compilations output dependencies in $dir.libs/$base.o.d and + # in $dir$base.o.d. We have to check for both files, because + # one of the two compilations can be disabled. We should prefer + # $dir$base.o.d over $dir.libs/$base.o.d because the latter is + # automatically cleaned when .libs/ is deleted, while ignoring + # the former would cause a distcleancheck panic. + tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 + tmpdepfile2=$dir$base.o.d # libtool 1.5 + tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 + tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 + "$@" -Wc,-MD + else + tmpdepfile1=$dir$base.o.d + tmpdepfile2=$dir$base.d + tmpdepfile3=$dir$base.d + tmpdepfile4=$dir$base.d + "$@" -MD + fi + + stat=$? + if test $stat -eq 0; then : + else + rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + exit $stat + fi + + for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" + do + test -f "$tmpdepfile" && break + done + if test -f "$tmpdepfile"; then + sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" + # That's a tab and a space in the []. + sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" + else + echo "#dummy" > "$depfile" + fi + rm -f "$tmpdepfile" + ;; + +#nosideeffect) + # This comment above is used by automake to tell side-effect + # dependency tracking mechanisms from slower ones. + +dashmstdout) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + test -z "$dashmflag" && dashmflag=-M + # Require at least two characters before searching for `:' + # in the target name. This is to cope with DOS-style filenames: + # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. + "$@" $dashmflag | + sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + tr ' ' ' +' < "$tmpdepfile" | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +dashXmstdout) + # This case only exists to satisfy depend.m4. It is never actually + # run, as this mode is specially recognized in the preamble. + exit 1 + ;; + +makedepend) + "$@" || exit $? + # Remove any Libtool call + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + # X makedepend + shift + cleared=no + for arg in "$@"; do + case $cleared in + no) + set ""; shift + cleared=yes ;; + esac + case "$arg" in + -D*|-I*) + set fnord "$@" "$arg"; shift ;; + # Strip any option that makedepend may not understand. Remove + # the object too, otherwise makedepend will parse it as a source file. + -*|$object) + ;; + *) + set fnord "$@" "$arg"; shift ;; + esac + done + obj_suffix="`echo $object | sed 's/^.*\././'`" + touch "$tmpdepfile" + ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" + rm -f "$depfile" + cat < "$tmpdepfile" > "$depfile" + sed '1,2d' "$tmpdepfile" | tr ' ' ' +' | \ +## Some versions of the HPUX 10.20 sed can't process this invocation +## correctly. Breaking it into two sed invocations is a workaround. + sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" "$tmpdepfile".bak + ;; + +cpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout. + "$@" || exit $? + + # Remove the call to Libtool. + if test "$libtool" = yes; then + while test $1 != '--mode=compile'; do + shift + done + shift + fi + + # Remove `-o $object'. + IFS=" " + for arg + do + case $arg in + -o) + shift + ;; + $object) + shift + ;; + *) + set fnord "$@" "$arg" + shift # fnord + shift # $arg + ;; + esac + done + + "$@" -E | + sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ + -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | + sed '$ s: \\$::' > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + cat < "$tmpdepfile" >> "$depfile" + sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +msvisualcpp) + # Important note: in order to support this mode, a compiler *must* + # always write the preprocessed file to stdout, regardless of -o, + # because we must use -o when running libtool. + "$@" || exit $? + IFS=" " + for arg + do + case "$arg" in + "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") + set fnord "$@" + shift + shift + ;; + *) + set fnord "$@" "$arg" + shift + shift + ;; + esac + done + "$@" -E | + sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" + rm -f "$depfile" + echo "$object : \\" > "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" + echo " " >> "$depfile" + . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" + rm -f "$tmpdepfile" + ;; + +none) + exec "$@" + ;; + +*) + echo "Unknown depmode $depmode" 1>&2 + exit 1 + ;; +esac + +exit 0 + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/install-sh b/contrib/slapd-modules/nssov/nss-ldapd/install-sh new file mode 100755 index 0000000000..a5897de6ea --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/install-sh @@ -0,0 +1,519 @@ +#!/bin/sh +# install - install a program, script, or datafile + +scriptversion=2006-12-25.00 + +# This originates from X11R5 (mit/util/scripts/install.sh), which was +# later released in X11R6 (xc/config/util/install.sh) with the +# following copyright and license. +# +# Copyright (C) 1994 X Consortium +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- +# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +# +# Except as contained in this notice, the name of the X Consortium shall not +# be used in advertising or otherwise to promote the sale, use or other deal- +# ings in this Software without prior written authorization from the X Consor- +# tium. +# +# +# FSF changes to this file are in the public domain. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. + +nl=' +' +IFS=" "" $nl" + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi + +# Put in absolute file names if you don't have them in your path; +# or use environment vars. + +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' + +posix_mkdir= + +# Desired mode of installed file. +mode=0755 + +chgrpcmd= +chmodcmd=$chmodprog +chowncmd= +mvcmd=$mvprog +rmcmd="$rmprog -f" +stripcmd= + +src= +dst= +dir_arg= +dst_arg= + +copy_on_change=false +no_target_directory= + +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE + or: $0 [OPTION]... SRCFILES... DIRECTORY + or: $0 [OPTION]... -t DIRECTORY SRCFILES... + or: $0 [OPTION]... -d DIRECTORIES... + +In the 1st form, copy SRCFILE to DSTFILE. +In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. +In the 4th, create DIRECTORIES. + +Options: + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. + +Environment variables override the default commands: + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG +" + +while test $# -ne 0; do + case $1 in + -c) ;; + + -C) copy_on_change=true;; + + -d) dir_arg=true;; + + -g) chgrpcmd="$chgrpprog $2" + shift;; + + --help) echo "$usage"; exit $?;; + + -m) mode=$2 + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; + + -o) chowncmd="$chownprog $2" + shift;; + + -s) stripcmd=$stripprog;; + + -t) dst_arg=$2 + shift;; + + -T) no_target_directory=true;; + + --version) echo "$0 $scriptversion"; exit $?;; + + --) shift + break;; + + -*) echo "$0: invalid option: $1" >&2 + exit 1;; + + *) break;; + esac + shift +done + +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then + # When -d is used, all remaining arguments are directories to create. + # When -t is used, the destination is already specified. + # Otherwise, the last argument is the destination. Remove it from $@. + for arg + do + if test -n "$dst_arg"; then + # $@ is not empty: it contains at least $arg. + set fnord "$@" "$dst_arg" + shift # fnord + fi + shift # arg + dst_arg=$arg + done +fi + +if test $# -eq 0; then + if test -z "$dir_arg"; then + echo "$0: no input file specified." >&2 + exit 1 + fi + # It's OK to call `install-sh -d' without argument. + # This can happen when creating conditional directories. + exit 0 +fi + +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi + +for src +do + # Protect names starting with `-'. + case $src in + -*) src=./$src;; + esac + + if test -n "$dir_arg"; then + dst=$src + dstdir=$dst + test -d "$dstdir" + dstdir_status=$? + else + + # Waiting for this to be detected by the "$cpprog $src $dsttmp" command + # might cause directories to be created, which would be especially bad + # if $src (and thus $dsttmp) contains '*'. + if test ! -f "$src" && test ! -d "$src"; then + echo "$0: $src does not exist." >&2 + exit 1 + fi + + if test -z "$dst_arg"; then + echo "$0: no destination specified." >&2 + exit 1 + fi + + dst=$dst_arg + # Protect names starting with `-'. + case $dst in + -*) dst=./$dst;; + esac + + # If destination is a directory, append the input filename; won't work + # if double slashes aren't ignored. + if test -d "$dst"; then + if test -n "$no_target_directory"; then + echo "$0: $dst_arg: Is a directory" >&2 + exit 1 + fi + dstdir=$dst + dst=$dstdir/`basename "$src"` + dstdir_status=0 + else + # Prefer dirname, but fall back on a substitute if dirname fails. + dstdir=` + (dirname "$dst") 2>/dev/null || + expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$dst" : 'X\(//\)[^/]' \| \ + X"$dst" : 'X\(//\)$' \| \ + X"$dst" : 'X\(/\)' \| . 2>/dev/null || + echo X"$dst" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q' + ` + + test -d "$dstdir" + dstdir_status=$? + fi + fi + + obsolete_mkdir_used=false + + if test $dstdir_status != 0; then + case $posix_mkdir in + '') + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode + else + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; + esac + + if + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) + then : + else + + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. + + case $dstdir in + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; + esac + + eval "$initialize_posix_glob" + + oIFS=$IFS + IFS=/ + $posix_glob set -f + set fnord $dstdir + shift + $posix_glob set +f + IFS=$oIFS + + prefixes= + + for d + do + test -z "$d" && continue + + prefix=$prefix$d + if test -d "$prefix"; then + prefixes= + else + if $posix_mkdir; then + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break + # Don't fail if two instances are running concurrently. + test -d "$prefix" || exit 1 + else + case $prefix in + *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; + *) qprefix=$prefix;; + esac + prefixes="$prefixes '$qprefix'" + fi + fi + prefix=$prefix/ + done + + if test -n "$prefixes"; then + # Don't fail if two instances are running concurrently. + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 + obsolete_mkdir_used=true + fi + fi + fi + + if test -n "$dir_arg"; then + { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && + { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 + else + + # Make a couple of temp file names in the proper directory. + dsttmp=$dstdir/_inst.$$_ + rmtmp=$dstdir/_rm.$$_ + + # Trap to clean up those temp files at exit. + trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 + + # Copy the file name to the temp name. + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && + + # and set any options; do chmod last to preserve setuid bits. + # + # If any of these fail, we abort the whole thing. If we want to + # ignore errors from any of these, just make sure not to ignore + # errors from the above "$doit $cpprog $src $dsttmp" command. + # + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && + + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && + + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && + + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 + + trap '' 0 + fi +done + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/m4/acx_pthread.m4 b/contrib/slapd-modules/nssov/nss-ldapd/m4/acx_pthread.m4 new file mode 100644 index 0000000000..d2b116945f --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/m4/acx_pthread.m4 @@ -0,0 +1,279 @@ +##### http://autoconf-archive.cryp.to/acx_pthread.html +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. +# It sets the PTHREAD_LIBS output variable to the threads library and +# linker flags, and the PTHREAD_CFLAGS output variable to any special +# C compiler flags that are needed. (The user can also force certain +# compiler flags/libs to be tested by setting these environment +# variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). +# (This is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these +# flags, but also link it with them as well. e.g. you should link +# with $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS +# $LIBS +# +# If you are only building threads programs, you may wish to use +# these variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute +# constant has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to +# that name (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads +# library is found, and ACTION-IF-NOT-FOUND is a list of commands to +# run it if it is not found. If ACTION-IF-FOUND is not specified, the +# default action will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or +# if you have any other suggestions or comments. This macro was based +# on work by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) +# (with help from M. Frigo), as well as ac_pthread and hb_pthread +# macros posted by Alejandro Forero Cuervo to the autoconf macro +# repository. We are also grateful for the helpful feedback of +# numerous users. +# +# LAST MODIFICATION +# +# 2007-07-29 +# +# COPYLEFT +# +# Copyright (c) 2007 Steven G. Johnson +# +# This program is free software: you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see +# . +# +# As a special exception, the respective Autoconf Macro's copyright +# owner gives unlimited permission to copy, distribute and modify the +# configure scripts that are the output of Autoconf when processing +# the Macro. You need not follow the terms of the GNU General Public +# License when using or distributing such scripts, even though +# portions of the text of the Macro appear in them. The GNU General +# Public License (GPL) does govern all other use of the material that +# constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the +# Autoconf Macro released by the Autoconf Macro Archive. When you +# make and distribute a modified version of the Autoconf Macro, you +# may extend this special exception to the GPL to apply to your +# modified version as well. + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.am new file mode 100644 index 0000000000..2dcf2573ba --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.am @@ -0,0 +1,35 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2007 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +dist_man_MANS = nss-ldapd.conf.5 nslcd.8 + +EXTRA_DIST = nss-ldapd.conf.5.xml nslcd.8.xml + +if GENMAN + +MAINTAINERCLEANFILES = $(dist_man_MANS) + +SUFFIXES = .xml +.xml: + $(DOCBOOK2X_MAN) \ + --string-param header-3='$(RELEASE_MONTH)' \ + --string-param header-4='Version $(VERSION)' \ + $< + +endif diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.in new file mode 100644 index 0000000000..3b2a06a6e5 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/Makefile.in @@ -0,0 +1,450 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2007 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +subdir = man +DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.am \ + $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +SOURCES = +DIST_SOURCES = +man5dir = $(mandir)/man5 +am__installdirs = "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)" +man8dir = $(mandir)/man8 +NROFF = nroff +MANS = $(dist_man_MANS) +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +dist_man_MANS = nss-ldapd.conf.5 nslcd.8 +EXTRA_DIST = nss-ldapd.conf.5.xml nslcd.8.xml +@GENMAN_TRUE@MAINTAINERCLEANFILES = $(dist_man_MANS) +@GENMAN_TRUE@SUFFIXES = .xml +all: all-am + +.SUFFIXES: +.SUFFIXES: .xml +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu man/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +install-man5: $(man5_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man5dir)" || $(MKDIR_P) "$(DESTDIR)$(man5dir)" + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst"; \ + done +uninstall-man5: + @$(NORMAL_UNINSTALL) + @list='$(man5_MANS) $(dist_man5_MANS) $(nodist_man5_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.5*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 5*) ;; \ + *) ext='5' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man5dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man5dir)/$$inst"; \ + done +install-man8: $(man8_MANS) $(man_MANS) + @$(NORMAL_INSTALL) + test -z "$(man8dir)" || $(MKDIR_P) "$(DESTDIR)$(man8dir)" + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man8dir)/$$inst'"; \ + $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man8dir)/$$inst"; \ + done +uninstall-man8: + @$(NORMAL_UNINSTALL) + @list='$(man8_MANS) $(dist_man8_MANS) $(nodist_man8_MANS)'; \ + l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ + for i in $$l2; do \ + case "$$i" in \ + *.8*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + case "$$ext" in \ + 8*) ;; \ + *) ext='8' ;; \ + esac; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed -e 's/^.*\///'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f '$(DESTDIR)$(man8dir)/$$inst'"; \ + rm -f "$(DESTDIR)$(man8dir)/$$inst"; \ + done +tags: TAGS +TAGS: + +ctags: CTAGS +CTAGS: + + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(MANS) +installdirs: + for dir in "$(DESTDIR)$(man5dir)" "$(DESTDIR)$(man8dir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +clean: clean-am + +clean-am: clean-generic mostlyclean-am + +distclean: distclean-am + -rm -f Makefile +distclean-am: clean-am distclean-generic + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: install-man + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: install-man5 install-man8 + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-man + +uninstall-man: uninstall-man5 uninstall-man8 + +.MAKE: install-am install-strip + +.PHONY: all all-am check check-am clean clean-generic distclean \ + distclean-generic distdir dvi dvi-am html html-am info info-am \ + install install-am install-data install-data-am install-dvi \ + install-dvi-am install-exec install-exec-am install-html \ + install-html-am install-info install-info-am install-man \ + install-man5 install-man8 install-pdf install-pdf-am \ + install-ps install-ps-am install-strip installcheck \ + installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-generic pdf \ + pdf-am ps ps-am uninstall uninstall-am uninstall-man \ + uninstall-man5 uninstall-man8 + +@GENMAN_TRUE@.xml: +@GENMAN_TRUE@ $(DOCBOOK2X_MAN) \ +@GENMAN_TRUE@ --string-param header-3='$(RELEASE_MONTH)' \ +@GENMAN_TRUE@ --string-param header-4='Version $(VERSION)' \ +@GENMAN_TRUE@ $< +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8 b/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8 new file mode 100644 index 0000000000..7ea9848e96 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8 @@ -0,0 +1,54 @@ +'\" -*- coding: us-ascii -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH nslcd 8 "May 2008" "Version 0.6.2" "System Manager's Manual" +.SH NAME +nslcd \- local LDAP name service daemon. +.SH SYNOPSIS +'nh +.fi +.ad l +\fBnslcd\fR \kx +.if (\nx>(\n(.l/2)) .nr x (\n(.l/5) +'in \n(.iu+\nxu +[ +\fIoptions\fR +] +'in \n(.iu-\nxu +.ad b +'hy +.SH DESCRIPTION +\fBnslcd\fR is a daemon that will do LDAP queries +for local processes based on a simple configuration +file. +.PP +\fBnslcd\fR is configured through a configuration file +(see \fBnss-ldapd.conf\fR(5)). +.PP +See the included README for information on configuring the LDAP server. +.SH OPTIONS +\fBnslcd\fR accepts the following options: +.TP +\*(T<\fB\-d, \-\-debug\fR\*(T> +Enable debugging mode. +\fBnslcd\fR will not put itself in the background and sends +verbose debugging info to stderr. +\fBnslcd\fR will handle connections as usual. +This option is for debugging purposes only. +.TP +\*(T<\fB\-\-help\fR\*(T> +Display short help and exit. +.TP +\*(T<\fB\-V, \-\-version\fR\*(T> +Output version information and exit. +.SH FILES +\*(T<\fI/etc/nss\-ldapd.conf\fR\*(T> - the configuration file +(see \fBnss-ldapd.conf\fR(5)) +.SH "SEE ALSO" +\fBnss-ldapd.conf\fR(5) +.SH AUTHOR +This manual was written by Arthur de Jong . diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8.xml b/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8.xml new file mode 100644 index 0000000000..06b4711e3e --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/nslcd.8.xml @@ -0,0 +1,132 @@ + + + + + + + + + + Arthur + de Jong + + + + + nslcd + 8 + Version 0.6.2 + System Manager's Manual + May 2008 + + + + nslcd + local LDAP name service daemon. + + + + + nslcd + + options + + + + + + Description + + nslcd is a daemon that will do LDAP queries + for local processes based on a simple configuration + file. + + + nslcd is configured through a configuration file + (see nss-ldapd.conf5). + + + See the included README for information on configuring the LDAP server. + + + + + Options + + nslcd accepts the following options: + + + + + + + + Enable debugging mode. + nslcd will not put itself in the background and sends + verbose debugging info to stderr. + nslcd will handle connections as usual. + This option is for debugging purposes only. + + + + + + + + + Display short help and exit. + + + + + + + + Output version information and exit. + + + + + + + Files + + /etc/nss-ldapd.conf - the configuration file + (see nss-ldapd.conf5) + + + + + See Also + + nss-ldapd.conf5 + + + + + Author + This manual was written by Arthur de Jong <arthur@ch.tudelft.nl>. + + + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5 b/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5 new file mode 100644 index 0000000000..4b7b149075 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5 @@ -0,0 +1,282 @@ +'\" -*- coding: us-ascii -*- +.if \n(.g .ds T< \\FC +.if \n(.g .ds T> \\F[\n[.fam]] +.de URL +\\$2 \(la\\$1\(ra\\$3 +.. +.if \n(.g .mso www.tmac +.TH nss-ldapd.conf 5 "May 2008" "Version 0.6.2" "System Manager's Manual" +.SH NAME +nss-ldapd.conf \- configuration file for LDAP nameservice provider +.SH DESCRIPTION +The \fInss-ldapd\fR module allows LDAP +directory servers to be used as a primary source of name service +information. (Name service information typically includes users, hosts, +groups, and other such data historically stored in flat files or +NIS.) +.PP +The file \*(T<\fInss\-ldapd.conf\fR\*(T> contains the +configuration information for running \fBnslcd\fR (see +\fBnslcd\fR(8)). +The file contains options, one on each line, defining the way +NSS lookups are mapped onto +LDAP lookups. +.SH OPTIONS +.SS "RUNTIME OPTIONS" +.TP +\*(T<\fBthreads\fR\*(T> \fINUM\fR +Specifies the number of threads to start that can handle requests +and perform LDAP queries. +The default is to start 5 threads. +.SS "GENERAL CONNECTION OPTIONS" +.TP +\*(T<\fBuri\fR\*(T> \fIURI\fR +Specifies the LDAP URI of the +server to connect to. +The URI scheme may be \fIldap\fR, +\fIldapi\fR or \fIldaps\fR, specifying +LDAP over TCP, +ICP or SSL respectively (if +supported by the LDAP library). +Alternatively, the value \fIDNS\fR may be +used to try to lookup the server using DNS +SRV records. + +When using the ldapi scheme, %2f should be used to escape slashes +(e.g. ldapi://%2fvar%2frun%2fslapd%2fldapi/), although most of the +time this should not be needed. + +This option may be specified multiple times. Normally, only the first +server will be used with the following servers as fall-back (see +\*(T<\fBbind_timelimit\fR\*(T> below). + +If LDAP lookups are used for host name resolution, +any host names should be specified as an IP address or name that can be +resolved without using LDAP. +.TP +\*(T<\fBldap_version\fR\*(T> \fIVERSION\fR +Specifies the version of the LDAP protocol to use. +The default is to use the maximum version supported by the +LDAP library. +.TP +\*(T<\fBbinddn\fR\*(T> \fIDN\fR +Specifies the distinguished name with which to bind to the directory +server for lookups. +The default is to bind anonymously. +.TP +\*(T<\fBbindpw\fR\*(T> \fIPASSWORD\fR +Specifies the clear text credentials with which to bind. +This option is only applicable when used with \*(T<\fBbinddn\fR\*(T> above. + +When binding to the directory using SASL or other +authentication mechanisms apart from simple binds, this option is not +used. +.SS "KERBEROS AUTHENTICATION OPTIONS" +.TP +\*(T<\fBkrb5_ccname\fR\*(T> \fINAME\fR +Set the name for the GSS-API Kerberos credentials cache. +.SS "SEARCH/MAPPING OPTIONS" +.TP +\*(T<\fBbase\fR\*(T> [\fIMAP\fR] \fIDN\fR +Specifies the base distinguished name (DN) +to use as search base. +A global search base may be specified or a MAP-specific one. +If no MAP-specific search base is defined the global one is used. + +If, instead of a DN, the value +\fIDOMAIN\fR is specified, the hosts +DNS domain is used to construct a basedn. +.TP +\*(T<\fBscope\fR\*(T> [\fIMAP\fR] sub[tree]|one[level]|base +Specifies the search scope (subtree, one level or base object). +The default scope is subtree; base scope is almost never useful for +name service lookups. +.TP +\*(T<\fBderef\fR\*(T> never|searching|finding|always +Specifies the policy for dereferencing aliases. +The default policy is to never dereference aliases. +.TP +\*(T<\fBreferrals\fR\*(T> yes|no +Specifies whether automatic referral chasing should be enabled. +The default behaviour is to chase referrals. +.TP +\*(T<\fBfilter\fR\*(T> \fIMAP\fR \fIFILTER\fR +The \fIFILTER\fR +is an LDAP search filter to use for a +specific map. +The default filter is a basic search on the +objectClass for the map (e.g. \*(T<(objectClass=posixAccount)\*(T>). +.TP +\*(T<\fBmap\fR\*(T> \fIMAP\fR \fIATTRIBUTE\fR \fINEWATTRIBUTE\fR +This option allows for custom attributes to be looked up instead of +the default RFC 2307 attributes. +The \fIMAP\fR may be one of +the supported maps below. +The \fIATTRIBUTE\fR is the one as +used in RFC 2307 (e.g. \*(T, +\*(T or \*(T). +The \fINEWATTRIBUTE\fR may be any attribute +as it is available in the directory. +.SS "TIMING/RECONNECT OPTIONS" +.TP +\*(T<\fBbind_timelimit\fR\*(T> \fISECONDS\fR +Specifies the time limit (in seconds) to use when connecting to the +directory server. +This is distinct from the time limit specified in +\*(T<\fBtimelimit\fR\*(T> and affects the setup of the connection only. +Note that not all LDAP client libraries have support +for setting the connection time out. +The default \*(T<\fBbind_timelimit\fR\*(T> is 30 seconds. +.TP +\*(T<\fBtimelimit\fR\*(T> \fISECONDS\fR +Specifies the time limit (in seconds) to wait for a response from the +LDAP server. +A value of zero (0), which is the default, is to wait indefinitely for +searches to be completed. +.TP +\*(T<\fBidle_timelimit\fR\*(T> \fISECONDS\fR +Specifies the period if inactivity (in seconds) after which the +connection to the LDAP server will be closed. +The default is not to time out connections. +.TP +\*(T<\fBreconnect_sleeptime\fR\*(T> \fISECONDS\fR +Specifies the number of seconds to sleep when connecting to all +LDAP servers fails. +By default 1 second is waited between the first failure and the first +retry. +.TP +\*(T<\fBreconnect_maxsleeptime\fR\*(T> \fISECONDS\fR +Specified the time after the last successful operation from which the +LDAP server is considered permanently unavailable. +Retries will be done only once in this time period. +The default value is 30 seconds. +.PP +Note that the reconnect logic as described above is the mechanism that +is used between \fBnslcd\fR and the LDAP +server. The mechanism between the NSS client library +and \fBnslcd\fR is simpler with a fixed compiled-in +time out of a 10 seconds for writing to \fBnslcd\fR and +a time out of 20 seconds for reading answers. +\fBnslcd\fR itself has a read time out of 0.5 seconds +and a write time out of 5 seconds. +.SS "SSL/TLS OPTIONS" +.TP +\fIssl \fR +Specifies whether to use SSL/TLS or not (the default is not to). If +\fIstart_tls\fR +is specified then StartTLS is used rather than raw LDAP over SSL. +Not all LDAP client libraries support both SSL +and StartTLS, and all related configuration options. +.TP +\fIsslpath \fR +For the Netscape and Mozilla +LDAP +client libraries only, this specifies the path to the X.509 +certificate database. +.TP +\fItls_checkpeer \fR +Specifies whether to require and verify the server certificate +or not, when using SSL/TLS +with the OpenLDAP client library. +The default is to use the default behaviour of the client +library; for OpenLDAP 2.0 and earlier it is "no", for OpenLDAP +2.1 and later it is "yes". At least one of +\fItls_cacertdir\fR +and +\fItls_cacertfile\fR +is required if peer verification is enabled. +.TP +\fItls_cacertdir \fR +Specifies the directory containing X.509 certificates for peer +authentication. +.TP +\fItls_cacertfile \fR +Specifies the path to the X.509 certificate for peer authentication. +.TP +\fItls_randfile \fR +Specifies the path to an entropy source. +.TP +\fItls_ciphers \fR +Specifies the ciphers to use for TLS. +See your TLS implementation's +documentation for further information. +.TP +\fItls_cert \fR +Specifies the path to the file containing the local certificate for +client TLS authentication. +.TP +\fItls_key \fR +Specifies the path to the file containing the private key for client +TLS authentication. +.SS "OTHER OPTIONS" +.TP +\*(T<\fBpagesize\fR\*(T> \fINUMBER\fR +Set this to a number greater than 0 to request paged results from +the LDAP server in accordance with RFC2696. +The default (0) is to not request paged results. + +This is useful for LDAP servers that contain a +lot of entries (e.g. more than 500) and limit the number of entries +that are returned with one request. +For OpenLDAP servers you may need to set +\*(T<\fBsizelimit size.prtotal=unlimited\fR\*(T> +for allowing more entries to be returned over multiple pages. +.SH "SUPPORTED MAPS" +The following maps are supported. They are referenced as +\fIMAP\fR in the options above. +.TP +alias[es] +Mail aliases. +Note that most mail servers do not use the NSS +interface for requesting mail aliases and parse +\*(T<\fI/etc/aliases\fR\*(T> on their own. +.TP +ether[s] +Ethernet numbers (mac addresses). +.TP +group +Posix groups. +.TP +host[s] +Host names. +.TP +netgroup +Host and user groups used for access control. +.TP +network[s] +Network numbers. +.TP +passwd +Posix users. +.TP +protocol[s] +Protocol definitions (like in \*(T<\fI/etc/protocols\fR\*(T>). +.TP +rpc +Remote procedure call names and numbers. +.TP +service[s] +Network service names and numbers. +.TP +shadow +Shadow user password information. +.SH FILES +.TP +\*(T<\fI/etc/nss\-ldapd.conf\fR\*(T> +the main configuration file +.TP +\*(T<\fI/etc/nsswitch.conf\fR\*(T> +Name Service Switch configuration file +.SH "SEE ALSO" +\fBnslcd\fR(8), +\fBnsswitch.conf\fR(5) +.SH AUTHOR +This manual was written by Arthur de Jong +and is based on the +\fBnss_ldap\fR(5) +manual developed by PADL Software Pty Ltd. +.SH "KNOWN BUGS" +This manual page may be outdated and inaccurate and will be improved +in upcoming releases. +The features of \fInss-ldapd\fR are still under +development so these options may change in a future release. diff --git a/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5.xml b/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5.xml new file mode 100644 index 0000000000..9eaa41c2ac --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/man/nss-ldapd.conf.5.xml @@ -0,0 +1,652 @@ + + + + + + + + + + Arthur + de Jong + + + + + nss-ldapd.conf + 5 + Version 0.6.2 + System Manager's Manual + May 2008 + + + + nss-ldapd.conf + configuration file for LDAP nameservice provider + + + + Description + + The nss-ldapd module allows LDAP + directory servers to be used as a primary source of name service + information. (Name service information typically includes users, hosts, + groups, and other such data historically stored in flat files or + NIS.) + + + The file nss-ldapd.conf contains the + configuration information for running nslcd (see + nslcd8). + The file contains options, one on each line, defining the way + NSS lookups are mapped onto + LDAP lookups. + + + + + Options + + + Runtime options + + + + NUM + + + Specifies the number of threads to start that can handle requests + and perform LDAP queries. + The default is to start 5 threads. + + + + + + + + + General connection options + + + + URI + + + Specifies the LDAP URI of the + server to connect to. + The URI scheme may be ldap, + ldapi or ldaps, specifying + LDAP over TCP, + ICP or SSL respectively (if + supported by the LDAP library). + Alternatively, the value DNS may be + used to try to lookup the server using DNS + SRV records. + + + When using the ldapi scheme, %2f should be used to escape slashes + (e.g. ldapi://%2fvar%2frun%2fslapd%2fldapi/), although most of the + time this should not be needed. + + + This option may be specified multiple times. Normally, only the first + server will be used with the following servers as fall-back (see + below). + + + If LDAP lookups are used for host name resolution, + any host names should be specified as an IP address or name that can be + resolved without using LDAP. + + + + + + VERSION + + + Specifies the version of the LDAP protocol to use. + The default is to use the maximum version supported by the + LDAP library. + + + + + DN + + + Specifies the distinguished name with which to bind to the directory + server for lookups. + The default is to bind anonymously. + + + + + + PASSWORD + + + Specifies the clear text credentials with which to bind. + This option is only applicable when used with above. + + + When binding to the directory using SASL or other + authentication mechanisms apart from simple binds, this option is not + used. + + + + + + + + + + + Kerberos authentication options + + + + NAME + + + Set the name for the GSS-API Kerberos credentials cache. + + + + + + + + + Search/mapping options + + + + + MAP + DN + + + Specifies the base distinguished name (DN) + to use as search base. + A global search base may be specified or a MAP-specific one. + If no MAP-specific search base is defined the global one is used. + + + If, instead of a DN, the value + DOMAIN is specified, the hosts + DNS domain is used to construct a basedn. + + + + + + + MAP + subtree|onelevel|base + + + Specifies the search scope (subtree, one level or base object). + The default scope is subtree; base scope is almost never useful for + name service lookups. + + + + + + never|searching|finding|always + + + Specifies the policy for dereferencing aliases. + The default policy is to never dereference aliases. + + + + + + yes|no + + + Specifies whether automatic referral chasing should be enabled. + The default behaviour is to chase referrals. + + + + + + + MAP + FILTER + + + The FILTER + is an LDAP search filter to use for a + specific map. + The default filter is a basic search on the + objectClass for the map (e.g. (objectClass=posixAccount)). + + + + + + + MAP + ATTRIBUTE + NEWATTRIBUTE + + + This option allows for custom attributes to be looked up instead of + the default RFC 2307 attributes. + The MAP may be one of + the supported maps below. + The ATTRIBUTE is the one as + used in RFC 2307 (e.g. userPassword, + ipProtocolNumber or macAddress). + The NEWATTRIBUTE may be any attribute + as it is available in the directory. + + + + + + + + + + + + Timing/reconnect options + + + + SECONDS + + + Specifies the time limit (in seconds) to use when connecting to the + directory server. + This is distinct from the time limit specified in + and affects the setup of the connection only. + Note that not all LDAP client libraries have support + for setting the connection time out. + The default is 30 seconds. + + + + + + SECONDS + + + Specifies the time limit (in seconds) to wait for a response from the + LDAP server. + A value of zero (0), which is the default, is to wait indefinitely for + searches to be completed. + + + + + + + + SECONDS + + + Specifies the period if inactivity (in seconds) after which the + connection to the LDAP server will be closed. + The default is not to time out connections. + + + + + + SECONDS + + + Specifies the number of seconds to sleep when connecting to all + LDAP servers fails. + By default 1 second is waited between the first failure and the first + retry. + + + + + + SECONDS + + + Specified the time after the last successful operation from which the + LDAP server is considered permanently unavailable. + Retries will be done only once in this time period. + The default value is 30 seconds. + + + + + + + + Note that the reconnect logic as described above is the mechanism that + is used between nslcd and the LDAP + server. The mechanism between the NSS client library + and nslcd is simpler with a fixed compiled-in + time out of a 10 seconds for writing to nslcd and + a time out of 20 seconds for reading answers. + nslcd itself has a read time out of 0.5 seconds + and a write time out of 5 seconds. + + + + + + <acronym>SSL</acronym>/<acronym>TLS</acronym> options + + + + ssl <on|off|start_tls> + + Specifies whether to use SSL/TLS or not (the default is not to). If + start_tls + is specified then StartTLS is used rather than raw LDAP over SSL. + Not all LDAP client libraries support both SSL + and StartTLS, and all related configuration options. + + + + + sslpath <cert7_path> + + For the Netscape and Mozilla + LDAP + client libraries only, this specifies the path to the X.509 + certificate database. + + + + + tls_checkpeer <yes|no> + + Specifies whether to require and verify the server certificate + or not, when using SSL/TLS + with the OpenLDAP client library. + The default is to use the default behaviour of the client + library; for OpenLDAP 2.0 and earlier it is "no", for OpenLDAP + 2.1 and later it is "yes". At least one of + tls_cacertdir + and + tls_cacertfile + is required if peer verification is enabled. + + + + + tls_cacertdir <certificate_dir> + + Specifies the directory containing X.509 certificates for peer + authentication. + + + + + tls_cacertfile <certificate_file> + + Specifies the path to the X.509 certificate for peer authentication. + + + + + tls_randfile <entropy_file> + + Specifies the path to an entropy source. + + + + + tls_ciphers <ciphers> + + Specifies the ciphers to use for TLS. + See your TLS implementation's + documentation for further information. + + + + + tls_cert <certificate_file> + + Specifies the path to the file containing the local certificate for + client TLS authentication. + + + + + tls_key <key_file> + + Specifies the path to the file containing the private key for client + TLS authentication. + + + + + + + + Other options + + + + + + NUMBER + + + Set this to a number greater than 0 to request paged results from + the LDAP server in accordance with RFC2696. + The default (0) is to not request paged results. + + + This is useful for LDAP servers that contain a + lot of entries (e.g. more than 500) and limit the number of entries + that are returned with one request. + For OpenLDAP servers you may need to set + + for allowing more entries to be returned over multiple pages. + + + + + + + + + + + Supported maps + + The following maps are supported. They are referenced as + MAP in the options above. + + + + aliases + + Mail aliases. + Note that most mail servers do not use the NSS + interface for requesting mail aliases and parse + /etc/aliases on their own. + + + + ethers + Ethernet numbers (mac addresses). + + + group + Posix groups. + + + hosts + Host names. + + + netgroup + Host and user groups used for access control. + + + networks + Network numbers. + + + passwd + Posix users. + + + protocols + Protocol definitions (like in /etc/protocols). + + + rpc + Remote procedure call names and numbers. + + + services + Network service names and numbers. + + + shadow + Shadow user password information. + + + + + + Files + + + /etc/nss-ldapd.conf + the main configuration file + + + /etc/nsswitch.conf + Name Service Switch configuration file + + + + + + See Also + + nslcd8, + nsswitch.conf5 + + + + + Author + This manual was written by Arthur de Jong <arthur@ch.tudelft.nl> + and is based on the + nss_ldap5 + manual developed by PADL Software Pty Ltd. + + + + Known Bugs + + This manual page may be outdated and inaccurate and will be improved + in upcoming releases. + The features of nss-ldapd are still under + development so these options may change in a future release. + + + + diff --git a/contrib/slapd-modules/nssov/nss-ldapd/missing b/contrib/slapd-modules/nssov/nss-ldapd/missing new file mode 100755 index 0000000000..1c8ff7049d --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/missing @@ -0,0 +1,367 @@ +#! /bin/sh +# Common stub for a few missing GNU programs while installing. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" + +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + help2man touch the output file + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing $scriptversion (GNU Automake)" + exit $? + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files + ;; + + automake*) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' $msg. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + help2man) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is $msg. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequisites for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0 + +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/mkinstalldirs b/contrib/slapd-modules/nssov/nss-ldapd/mkinstalldirs new file mode 100755 index 0000000000..ef7e16fdaf --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/mkinstalldirs @@ -0,0 +1,161 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy + +scriptversion=2006-05-11.19 + +# Original author: Noah Friedman +# Created: 1993-05-16 +# Public domain. +# +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' +IFS=" "" $nl" +errstatus=0 +dirmode= + +usage="\ +Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ... + +Create each directory DIR (with mode MODE, if specified), including all +leading file name components. + +Report bugs to ." + +# process command line arguments +while test $# -gt 0 ; do + case $1 in + -h | --help | --h*) # -h for help + echo "$usage" + exit $? + ;; + -m) # -m PERM arg + shift + test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } + dirmode=$1 + shift + ;; + --version) + echo "$0 $scriptversion" + exit $? + ;; + --) # stop option processing + shift + break + ;; + -*) # unknown option + echo "$usage" 1>&2 + exit 1 + ;; + *) # first non-opt arg + break + ;; + esac +done + +for file +do + if test -d "$file"; then + shift + else + break + fi +done + +case $# in + 0) exit 0 ;; +esac + +# Solaris 8's mkdir -p isn't thread-safe. If you mkdir -p a/b and +# mkdir -p a/c at the same time, both will detect that a is missing, +# one will create a, then the other will try to create a and die with +# a "File exists" error. This is a problem when calling mkinstalldirs +# from a parallel make. We use --version in the probe to restrict +# ourselves to GNU mkdir, which is thread-safe. +case $dirmode in + '') + if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then + echo "mkdir -p -- $*" + exec mkdir -p -- "$@" + else + # On NextStep and OpenStep, the `mkdir' command does not + # recognize any option. It will interpret all options as + # directories to create, and then abort because `.' already + # exists. + test -d ./-p && rmdir ./-p + test -d ./--version && rmdir ./--version + fi + ;; + *) + if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 && + test ! -d ./--version; then + echo "mkdir -m $dirmode -p -- $*" + exec mkdir -m "$dirmode" -p -- "$@" + else + # Clean up after NextStep and OpenStep mkdir. + for d in ./-m ./-p ./--version "./$dirmode"; + do + test -d $d && rmdir $d + done + fi + ;; +esac + +for file +do + case $file in + /*) pathcomp=/ ;; + *) pathcomp= ;; + esac + oIFS=$IFS + IFS=/ + set fnord $file + shift + IFS=$oIFS + + for d + do + test "x$d" = x && continue + + pathcomp=$pathcomp$d + case $pathcomp in + -*) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + else + if test ! -z "$dirmode"; then + echo "chmod $dirmode $pathcomp" + lasterr= + chmod "$dirmode" "$pathcomp" || lasterr=$? + + if test ! -z "$lasterr"; then + errstatus=$lasterr + fi + fi + fi + fi + + pathcomp=$pathcomp/ + done +done + +exit $errstatus + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd-common.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd-common.h new file mode 100644 index 0000000000..e090783b9a --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd-common.h @@ -0,0 +1,305 @@ +/* + nslcd-common.h - helper macros for reading and writing in + protocol streams + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _NSLCD_COMMON_H +#define _NSLCD_COMMON_H 1 + +#include + +#ifdef DEBUG_PROT +/* define a debugging macro to output logging */ +#include +#include +#define DEBUG_PRINT(fmt,arg) \ + fprintf(stderr,"%s:%d:%s: " fmt "\n",__FILE__,__LINE__,__PRETTY_FUNCTION__,arg); +#else /* DEBUG_PROT */ +/* define an empty debug macro to disable logging */ +#define DEBUG_PRINT(fmt,arg) +#endif /* not DEBUG_PROT */ + +#ifdef DEBUG_PROT_DUMP +/* define a debugging macro to output detailed logging */ +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ +static void debug_dump(const void *ptr,size_t size) +{ + int i; + for (i=0;i0) \ + { WRITE(fp,str,tmpint32); } \ + } + +#define WRITE_FLUSH(fp) \ + if (tio_flush(fp)<0) \ + { \ + DEBUG_PRINT("WRITE_FLUSH : error: %s",strerror(errno)); \ + ERROR_OUT_WRITEERROR(fp); \ + } + +#define WRITE_STRINGLIST(fp,arr) \ + /* first determin length of array */ \ + for (tmp3int32=0;(arr)[tmp3int32]!=NULL;tmp3int32++) \ + /*noting*/ ; \ + /* write number of strings */ \ + DEBUG_PRINT("WRITE_STRLST: var="__STRING(arr)" num=%d",(int)tmp3int32); \ + WRITE_TYPE(fp,tmp3int32,int32_t); \ + /* write strings */ \ + for (tmp2int32=0;tmp2int32buflen) \ + { \ + /* will not fit */ \ + DEBUG_PRINT("READ : buffer error: %d bytes too small",(bufptr+(sz)-(buflen))); \ + ERROR_OUT_BUFERROR(fp); \ + } + +/* move the buffer pointer */ +#define BUF_SKIP(sz) \ + bufptr+=(size_t)(sz); + +/* move BUF_CUR foreward so that it is aligned to the specified + type width */ +#define BUF_ALIGN(fp,type) \ + /* figure out number of bytes to skip foreward */ \ + tmp2int32=(sizeof(type)-((BUF_CUR-(char *)NULL)%sizeof(type)))%sizeof(type); \ + /* check and skip */ \ + BUF_CHECK(fp,tmp2int32); \ + BUF_SKIP(tmp2int32); + +/* allocate a piece of the buffer to store an array in */ +#define BUF_ALLOC(fp,ptr,type,num) \ + /* align to the specified type width */ \ + BUF_ALIGN(fp,type); \ + /* check that we have enough room */ \ + BUF_CHECK(fp,(size_t)(num)*sizeof(type)); \ + /* store the pointer */ \ + (ptr)=(type *)BUF_CUR; \ + /* reserve the space */ \ + BUF_SKIP((size_t)(num)*sizeof(type)); + +/* read string in the buffer (using buffer, buflen and bufptr) + and store the actual location of the string in field */ +#define READ_STRING_BUF(fp,field) \ + /* read the size of the string */ \ + READ_TYPE(fp,tmpint32,int32_t); \ + DEBUG_PRINT("READ_STRING: var="__STRING(field)" strlen=%d",tmpint32); \ + /* check if read would fit */ \ + BUF_CHECK(fp,tmpint32+1); \ + /* read string from the stream */ \ + if (tmpint32>0) \ + { READ(fp,BUF_CUR,(size_t)tmpint32); } \ + /* null-terminate string in buffer */ \ + BUF_CUR[tmpint32]='\0'; \ + DEBUG_PRINT("READ_STRING: var="__STRING(field)" string=\"%s\"",BUF_CUR); \ + /* prepare result */ \ + (field)=BUF_CUR; \ + BUF_SKIP(tmpint32+1); + +/* read a string in a fixed-size "normal" buffer */ +#define READ_STRING_BUF2(fp,buffer,buflen) \ + /* read the size of the string */ \ + READ_TYPE(fp,tmpint32,int32_t); \ + DEBUG_PRINT("READ_STRING: var="__STRING(buffer)" strlen=%d",tmpint32); \ + /* check if read would fit */ \ + if (((size_t)tmpint32)>=(buflen)) \ + { \ + /* will not fit */ \ + DEBUG_PRINT("READ : buffer error: %d bytes too large",(tmpint32-(buflen))+1); \ + ERROR_OUT_BUFERROR(fp); \ + } \ + /* read string from the stream */ \ + if (tmpint32>0) \ + { READ(fp,buffer,(size_t)tmpint32); } \ + /* null-terminate string in buffer */ \ + buffer[tmpint32]='\0'; \ + DEBUG_PRINT("READ_STRING: var="__STRING(buffer)" string=\"%s\"",buffer); + +/* read a binary blob into the buffer */ +#define READ_BUF(fp,ptr,sz) \ + /* check that there is enough room and read */ \ + BUF_CHECK(fp,sz); \ + READ(fp,BUF_CUR,(size_t)sz); \ + /* store pointer and skip */ \ + (ptr)=BUF_CUR; \ + BUF_SKIP(sz); + +/* read an array from a stram and store the length of the + array in num (size for the array is allocated) */ +#define READ_STRINGLIST_NUM(fp,arr,num) \ + /* read the number of entries */ \ + READ_INT32(fp,(num)); \ + DEBUG_PRINT("READ_STRLST: var="__STRING(arr)" num=%d",(int)(num)); \ + /* allocate room for *char[num] */ \ + BUF_ALLOC(fp,arr,char *,tmpint32); \ + /* read all the strings */ \ + for (tmp2int32=0;tmp2int32<(int32_t)(num);tmp2int32++) \ + { \ + READ_STRING_BUF(fp,(arr)[tmp2int32]); \ + } + +/* read an array from a stram and store it as a null-terminated + array list (size for the array is allocated) */ +#define READ_STRINGLIST_NULLTERM(fp,arr) \ + /* read the number of entries */ \ + READ_TYPE(fp,tmp3int32,int32_t); \ + DEBUG_PRINT("READ_STRLST: var="__STRING(arr)" num=%d",(int)tmp3int32); \ + /* allocate room for *char[num+1] */ \ + BUF_ALLOC(fp,arr,char *,tmp3int32+1); \ + /* read all entries */ \ + for (tmp2int32=0;tmp2int32 +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* Vendor-specific attributes and object classes. + * (Mainly from Sun.) + * ( 1.3.6.1.4.1.42.2.27.1.2.5 NAME 'nisMailAlias' SUP top STRUCTURAL + * DESC 'NIS mail alias' + * MUST cn + * MAY rfc822MailMember ) + */ + +/* the search base for searches */ +const char *alias_base = NULL; + +/* the search scope for searches */ +int alias_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *alias_filter = "(objectClass=nisMailAlias)"; + +/* the attributes to request with searches */ +const char *attmap_alias_cn = "cn"; +const char *attmap_alias_rfc822MailMember = "rfc822MailMember"; + +/* the attribute list to request with searches */ +static const char *alias_attrs[3]; + +/* create a search filter for searching an alias by name, + return -1 on errors */ +static int mkfilter_alias_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + alias_filter, + attmap_alias_cn,buf2); +} + +static void alias_init(void) +{ + /* set up base */ + if (alias_base==NULL) + alias_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (alias_scope==LDAP_SCOPE_DEFAULT) + alias_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + alias_attrs[0]=attmap_alias_cn; + alias_attrs[1]=attmap_alias_rfc822MailMember; + alias_attrs[2]=NULL; +} + +static int write_alias(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqalias) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + const char *tmparr[2]; + const char **names,**members; + int i; + /* get the name of the alias */ + if (reqalias!=NULL) + { + names=tmparr; + names[0]=reqalias; + names[1]=NULL; + } + else + { + names=myldap_get_values(entry,attmap_alias_cn); + if ((names==NULL)||(names[0]==NULL)) + { + log_log(LOG_WARNING,"alias entry %s does not contain %s value", + myldap_get_dn(entry),attmap_alias_cn); + return 0; + } + } + /* get the members of the alias */ + members=myldap_get_values(entry,attmap_alias_rfc822MailMember); + /* for each name, write an entry */ + for (i=0;names[i]!=NULL;i++) + { + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,names[i]); + WRITE_STRINGLIST(fp,members); + } + return 0; +} + +NSLCD_HANDLE( + alias,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_alias_byname(%s)",name);, + NSLCD_ACTION_ALIAS_BYNAME, + mkfilter_alias_byname(name,filter,sizeof(filter)), + write_alias(fp,entry,name) +) + +NSLCD_HANDLE( + alias,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_alias_all()");, + NSLCD_ACTION_ALIAS_ALL, + (filter=alias_filter,0), + write_alias(fp,entry,NULL) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.c new file mode 100644 index 0000000000..22a84c3b10 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.c @@ -0,0 +1,208 @@ +/* + attmap.c - attribute mapping values and functions + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include + +#include "attmap.h" + +const char *attmap_objectClass = "objectClass"; + +/* these are the bases that are defined per database */ +extern const char *alias_base; +extern const char *ether_base; +extern const char *group_base; +extern const char *host_base; +extern const char *netgroup_base; +extern const char *network_base; +extern const char *passwd_base; +extern const char *protocol_base; +extern const char *rpc_base; +extern const char *service_base; +extern const char *shadow_base; + +const char **base_get_var(enum ldap_map_selector map) +{ + switch (map) + { + case LM_ALIASES: return &alias_base; + case LM_ETHERS: return ðer_base; + case LM_GROUP: return &group_base; + case LM_HOSTS: return &host_base; + case LM_NETGROUP: return &netgroup_base; + case LM_NETWORKS: return &network_base; + case LM_PASSWD: return &passwd_base; + case LM_PROTOCOLS: return &protocol_base; + case LM_RPC: return &rpc_base; + case LM_SERVICES: return &service_base; + case LM_SHADOW: return &shadow_base; + case LM_NONE: + default: return NULL; + } +} + +/* these are the scopes that are defined per database */ +extern int alias_scope; +extern int ether_scope; +extern int group_scope; +extern int host_scope; +extern int netgroup_scope; +extern int network_scope; +extern int passwd_scope; +extern int protocol_scope; +extern int rpc_scope; +extern int service_scope; +extern int shadow_scope; + +int *scope_get_var(enum ldap_map_selector map) +{ + switch (map) + { + case LM_ALIASES: return &alias_scope; + case LM_ETHERS: return ðer_scope; + case LM_GROUP: return &group_scope; + case LM_HOSTS: return &host_scope; + case LM_NETGROUP: return &netgroup_scope; + case LM_NETWORKS: return &network_scope; + case LM_PASSWD: return &passwd_scope; + case LM_PROTOCOLS: return &protocol_scope; + case LM_RPC: return &rpc_scope; + case LM_SERVICES: return &service_scope; + case LM_SHADOW: return &shadow_scope; + case LM_NONE: + default: return NULL; + } +} + +/* these are the filters that are defined per database */ +extern const char *alias_filter; +extern const char *ether_filter; +extern const char *group_filter; +extern const char *host_filter; +extern const char *netgroup_filter; +extern const char *network_filter; +extern const char *passwd_filter; +extern const char *protocol_filter; +extern const char *rpc_filter; +extern const char *service_filter; +extern const char *shadow_filter; + +const char **filter_get_var(enum ldap_map_selector map) +{ + switch (map) + { + case LM_ALIASES: return &alias_filter; + case LM_ETHERS: return ðer_filter; + case LM_GROUP: return &group_filter; + case LM_HOSTS: return &host_filter; + case LM_NETGROUP: return &netgroup_filter; + case LM_NETWORKS: return &network_filter; + case LM_PASSWD: return &passwd_filter; + case LM_PROTOCOLS: return &protocol_filter; + case LM_RPC: return &rpc_filter; + case LM_SERVICES: return &service_filter; + case LM_SHADOW: return &shadow_filter; + case LM_NONE: + default: return NULL; + } +} + +const char **attmap_get_var(enum ldap_map_selector map,const char *name) +{ + if (map==LM_ALIASES) + { + if (strcasecmp(name,"cn")==0) return &attmap_alias_cn; + if (strcasecmp(name,"rfc822MailMember")==0) return &attmap_alias_rfc822MailMember; + } + else if (map==LM_ETHERS) + { + if (strcasecmp(name,"cn")==0) return &attmap_ether_cn; + if (strcasecmp(name,"macAddress")==0) return &attmap_ether_macAddress; + } + else if (map==LM_GROUP) + { + if (strcasecmp(name,"cn")==0) return &attmap_group_cn; + if (strcasecmp(name,"userPassword")==0) return &attmap_group_userPassword; + if (strcasecmp(name,"gidNumber")==0) return &attmap_group_gidNumber; + if (strcasecmp(name,"memberUid")==0) return &attmap_group_memberUid; + if (strcasecmp(name,"uniqueMember")==0) return &attmap_group_uniqueMember; +/* if (strcasecmp(name,"memberOf")==0) return &attmap_group_memberOf; */ + } + else if (map==LM_HOSTS) + { + if (strcasecmp(name,"cn")==0) return &attmap_host_cn; + if (strcasecmp(name,"ipHostNumber")==0) return &attmap_host_ipHostNumber; + } + else if (map==LM_NETGROUP) + { + if (strcasecmp(name,"cn")==0) return &attmap_netgroup_cn; + if (strcasecmp(name,"nisNetgroupTriple")==0) return &attmap_netgroup_nisNetgroupTriple; + if (strcasecmp(name,"memberNisNetgroup")==0) return &attmap_netgroup_memberNisNetgroup; + } + else if (map==LM_NETWORKS) + { + if (strcasecmp(name,"cn")==0) return &attmap_network_cn; + if (strcasecmp(name,"ipNetworkNumber")==0) return &attmap_network_ipNetworkNumber; + } + else if (map==LM_PASSWD) + { + if (strcasecmp(name,"uid")==0) return &attmap_passwd_uid; + if (strcasecmp(name,"userPassword")==0) return &attmap_passwd_userPassword; + if (strcasecmp(name,"uidNumber")==0) return &attmap_passwd_uidNumber; + if (strcasecmp(name,"gidNumber")==0) return &attmap_passwd_gidNumber; + if (strcasecmp(name,"gecos")==0) return &attmap_passwd_gecos; + if (strcasecmp(name,"cn")==0) return &attmap_passwd_cn; + if (strcasecmp(name,"homeDirectory")==0) return &attmap_passwd_homeDirectory; + if (strcasecmp(name,"loginShell")==0) return &attmap_passwd_loginShell; + } + else if (map==LM_PROTOCOLS) + { + if (strcasecmp(name,"cn")==0) return &attmap_protocol_cn; + if (strcasecmp(name,"ipProtocolNumber")==0) return &attmap_protocol_ipProtocolNumber; + } + else if (map==LM_RPC) + { + if (strcasecmp(name,"cn")==0) return &attmap_rpc_cn; + if (strcasecmp(name,"oncRpcNumber")==0) return &attmap_rpc_oncRpcNumber; + } + else if (map==LM_SERVICES) + { + if (strcasecmp(name,"cn")==0) return &attmap_service_cn; + if (strcasecmp(name,"ipServicePort")==0) return &attmap_service_ipServicePort; + if (strcasecmp(name,"ipServiceProtocol")==0) return &attmap_service_ipServiceProtocol; + } + else if (map==LM_SHADOW) + { + if (strcasecmp(name,"uid")==0) return &attmap_shadow_uid; + if (strcasecmp(name,"userPassword")==0) return &attmap_shadow_userPassword; + if (strcasecmp(name,"shadowLastChange")==0) return &attmap_shadow_shadowLastChange; + if (strcasecmp(name,"shadowMin")==0) return &attmap_shadow_shadowMin; + if (strcasecmp(name,"shadowMax")==0) return &attmap_shadow_shadowMax; + if (strcasecmp(name,"shadowWarning")==0) return &attmap_shadow_shadowWarning; + if (strcasecmp(name,"shadowInactive")==0) return &attmap_shadow_shadowInactive; + if (strcasecmp(name,"shadowExpire")==0) return &attmap_shadow_shadowExpire; + if (strcasecmp(name,"shadowFlag")==0) return &attmap_shadow_shadowFlag; + } + return NULL; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.h new file mode 100644 index 0000000000..0c350ebc85 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/attmap.h @@ -0,0 +1,86 @@ +/* + attmap.h - attribute mapping variables + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _ATTMAP_H +#define _ATTMAP_H 1 + +#include "cfg.h" + +/* these are the attribute names per database */ +extern const char *attmap_alias_cn; +extern const char *attmap_alias_rfc822MailMember; +extern const char *attmap_ether_cn; +extern const char *attmap_ether_macAddress; +extern const char *attmap_group_cn; +extern const char *attmap_group_userPassword; +extern const char *attmap_group_gidNumber; +extern const char *attmap_group_memberUid; +extern const char *attmap_group_uniqueMember; +/*extern const char *attmap_group_memberOf;*/ +extern const char *attmap_host_cn; +extern const char *attmap_host_ipHostNumber; +extern const char *attmap_netgroup_cn; +extern const char *attmap_netgroup_nisNetgroupTriple; +extern const char *attmap_netgroup_memberNisNetgroup; +extern const char *attmap_network_cn; +extern const char *attmap_network_ipNetworkNumber; +/*extern const char *attmap_network_ipNetmaskNumber; */ +extern const char *attmap_passwd_uid; +extern const char *attmap_passwd_userPassword; +extern const char *attmap_passwd_uidNumber; +extern const char *attmap_passwd_gidNumber; +extern const char *attmap_passwd_gecos; +extern const char *attmap_passwd_cn; +extern const char *attmap_passwd_homeDirectory; +extern const char *attmap_passwd_loginShell; +extern const char *attmap_protocol_cn; +extern const char *attmap_protocol_ipProtocolNumber; +extern const char *attmap_rpc_cn; +extern const char *attmap_rpc_oncRpcNumber; +extern const char *attmap_service_cn; +extern const char *attmap_service_ipServicePort; +extern const char *attmap_service_ipServiceProtocol; +extern const char *attmap_shadow_uid; +extern const char *attmap_shadow_userPassword; +extern const char *attmap_shadow_shadowLastChange; +extern const char *attmap_shadow_shadowMin; +extern const char *attmap_shadow_shadowMax; +extern const char *attmap_shadow_shadowWarning; +extern const char *attmap_shadow_shadowInactive; +extern const char *attmap_shadow_shadowExpire; +extern const char *attmap_shadow_shadowFlag; + +/* return a reference to the map specific base variable */ +const char **base_get_var(enum ldap_map_selector map); + +/* return a reference to the map specific scope variable */ +int *scope_get_var(enum ldap_map_selector map); + +/* return a reference to the map specific filter variable */ +const char **filter_get_var(enum ldap_map_selector map); + +/* return a reference to the attribute mapping variable for the specified name + the name is the name after the attmap_... variables above with the + underscode replaced by a dot (e.g passwd.homeDirectory) */ +const char **attmap_get_var(enum ldap_map_selector map,const char *name); + +#endif /* not _ATTMAP_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.c new file mode 100644 index 0000000000..d1eb5b09b3 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.c @@ -0,0 +1,839 @@ +/* + cfg.c - functions for configuration information + This file contains parts that were part of the nss_ldap + library which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2007 West Consulting + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_GSSAPI_H +#include +#endif /* HAVE_GSSAPI_H */ +#ifdef HAVE_GSSAPI_GSSAPI_KRB5_H +#include +#include +#endif /* HAVE_GSSAPI_GSSAPI_KRB5_H */ + +#include "common.h" +#include "log.h" +#include "cfg.h" +#include "attmap.h" + +struct ldap_config *nslcd_cfg=NULL; + +/* the maximum line length in the configuration file */ +#define MAX_LINE_LENGTH 4096 + +/* the delimiters of tokens */ +#define TOKEN_DELIM " \t\n\r" + +/* set the configuration information to the defaults */ +static void cfg_defaults(struct ldap_config *cfg) +{ + int i; + memset(cfg,0,sizeof(struct ldap_config)); + cfg->ldc_threads=5; + for (i=0;i<(NSS_LDAP_CONFIG_URI_MAX+1);i++) + { + cfg->ldc_uris[i].uri=NULL; + cfg->ldc_uris[i].lastok=0; + cfg->ldc_uris[i].lastfail=0; + } +#ifdef LDAP_VERSION3 + cfg->ldc_version=LDAP_VERSION3; +#else /* LDAP_VERSION3 */ + cfg->ldc_version=LDAP_VERSION2; +#endif /* not LDAP_VERSION3 */ + cfg->ldc_binddn=NULL; + cfg->ldc_bindpw=NULL; + cfg->ldc_saslid=NULL; + cfg->ldc_sasl_secprops=NULL; + cfg->ldc_usesasl=0; + cfg->ldc_base=NULL; + cfg->ldc_scope=LDAP_SCOPE_SUBTREE; + cfg->ldc_deref=LDAP_DEREF_NEVER; + cfg->ldc_referrals=1; + cfg->ldc_bind_timelimit=30; + cfg->ldc_timelimit=LDAP_NO_LIMIT; + cfg->ldc_idle_timelimit=0; + cfg->ldc_reconnect_sleeptime=1; + cfg->ldc_reconnect_maxsleeptime=30; +#ifdef LDAP_OPT_X_TLS + cfg->ldc_ssl_on=SSL_OFF; + cfg->ldc_sslpath=NULL; + cfg->ldc_tls_checkpeer=-1; + cfg->ldc_tls_cacertdir=NULL; + cfg->ldc_tls_cacertfile=NULL; + cfg->ldc_tls_randfile=NULL; + cfg->ldc_tls_ciphers=NULL; + cfg->ldc_tls_cert=NULL; + cfg->ldc_tls_key=NULL; +#endif /* LDAP_OPT_X_TLS */ + cfg->ldc_restart=1; + cfg->ldc_pagesize=0; + cfg->ldc_debug=0; +} + +/* simple strdup wrapper */ +static char *xstrdup(const char *s) +{ + char *tmp; + if (s==NULL) + { + log_log(LOG_CRIT,"xstrdup() called with NULL"); + exit(EXIT_FAILURE); + } + tmp=strdup(s); + if (tmp==NULL) + { + log_log(LOG_CRIT,"strdup() failed to allocate memory"); + exit(EXIT_FAILURE); + } + return tmp; +} + +/* add a single URI to the list of URIs in the configuration */ +static void add_uri(const char *filename,int lnr, + struct ldap_config *cfg,const char *uri) +{ + int i; + log_log(LOG_DEBUG,"add_uri(%s)",uri); + /* find the place where to insert the URI */ + for (i=0;cfg->ldc_uris[i].uri!=NULL;i++) + ; + /* check for room */ + if (i>=NSS_LDAP_CONFIG_URI_MAX) + { + log_log(LOG_ERR,"%s:%d: maximum number of URIs exceeded",filename,lnr); + exit(EXIT_FAILURE); + } + /* append URI to list */ + cfg->ldc_uris[i].uri=xstrdup(uri); +} + +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 255 +#endif /* not HOST_NAME_MAX */ + +#ifdef HAVE_LDAP_DOMAIN2HOSTLIST +/* return the domain name of the current host + we return part of the structure that is retured by gethostbyname() + so there should be no need to free() this entry, however we should + use the value before any other call to gethostbyname() */ +static const char *cfg_getdomainname(const char *filename,int lnr) +{ + char hostname[HOST_NAME_MAX],*domain; + struct hostent *host; + /* lookup the hostname and with that the fqdn to extract the domain */ + if (gethostname(hostname,sizeof(hostname))<0) + { + log_log(LOG_ERR,"%s:%d: gethostname(): %s",filename,lnr,strerror(errno)); + exit(EXIT_FAILURE); + } + if ((host=gethostbyname(hostname))==NULL) + { + log_log(LOG_ERR,"%s:%d: gethostbyname(%s): %s",filename,lnr,hostname,hstrerror(h_errno)); + exit(EXIT_FAILURE); + } + /* TODO: this may fail if the fqdn is in h_aliases */ + if ((domain=strchr(host->h_name,'.'))==NULL) + { + log_log(LOG_ERR,"%s:%d: host name %s is not in fqdn form",filename,lnr,host->h_name); + exit(EXIT_FAILURE); + } + /* we're done */ + return domain+1; +} + +/* add URIs by doing DNS queries for SRV records */ +static void add_uris_from_dns(const char *filename,int lnr, + struct ldap_config *cfg) +{ + int ret=0; + const char *domain; + char *hostlist=NULL,*nxt; + char buf[HOST_NAME_MAX+sizeof("ldap://")]; + domain=cfg_getdomainname(filename,lnr); + ret=ldap_domain2hostlist(domain,&hostlist); + /* FIXME: have better error handling */ + if ((hostlist==NULL)||(*hostlist=='\0')) + { + log_log(LOG_ERR,"%s:%d: no servers found in DNS zone %s",filename,lnr,domain); + exit(EXIT_FAILURE); + } + /* hostlist is a space-separated list of host names that we use to build + URIs */ + while(hostlist!=NULL) + { + /* find the next space and split the string there */ + nxt=strchr(hostlist,' '); + if (nxt!=NULL) + { + *nxt='\0'; + nxt++; + } + /* add the URI */ + mysnprintf(buf,sizeof(buf),"ldap://%s",hostlist); + log_log(LOG_DEBUG,"add_uris_from_dns(): found uri: %s",buf); + add_uri(filename,lnr,cfg,buf); + /* get next entry from list */ + hostlist=nxt; + } +} +#endif /* HAVE_LDAP_DOMAIN2HOSTLIST */ + +static int parse_boolean(const char *filename,int lnr,const char *value) +{ + if ( (strcasecmp(value,"on")==0) || + (strcasecmp(value,"yes")==0) || + (strcasecmp(value,"true")==0) || + (strcasecmp(value,"1")==0) ) + return 1; + else if ( (strcasecmp(value,"off")==0) || + (strcasecmp(value,"no")==0) || + (strcasecmp(value,"false")==0) || + (strcasecmp(value,"0")==0) ) + return 0; + else + { + log_log(LOG_ERR,"%s:%d: not a boolean argument: '%s'",filename,lnr,value); + exit(EXIT_FAILURE); + } +} + +static int parse_scope(const char *filename,int lnr,const char *value) +{ + if ( (strcasecmp(value,"sub")==0) || (strcasecmp(value,"subtree")==0) ) + return LDAP_SCOPE_SUBTREE; + else if ( (strcasecmp(value,"one")==0) || (strcasecmp(value,"onelevel")==0) ) + return LDAP_SCOPE_ONELEVEL; + else if (strcasecmp(value,"base")==0) + return LDAP_SCOPE_BASE; + else + { + log_log(LOG_ERR,"%s:%d: not a scope argument: '%s'",filename,lnr,value); + exit(EXIT_FAILURE); + } +} + +/* This function works like strtok() except that the original string is + not modified and a pointer within str to where the next token begins + is returned (this can be used to pass to the function on the next + iteration). If no more tokens are found or the token will not fit in + the buffer, NULL is returned. */ +static char *get_token(char **line,char *buf,size_t buflen) +{ + size_t len; + if ((line==NULL)||(*line==NULL)||(**line=='\0')||(buf==NULL)) + return NULL; + /* find the beginning and length of the token */ + *line+=strspn(*line,TOKEN_DELIM); + len=strcspn(*line,TOKEN_DELIM); + /* check if there is a token */ + if (len==0) + { + *line=NULL; + return NULL; + } + /* limit the token length */ + if (len>=buflen) + len=buflen-1; + /* copy the token */ + strncpy(buf,*line,len); + buf[len]='\0'; + /* skip to the next token */ + *line+=len; + *line+=strspn(*line,TOKEN_DELIM); + /* return the token */ + return buf; +} + +static enum ldap_map_selector parse_map(const char *value) +{ + if ( (strcasecmp(value,"alias")==0) || (strcasecmp(value,"aliases")==0) ) + return LM_ALIASES; + else if ( (strcasecmp(value,"ether")==0) || (strcasecmp(value,"ethers")==0) ) + return LM_ETHERS; + else if (strcasecmp(value,"group")==0) + return LM_GROUP; + else if ( (strcasecmp(value,"host")==0) || (strcasecmp(value,"hosts")==0) ) + return LM_HOSTS; + else if (strcasecmp(value,"netgroup")==0) + return LM_NETGROUP; + else if ( (strcasecmp(value,"network")==0) || (strcasecmp(value,"networks")==0) ) + return LM_NETWORKS; + else if (strcasecmp(value,"passwd")==0) + return LM_PASSWD; + else if ( (strcasecmp(value,"protocol")==0) || (strcasecmp(value,"protocols")==0) ) + return LM_PROTOCOLS; + else if (strcasecmp(value,"rpc")==0) + return LM_RPC; + else if ( (strcasecmp(value,"service")==0) || (strcasecmp(value,"services")==0) ) + return LM_SERVICES; + else if (strcasecmp(value,"shadow")==0) + return LM_SHADOW; + else + return LM_NONE; +} + +/* check to see if the line begins with a named map */ +static enum ldap_map_selector get_map(char **line) +{ + char token[32]; + char *old; + enum ldap_map_selector map; + /* get the token */ + old=*line; + if (get_token(line,token,sizeof(token))==NULL) + return LM_NONE; + /* find the map if any */ + map=parse_map(token); + /* unknown map, return to the previous state */ + if (map==LM_NONE) + *line=old; + return map; +} + +/* check that the condition is true and otherwise log an error + and bail out */ +static inline void check_argumentcount(const char *filename,int lnr, + const char *keyword,int condition) +{ + if (!condition) + { + log_log(LOG_ERR,"%s:%d: %s: wrong number of arguments",filename,lnr,keyword); + exit(EXIT_FAILURE); + } +} + +static void get_int(const char *filename,int lnr, + const char *keyword,char **line, + int *var) +{ + /* TODO: refactor to have less overhead */ + char token[32]; + check_argumentcount(filename,lnr,keyword,get_token(line,token,sizeof(token))!=NULL); + /* TODO: replace with correct numeric parse */ + *var=atoi(token); +} + +static void get_boolean(const char *filename,int lnr, + const char *keyword,char **line, + int *var) +{ + /* TODO: refactor to have less overhead */ + char token[32]; + check_argumentcount(filename,lnr,keyword,get_token(line,token,sizeof(token))!=NULL); + *var=parse_boolean(filename,lnr,token); +} + +static void get_strdup(const char *filename,int lnr, + const char *keyword,char **line, + char **var) +{ + /* TODO: refactor to have less overhead */ + char token[64]; + check_argumentcount(filename,lnr,keyword,get_token(line,token,sizeof(token))!=NULL); + if ((*var==NULL)||(strcmp(*var,token)!=0)) + { + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(token); + } +} + +static void get_restdup(const char *filename,int lnr, + const char *keyword,char **line, + char **var) +{ + check_argumentcount(filename,lnr,keyword,(*line!=NULL)&&(**line!='\0')); + if ((*var==NULL)||(strcmp(*var,*line)!=0)) + { + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(*line); + } + *line=NULL; +} + +static void get_eol(const char *filename,int lnr, + const char *keyword,char **line) +{ + if ((line!=NULL)&&(*line!=NULL)&&(**line!='\0')) + { + log_log(LOG_ERR,"%s:%d: %s: too may arguments",filename,lnr,keyword); + exit(EXIT_FAILURE); + } +} + +static void parse_krb5_ccname_statement(const char *filename,int lnr, + const char *keyword,char *line) +{ + char token[80]; + const char *ccname; + const char *ccfile; + size_t ccenvlen; + char *ccenv; +#ifdef HAVE_GSS_KRB5_CCACHE_NAME + OM_uint32 minor_status; +# endif /* HAVE_GSS_KRB5_CCACHE_NAME */ + /* get token */ + check_argumentcount(filename,lnr,keyword, + (get_token(&line,token,sizeof(token))!=NULL)&&(*line=='\0')); + /* set default kerberos ticket cache for SASL-GSSAPI */ + ccname=token; + /* check that cache exists and is readable if it is a file */ + if ( (strncasecmp(ccname,"FILE:",sizeof("FILE:")-1)==0) || + (strncasecmp(ccname,"WRFILE:",sizeof("WRFILE:")-1)==0)) + { + ccfile=strchr(ccname,':')+1; + if (access(ccfile,R_OK)!=0) + { + log_log(LOG_ERR,"%s:%d: error accessing %s: %s",filename,lnr,ccfile,strerror(errno)); + exit(EXIT_FAILURE); + } + } + /* set the environment variable (we have a memory leak if this option + is set multiple times) */ + ccenvlen=strlen(ccname)+sizeof("KRB5CCNAME="); + ccenv=(char *)malloc(ccenvlen); + if (ccenv==NULL) + { + log_log(LOG_CRIT,"malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + mysnprintf(ccenv,ccenvlen,"KRB5CCNAME=%s",ccname); + putenv(ccenv); +#ifdef HAVE_GSS_KRB5_CCACHE_NAME + /* set the name with gss_krb5_ccache_name() */ + if (gss_krb5_ccache_name(&minor_status,ccname,NULL)!=GSS_S_COMPLETE) + { + log_log(LOG_ERR,"%s:%d: unable to set default credential cache: %s",filename,lnr,ccname); + exit(EXIT_FAILURE); + } +# endif /* HAVE_GSS_KRB5_CCACHE_NAME */ +} + +/* assigns the base to the specified variable doing domain expansion + and a simple check to avoid overwriting duplicate values */ +static void set_base(const char *filename,int lnr, + const char *value,const char **var) +{ +#ifdef HAVE_LDAP_DOMAIN2DN + char *domaindn=NULL; +#endif /* HAVE_LDAP_DOMAIN2DN */ + /* if the base is "DOMAIN" use the domain name */ + if (strcasecmp(value,"domain")==0) + { +#ifdef HAVE_LDAP_DOMAIN2DN + ldap_domain2dn(cfg_getdomainname(filename,lnr),&domaindn); + log_log(LOG_DEBUG,"set_base(): setting base to %s from domain",domaindn); + value=domaindn; +#else /* not HAVE_LDAP_DOMAIN2DN */ + log_log(LOG_ERR,"%s:%d: value %s not supported on platform",filename,lnr,value); + exit(EXIT_FAILURE); +#endif /* not HAVE_LDAP_DOMAIN2DN */ + } + /* check if the value will be changed */ + if ((*var==NULL)||(strcmp(*var,value)!=0)) + { + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(value); + } +} + +static void parse_base_statement(const char *filename,int lnr, + const char *keyword,char *line, + struct ldap_config *cfg) +{ + const char **var; + var=base_get_var(get_map(&line)); + if (var==NULL) + var=(const char **)&(cfg->ldc_base); + check_argumentcount(filename,lnr,keyword,(line!=NULL)&&(*line!='\0')); + set_base(filename,lnr,line,var); +} + +static void parse_scope_statement(const char *filename,int lnr, + const char *keyword,char *line, + struct ldap_config *cfg) +{ + int *var; + var=scope_get_var(get_map(&line)); + if (var==NULL) + var=&cfg->ldc_scope; + check_argumentcount(filename,lnr,keyword,(line!=NULL)&&(*line!='\0')); + *var=parse_scope(filename,lnr,line); +} + +static void parse_filter_statement(const char *filename,int lnr, + const char *keyword,char *line) +{ + const char **var; + const char *map=line; + var=filter_get_var(get_map(&line)); + if (var==NULL) + { + log_log(LOG_ERR,"%s:%d: unknown map: '%s'",filename,lnr,map); + exit(EXIT_FAILURE); + } + check_argumentcount(filename,lnr,keyword,(line!=NULL)&&(*line!='\0')); + /* check if the value will be changed */ + if (strcmp(*var,line)!=0) + { + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(line); + } +} + +/* this function modifies the statement argument passed */ +static void parse_map_statement(const char *filename,int lnr, + const char *keyword,char *line) +{ + enum ldap_map_selector map; + const char **var; + char oldatt[32], newatt[32]; + /* get the map */ + if ((map=get_map(&line))==LM_NONE) + { + log_log(LOG_ERR,"%s:%d: unknown map: '%s'",filename,lnr,line); + exit(EXIT_FAILURE); + } + /* read the other tokens */ + check_argumentcount(filename,lnr,keyword, + (get_token(&line,oldatt,sizeof(oldatt))!=NULL)&& + (get_token(&line,newatt,sizeof(newatt))!=NULL)); + /* check that there are no more tokens left on the line */ + get_eol(filename,lnr,keyword,&line); + /* get the attribute variable to set */ + var=attmap_get_var(map,oldatt); + if (var==NULL) + { + log_log(LOG_ERR,"%s:%d: unknown attribute to map: '%s'",filename,lnr,oldatt); + exit(EXIT_FAILURE); + } + /* check if the value will be changed */ + if ( (*var==NULL) || (strcmp(*var,newatt)!=0) ) + { + /* Note: we have a memory leak here if a single mapping is changed + multiple times in one config (deemed not a problem) */ + *var=xstrdup(newatt); + } +} + +static void cfg_read(const char *filename,struct ldap_config *cfg) +{ + FILE *fp; + int lnr=0; + char linebuf[MAX_LINE_LENGTH]; + char *line; + char keyword[32]; + char token[64]; + int i; + /* open config file */ + if ((fp=fopen(filename,"r"))==NULL) + { + log_log(LOG_ERR,"cannot open config file (%s): %s",filename,strerror(errno)); + exit(EXIT_FAILURE); + } + /* read file and parse lines */ + while (fgets(linebuf,MAX_LINE_LENGTH,fp)!=NULL) + { + lnr++; + line=linebuf; + /* strip newline */ + i=(int)strlen(line); + if ((i<=0)||(line[i-1]!='\n')) + { + log_log(LOG_ERR,"%s:%d: line too long or last line missing newline",filename,lnr); + exit(EXIT_FAILURE); + } + line[i-1]='\0'; + /* ignore comment lines */ + if (line[0]=='#') + continue; + /* strip trailing spaces */ + for (i--;(i>0)&&isspace(line[i-1]);i--) + line[i-1]='\0'; + /* get keyword from line and ignore empty lines */ + if (get_token(&line,keyword,sizeof(keyword))==NULL) + continue; + /* runtime options */ + if (strcasecmp(keyword,"threads")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_threads); + get_eol(filename,lnr,keyword,&line); + } + /* general connection options */ + else if (strcasecmp(keyword,"uri")==0) + { + check_argumentcount(filename,lnr,keyword,(line!=NULL)&&(*line!='\0')); + while (get_token(&line,token,sizeof(token))!=NULL) + { + if (strcasecmp(token,"dns")==0) + { +#ifdef HAVE_LDAP_DOMAIN2HOSTLIST + add_uris_from_dns(filename,lnr,cfg); +#else /* not HAVE_LDAP_DOMAIN2HOSTLIST */ + log_log(LOG_ERR,"%s:%d: value %s not supported on platform",filename,lnr,token); + exit(EXIT_FAILURE); +#endif /* not HAVE_LDAP_DOMAIN2HOSTLIST */ + } + else + add_uri(filename,lnr,cfg,token); + } + } + else if (strcasecmp(keyword,"ldap_version")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_version); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"binddn")==0) + { + get_restdup(filename,lnr,keyword,&line,&cfg->ldc_binddn); + } + else if (strcasecmp(keyword,"bindpw")==0) + { + get_restdup(filename,lnr,keyword,&line,&cfg->ldc_bindpw); + } + /* SASL authentication options */ + else if (strcasecmp(keyword,"sasl_authid")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_saslid); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"sasl_secprops")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_sasl_secprops); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"use_sasl")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_boolean(filename,lnr,keyword,&line,&cfg->ldc_usesasl); + get_eol(filename,lnr,keyword,&line); + } + /* Kerberos authentication options */ + else if (strcasecmp(keyword,"krb5_ccname")==0) + { + parse_krb5_ccname_statement(filename,lnr,keyword,line); + } + /* search/mapping options */ + else if (strcasecmp(keyword,"base")==0) + { + parse_base_statement(filename,lnr,keyword,line,cfg); + } + else if (strcasecmp(keyword,"scope")==0) + { + parse_scope_statement(filename,lnr,keyword,line,cfg); + } + else if (strcasecmp(keyword,"deref")==0) + { + check_argumentcount(filename,lnr,keyword, + (get_token(&line,token,sizeof(token))!=NULL)); + if (strcasecmp(token,"never")==0) + cfg->ldc_deref=LDAP_DEREF_NEVER; + else if (strcasecmp(token,"searching")==0) + cfg->ldc_deref=LDAP_DEREF_SEARCHING; + else if (strcasecmp(token,"finding")==0) + cfg->ldc_deref=LDAP_DEREF_FINDING; + else if (strcasecmp(token,"always")==0) + cfg->ldc_deref=LDAP_DEREF_ALWAYS; + else + { + log_log(LOG_ERR,"%s:%d: wrong argument: '%s'",filename,lnr,token); + exit(EXIT_FAILURE); + } + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"referrals")==0) + { + get_boolean(filename,lnr,keyword,&line,&cfg->ldc_referrals); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"filter")==0) + { + parse_filter_statement(filename,lnr,keyword,line); + } + else if (strcasecmp(keyword,"map")==0) + { + parse_map_statement(filename,lnr,keyword,line); + } + /* timing/reconnect options */ + else if (strcasecmp(keyword,"bind_timelimit")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_bind_timelimit); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"timelimit")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_timelimit); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"idle_timelimit")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_idle_timelimit); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"reconnect_tries")==0) + log_log(LOG_WARNING,"%s:%d: option %s has been removed and will be ignored",filename,lnr,keyword); + else if (!strcasecmp(keyword,"reconnect_sleeptime")) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_reconnect_sleeptime); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"reconnect_maxsleeptime")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_reconnect_maxsleeptime); + get_eol(filename,lnr,keyword,&line); + } +#ifdef LDAP_OPT_X_TLS + /* SSL/TLS options */ + else if (strcasecmp(keyword,"ssl")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + check_argumentcount(filename,lnr,keyword, + (get_token(&line,token,sizeof(token))!=NULL)); + if (strcasecmp(token,"start_tls")==0) + cfg->ldc_ssl_on=SSL_START_TLS; + else if (parse_boolean(filename,lnr,token)) + cfg->ldc_ssl_on=SSL_LDAPS; + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"sslpath")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_sslpath); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } + else if (strcasecmp(keyword,"tls_checkpeer")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_boolean(filename,lnr,keyword,&line,&cfg->ldc_tls_checkpeer); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"tls_cacertdir")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_tls_cacertdir); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } + else if (strcasecmp(keyword,"tls_cacertfile")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_tls_cacertfile); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } + else if (strcasecmp(keyword,"tls_randfile")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_tls_randfile); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } + else if (strcasecmp(keyword,"tls_ciphers")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_restdup(filename,lnr,keyword,&line,&cfg->ldc_tls_ciphers); + } + else if (strcasecmp(keyword,"tls_cert")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_tls_cert); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } + else if (strcasecmp(keyword,"tls_key")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (please report any successes)",filename,lnr,keyword); + get_strdup(filename,lnr,keyword,&line,&cfg->ldc_tls_key); + get_eol(filename,lnr,keyword,&line); + /* TODO: check that the path is valid */ + } +#endif /* LDAP_OPT_X_TLS */ + /* other options */ + else if (strcasecmp(keyword,"restart")==0) + { + log_log(LOG_WARNING,"%s:%d: option %s is currently untested (and may be removed in an upcoming release)",filename,lnr,keyword); + get_boolean(filename,lnr,keyword,&line,&cfg->ldc_restart); + get_eol(filename,lnr,keyword,&line); + } + else if (strcasecmp(keyword,"pagesize")==0) + { + get_int(filename,lnr,keyword,&line,&cfg->ldc_pagesize); + get_eol(filename,lnr,keyword,&line); + } + /* fallthrough */ + else + { + log_log(LOG_ERR,"%s:%d: unknown keyword: '%s'",filename,lnr,keyword); + exit(EXIT_FAILURE); + } + } + /* we're done reading file, close */ + fclose(fp); +} + +void cfg_init(const char *fname) +{ + /* check if we were called before */ + if (nslcd_cfg!=NULL) + { + log_log(LOG_CRIT,"cfg_init() may only be called once"); + exit(EXIT_FAILURE); + } + /* allocate the memory (this memory is not freed anywhere) */ + nslcd_cfg=(struct ldap_config *)malloc(sizeof(struct ldap_config)); + if (nslcd_cfg==NULL) + { + log_log(LOG_CRIT,"malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + /* clear configuration */ + cfg_defaults(nslcd_cfg); + /* read configfile */ + cfg_read(fname,nslcd_cfg); + /* do some sanity checks */ + if (nslcd_cfg->ldc_uris[0].uri==NULL) + { + log_log(LOG_ERR,"no URIs defined in config"); + exit(EXIT_FAILURE); + } +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.h new file mode 100644 index 0000000000..a67657aa6f --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/cfg.h @@ -0,0 +1,140 @@ +/* + cfg.h - definition of configuration information + This file contains parts that were part of the nss_ldap + library which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2007 West Consulting + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _CFG_H +#define _CFG_H + +#include "compat/attrs.h" + +/* maximum number of URIs */ +#define NSS_LDAP_CONFIG_URI_MAX 31 + +enum ldap_ssl_options +{ + SSL_OFF, + SSL_LDAPS, + SSL_START_TLS +}; + +/* selectors for different maps */ +enum ldap_map_selector +{ + LM_PASSWD, + LM_SHADOW, + LM_GROUP, + LM_HOSTS, + LM_SERVICES, + LM_NETWORKS, + LM_PROTOCOLS, + LM_RPC, + LM_ETHERS, + LM_ALIASES, + LM_NETGROUP, + LM_NONE +}; + +struct myldap_uri +{ + char *uri; + /* timestamp of last ok search */ + time_t lastok; + /* timestamp of last ok search */ + time_t lastfail; +}; + +struct ldap_config +{ + /* the number of threads to start */ + int ldc_threads; + /* NULL terminated list of URIs */ + struct myldap_uri ldc_uris[NSS_LDAP_CONFIG_URI_MAX+1]; + /* protocol version */ + int ldc_version; + /* bind DN */ + char *ldc_binddn; + /* bind cred */ + char *ldc_bindpw; + /* sasl auth id */ + char *ldc_saslid; + /* sasl security */ + char *ldc_sasl_secprops; + /* do we use sasl when binding? */ + int ldc_usesasl; + /* base DN, eg. dc=gnu,dc=org */ + char *ldc_base; + /* scope for searches */ + int ldc_scope; + /* dereference aliases/links */ + int ldc_deref; + /* chase referrals */ + int ldc_referrals; + /* bind timelimit */ + int ldc_bind_timelimit; + /* search timelimit */ + int ldc_timelimit; + /* idle timeout */ + int ldc_idle_timelimit; + /* seconds to sleep; doubled until max */ + int ldc_reconnect_sleeptime; + /* maximum seconds to sleep */ + int ldc_reconnect_maxsleeptime; +#ifdef LDAP_OPT_X_TLS + /* SSL enabled */ + enum ldap_ssl_options ldc_ssl_on; + /* SSL certificate path */ + char *ldc_sslpath; + /* tls check peer */ + int ldc_tls_checkpeer; + /* tls ca certificate dir */ + char *ldc_tls_cacertdir; + /* tls ca certificate file */ + char *ldc_tls_cacertfile; + /* tls randfile */ + char *ldc_tls_randfile; + /* tls ciphersuite */ + char *ldc_tls_ciphers; + /* tls certificate */ + char *ldc_tls_cert; + /* tls key */ + char *ldc_tls_key; +#endif /* LDAP_OPT_X_TLS */ + /* whether the LDAP library should restart the select(2) system call when interrupted */ + int ldc_restart; + /* set to a greater than 0 to enable handling of paged results with the specified size */ + int ldc_pagesize; + /* LDAP debug level */ + int ldc_debug; +}; + +/* this is a pointer to the global configuration, it should be available + once cfg_init() was called */ +extern struct ldap_config *nslcd_cfg; + +/* Initialize the configuration in nslcd_cfg. This method + will read the default configuration file and call exit() + if an error occurs. */ +void cfg_init(const char *fname); + +#endif /* _CFG_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.c new file mode 100644 index 0000000000..a181dcafd3 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.c @@ -0,0 +1,139 @@ +/* + common.c - common server code routines + This file is part of the nss-ldapd library. + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nslcd.h" +#include "common.h" +#include "log.h" + +/* simple wrapper around snptintf() to return non-0 in case + of any failure (but always keep string 0-terminated) */ +int mysnprintf(char *buffer,size_t buflen,const char *format, ...) +{ + int res; + va_list ap; + /* do snprintf */ + va_start(ap,format); + res=vsnprintf(buffer,buflen,format,ap); + /* NULL-terminate the string just to be on the safe side */ + buffer[buflen-1]='\0'; + /* check if the string was completely written */ + return ((res<0)||(((size_t)res)>=buflen)); +} + +const char *get_userpassword(MYLDAP_ENTRY *entry,const char *attr) +{ + const char **values; + int i; + /* get the entries */ + values=myldap_get_values(entry,attr); + if ((values==NULL)||(values[0]==NULL)) + return NULL; + /* go over the entries and return the remainder of the value if it + starts with {crypt} or crypt$ */ + for (i=0;values[i]!=NULL;i++) + { + if (strncasecmp(values[i],"{crypt}",7)==0) + return values[i]+7; + if (strncasecmp(values[i],"crypt$",6)==0) + return values[i]+6; + } + /* just return the first value completely */ + return values[0]; + /* TODO: support more password formats e.g. SMD5 + (which is $1$ but in a different format) + (any code for this is more than welcome) */ +} + +/* this writes a single address to the stream */ +int write_address(TFILE *fp,const char *addr) +{ + int32_t tmpint32; + struct in_addr ipv4addr; + struct in6_addr ipv6addr; + /* try to parse the address as IPv4 first, fall back to IPv6 */ + if (inet_pton(AF_INET,addr,&ipv4addr)>0) + { + /* write address type */ + WRITE_INT32(fp,AF_INET); + /* write the address length */ + WRITE_INT32(fp,sizeof(struct in_addr)); + /* write the address itself (in network byte order) */ + WRITE_TYPE(fp,ipv4addr,struct in_addr); + } + else if (inet_pton(AF_INET6,addr,&ipv6addr)>0) + { + /* write address type */ + WRITE_INT32(fp,AF_INET6); + /* write the address length */ + WRITE_INT32(fp,sizeof(struct in6_addr)); + /* write the address itself (in network byte order) */ + WRITE_TYPE(fp,ipv6addr,struct in6_addr); + } + else + { + /* failure, log but write simple invalid address + (otherwise the address list is messed up) */ + /* TODO: have error message in correct format */ + log_log(LOG_WARNING,"unparseble address: %s",addr); + /* write an illegal address type */ + WRITE_INT32(fp,-1); + /* write an emtpy address */ + WRITE_INT32(fp,0); + } + /* we're done */ + return 0; +} + +int read_address(TFILE *fp,char *addr,int *addrlen,int *af) +{ + int32_t tmpint32; + int len; + /* read address family */ + READ_INT32(fp,*af); + if ((*af!=AF_INET)&&(*af!=AF_INET6)) + { + log_log(LOG_WARNING,"incorrect address family specified: %d",*af); + return -1; + } + /* read address length */ + READ_INT32(fp,len); + if ((len>*addrlen)||(len<=0)) + { + log_log(LOG_WARNING,"address length incorrect: %d",len); + return -1; + } + *addrlen=len; + /* read address */ + READ(fp,addr,len); + /* we're done */ + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.h new file mode 100644 index 0000000000..87d6298ac8 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/common.h @@ -0,0 +1,162 @@ +/* + common.h - common server code routines + This file is part of the nss-ldapd library. + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _SERVER_COMMON_H +#define _SERVER_COMMON_H 1 + +#include "nslcd.h" +#include "nslcd-common.h" +#include "common/tio.h" +#include "compat/attrs.h" +#include "myldap.h" + +/* macros for basic read and write operations, the following + ERROR_OUT* marcos define the action taken on errors + the stream is not closed because the caller closes the + stream */ + +#define ERROR_OUT_WRITEERROR(fp) \ + log_log(LOG_WARNING,"error writing to client"); \ + return -1; + +#define ERROR_OUT_READERROR(fp) \ + log_log(LOG_WARNING,"error reading from client"); \ + return -1; + +#define ERROR_OUT_BUFERROR(fp) \ + log_log(LOG_WARNING,"client supplied argument too large"); \ + return -1; + +/* a simple wrapper around snprintf, + returns 0 if ok, -1 on error */ +int mysnprintf(char *buffer,size_t buflen,const char *format, ...) + LIKE_PRINTF(3,4); + +/* This tries to get the user password attribute from the entry. + It will try to return an encrypted password as it is used in /etc/passwd, + /etc/group or /etc/shadow depending upon what is in the directory. + This function will return NULL if no passwd is found and will return the + literal value in the directory if conversion is not possible. */ +const char *get_userpassword(MYLDAP_ENTRY *entry,const char *attr); + +/* write out an address, parsing the addr value */ +int write_address(TFILE *fp,const char *addr); + +/* a helper macro to write out addresses and bail out on errors */ +#define WRITE_ADDRESS(fp,addr) \ + if (write_address(fp,addr)) \ + return -1; + +/* read an address from the stream */ +int read_address(TFILE *fp,char *addr,int *addrlen,int *af); + +/* helper macro to read an address from the stream */ +#define READ_ADDRESS(fp,addr,len,af) \ + len=(int)sizeof(addr); \ + if (read_address(fp,addr,&(len),&(af))) \ + return -1; + +/* checks to see if the specified string is a valid username */ +MUST_USE int isvalidusername(const char *name); + +/* transforms the DN info a uid doing an LDAP lookup if needed */ +MUST_USE char *dn2uid(MYLDAP_SESSION *session,const char *dn,char *buf,size_t buflen); + +/* transforms the uid into a DN by doing an LDAP lookup */ +MUST_USE char *uid2dn(MYLDAP_SESSION *session,const char *uid,char *buf,size_t buflen); + +/* these are the different functions that handle the database + specific actions, see nslcd.h for the action descriptions */ +int nslcd_alias_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_alias_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_ether_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_ether_byether(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_ether_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_group_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_group_bygid(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_group_bymember(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_group_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_host_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_host_byaddr(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_host_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_netgroup_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_network_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_network_byaddr(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_network_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_passwd_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_passwd_byuid(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_passwd_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_protocol_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_protocol_bynumber(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_protocol_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_rpc_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_rpc_bynumber(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_rpc_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_service_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_service_bynumber(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_service_all(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_shadow_byname(TFILE *fp,MYLDAP_SESSION *session); +int nslcd_shadow_all(TFILE *fp,MYLDAP_SESSION *session); + +/* macro for generating service handling code */ +#define NSLCD_HANDLE(db,fn,readfn,logcall,action,mkfilter,writefn) \ + int nslcd_##db##_##fn(TFILE *fp,MYLDAP_SESSION *session) \ + { \ + /* define common variables */ \ + int32_t tmpint32; \ + MYLDAP_SEARCH *search; \ + MYLDAP_ENTRY *entry; \ + int rc; \ + /* read request parameters */ \ + readfn; \ + /* log call */ \ + logcall; \ + /* write the response header */ \ + WRITE_INT32(fp,NSLCD_VERSION); \ + WRITE_INT32(fp,action); \ + /* prepare the search filter */ \ + if (mkfilter) \ + { \ + log_log(LOG_WARNING,"nslcd_" __STRING(db) "_" __STRING(fn) "(): filter buffer too small"); \ + return -1; \ + } \ + /* build the list of attributes */ \ + db##_init(); \ + /* do the LDAP search */ \ + if ((search=myldap_search(session,db##_base,db##_scope,filter,db##_attrs))==NULL) \ + return -1; \ + /* go over results */ \ + while ((entry=myldap_get_entry(search,&rc))!=NULL) \ + { \ + if (writefn) \ + return -1; \ + } \ + /* write the final result code */ \ + if (rc==LDAP_SUCCESS) \ + { \ + WRITE_INT32(fp,NSLCD_RESULT_END); \ + } \ + return 0; \ + } + +#endif /* not _SERVER_COMMON_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/ether.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/ether.c new file mode 100644 index 0000000000..53d47160af --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/ether.c @@ -0,0 +1,203 @@ +/* + ether.c - ethernet address entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-ethers.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" +#include "compat/ether.h" + +/* ( nisSchema.2.11 NAME 'ieee802Device' SUP top AUXILIARY + * DESC 'A device with a MAC address; device SHOULD be + * used as a structural class' + * MAY macAddress ) + */ + +/* the search base for searches */ +const char *ether_base = NULL; + +/* the search scope for searches */ +int ether_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *ether_filter = "(objectClass=ieee802Device)"; + +/* the attributes to request with searches */ +const char *attmap_ether_cn = "cn"; +const char *attmap_ether_macAddress = "macAddress"; + +/* the attribute list to request with searches */ +static const char *ether_attrs[3]; + +/* create a search filter for searching an ethernet address + by name, return -1 on errors */ +static int mkfilter_ether_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if(myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + ether_filter, + attmap_ether_cn,buf2); +} + +static int mkfilter_ether_byether(const struct ether_addr *addr, + char *buffer,size_t buflen) +{ + char buf2[20]; + /* transform into string */ + if (ether_ntoa_r(addr,buf2)==NULL) + return -1; + /* FIXME: this has a bug when the directory has 01:00:0e:... + and we're looking for 1:0:e:... (leading zeros) */ + /* there should be no characters that need escaping */ + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + ether_filter, + attmap_ether_macAddress,buf2); +} + +static void ether_init(void) +{ + /* set up base */ + if (ether_base==NULL) + ether_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (ether_scope==LDAP_SCOPE_DEFAULT) + ether_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + ether_attrs[0]=attmap_ether_cn; + ether_attrs[1]=attmap_ether_macAddress; + ether_attrs[2]=NULL; +} + +/* TODO: check for errors in aton() */ +#define WRITE_ETHER(fp,addr) \ + ether_aton_r(addr,&tmpaddr); \ + WRITE_TYPE(fp,tmpaddr,uint8_t[6]); + +static int write_ether(TFILE *fp,MYLDAP_ENTRY *entry, + const char *reqname,const char *reqether) +{ + int32_t tmpint32; + struct ether_addr tmpaddr; + const char *tmparr[2]; + const char **names,**ethers; + int i,j; + /* get the name of the ether entry */ + if (reqname!=NULL) + { + names=tmparr; + names[0]=reqname; + names[1]=NULL; + } + else + { + names=myldap_get_values(entry,attmap_ether_cn); + if ((names==NULL)||(names[0]==NULL)) + { + log_log(LOG_WARNING,"ether entry %s does not contain %s value", + myldap_get_dn(entry),attmap_ether_cn); + return 0; + } + } + /* get the addresses */ + if (reqether!=NULL) + { + ethers=tmparr; + ethers[0]=reqether; + ethers[1]=NULL; + } + else + { + ethers=myldap_get_values(entry,attmap_ether_macAddress); + if ((ethers==NULL)||(ethers[0]==NULL)) + { + log_log(LOG_WARNING,"ether entry %s does not contain %s value", + myldap_get_dn(entry),attmap_ether_macAddress); + return 0; + } + /* TODO: move parsing of addresses up here */ + } + /* write entries for all names and addresses */ + for (i=0;names[i]!=NULL;i++) + for (j=0;ethers[j]!=NULL;j++) + { + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,names[i]); + WRITE_ETHER(fp,ethers[j]); + } + return 0; +} + +NSLCD_HANDLE( + ether,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_ether_byname(%s)",name);, + NSLCD_ACTION_ETHER_BYNAME, + mkfilter_ether_byname(name,filter,sizeof(filter)), + write_ether(fp,entry,name,NULL) +) + +NSLCD_HANDLE( + ether,byether, + struct ether_addr addr; + char ether[20]; + char filter[1024]; + READ_TYPE(fp,addr,uint8_t[6]); + if (ether_ntoa_r(&addr,ether)==NULL) + return -1;, + log_log(LOG_DEBUG,"nslcd_ether_byether(%s)",ether);, + NSLCD_ACTION_ETHER_BYETHER, + mkfilter_ether_byether(&addr,filter,sizeof(filter)), + write_ether(fp,entry,NULL,ether) +) + +NSLCD_HANDLE( + ether,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_ether_all()");, + NSLCD_ACTION_ETHER_ALL, + (filter=ether_filter,0), + write_ether(fp,entry,NULL,NULL) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/group.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/group.c new file mode 100644 index 0000000000..0d3a5b5799 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/group.c @@ -0,0 +1,384 @@ +/* + group.c - group entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-grp.c) which + has been forked into the nss-ldapd library. + + Copyright (C) 1997-2006 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +/* for gid_t */ +#include + +#include "common/set.h" +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.2 NAME 'posixGroup' SUP top STRUCTURAL + * DESC 'Abstraction of a group of accounts' + * MUST ( cn $ gidNumber ) + * MAY ( userPassword $ memberUid $ description ) ) + * + * apart from that the above the uniqueMember attributes may be + * supported in a coming release (they map to DNs, which is an extra + * lookup step) + * + * using nested groups (groups that are member of a group) is currently + * not supported, this may be added in a later release + */ + +/* the search base for searches */ +const char *group_base = NULL; + +/* the search scope for searches */ +int group_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *group_filter = "(objectClass=posixGroup)"; + +/* the attributes to request with searches */ +const char *attmap_group_cn = "cn"; +const char *attmap_group_userPassword = "userPassword"; +const char *attmap_group_gidNumber = "gidNumber"; +const char *attmap_group_memberUid = "memberUid"; +const char *attmap_group_uniqueMember = "uniqueMember"; +/*const char *attmap_group_memberOf = "memberOf";*/ + +/* default values for attributes */ +static const char *default_group_userPassword = "*"; /* unmatchable */ + + +/* the attribute list to request with searches */ +static const char *group_attrs[6]; + +/* create a search filter for searching a group entry + by name, return -1 on errors */ +static int mkfilter_group_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if(myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + group_filter, + attmap_group_cn,buf2); +} + +/* create a search filter for searching a group entry + by gid, return -1 on errors */ +static int mkfilter_group_bygid(gid_t gid, + char *buffer,size_t buflen) +{ + return mysnprintf(buffer,buflen, + "(&%s(%s=%d))", + group_filter, + attmap_group_gidNumber,gid); +} + +/* create a search filter for searching a group entry + by member uid, return -1 on errors */ +static int mkfilter_group_bymember(MYLDAP_SESSION *session, + const char *uid, + char *buffer,size_t buflen) +{ + char buf[80],*dn; + /* try to translate uid to DN */ + dn=uid2dn(session,uid,buf,sizeof(buf)); + if (dn==NULL) + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + group_filter, + attmap_group_memberUid,uid); + else /* also lookup using user DN */ + return mysnprintf(buffer,buflen, + "(&%s(|(%s=%s)(%s=%s)))", + group_filter, + attmap_group_memberUid,uid, + attmap_group_uniqueMember,dn); +} + +static void group_init(void) +{ + /* set up base */ + if (group_base==NULL) + group_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (group_scope==LDAP_SCOPE_DEFAULT) + group_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + group_attrs[0]=attmap_group_cn; + group_attrs[1]=attmap_group_userPassword; + group_attrs[2]=attmap_group_memberUid; + group_attrs[3]=attmap_group_gidNumber; + group_attrs[4]=attmap_group_uniqueMember; + group_attrs[5]=NULL; +} + +/* + Checks to see if the specified name is a valid group name. + + This test is based on the definition from POSIX (IEEE Std 1003.1, 2004, + 3.189 Group Name and 3.276 Portable Filename Character Set): + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_189 + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276 + + The standard defines group names valid if they only contain characters from + the set [A-Za-z0-9._-] where the hyphen should not be used as first + character. +*/ +static int isvalidgroupname(const char *name) +{ + int i; + if ((name==NULL)||(name[0]=='\0')) + return 0; + /* check first character */ + if ( ! ( (name[0]>='A' && name[0] <= 'Z') || + (name[0]>='a' && name[0] <= 'z') || + (name[0]>='0' && name[0] <= '9') || + name[0]=='.' || name[0]=='_' ) ) + return 0; + /* check other characters */ + for (i=1;name[i]!='\0';i++) + { + if ( ! ( (name[i]>='A' && name[i] <= 'Z') || + (name[i]>='a' && name[i] <= 'z') || + (name[i]>='0' && name[i] <= '9') || + name[i]=='.' || name[i]=='_' || name[i]=='-') ) + return 0; + } + /* no test failed so it must be good */ + return -1; +} + +static int do_write_group( + TFILE *fp,MYLDAP_ENTRY *entry,const char **names,gid_t gids[],int numgids, + const char *passwd,SET *members) +{ + int32_t tmpint32; + int i,j; + int nummembers; + const char *tmp; + /* count the number of members */ + nummembers=0; + if (members!=NULL) + { + set_loop_first(members); + while (set_loop_next(members)!=NULL) + nummembers++; + } + /* write entries for all names and gids */ + for (i=0;names[i]!=NULL;i++) + { + if (!isvalidgroupname(names[i])) + { + log_log(LOG_WARNING,"group entry %s contains invalid group name: \"%s\"", + myldap_get_dn(entry),names[i]); + } + else + { + for (j=0;juid lookups as needed) */ +static SET *getmembers(MYLDAP_ENTRY *entry,MYLDAP_SESSION *session) +{ + char buf[20]; + int i; + const char **values; + SET *set; + set=set_new(); + if (set==NULL) + return NULL; + /* add the memberUid values */ + values=myldap_get_values(entry,attmap_group_memberUid); + if (values!=NULL) + for (i=0;values[i]!=NULL;i++) + { + /* only add valid usernames */ + if (isvalidusername(values[i])) + set_add(set,values[i]); + } + /* add the uniqueMember values */ + values=myldap_get_values(entry,attmap_group_uniqueMember); + if (values!=NULL) + for (i=0;values[i]!=NULL;i++) + { + /* transform the DN into a uid (dn2uid() already checks validity) */ + if (dn2uid(session,values[i],buf,sizeof(buf))!=NULL) + set_add(set,buf); + } + /* return the members */ + return set; +} + +/* the maximum number of gidNumber attributes per entry */ +#define MAXGIDS_PER_ENTRY 5 + +static int write_group(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqname, + const gid_t *reqgid,int wantmembers, + MYLDAP_SESSION *session) +{ + const char *tmparr[2]; + const char **names,**gidvalues; + const char *passwd; + SET *members; + gid_t gids[MAXGIDS_PER_ENTRY]; + int numgids; + char *tmp; + int rc; + /* get group name (cn) */ + if (reqname!=NULL) + { + names=tmparr; + names[0]=reqname; + names[1]=NULL; + } + else + { + names=myldap_get_values(entry,attmap_group_cn); + if ((names==NULL)||(names[0]==NULL)) + { + log_log(LOG_WARNING,"group entry %s does not contain %s value", + myldap_get_dn(entry),attmap_group_cn); + return 0; + } + } + /* get the group id(s) */ + if (reqgid!=NULL) + { + gids[0]=*reqgid; + numgids=1; + } + else + { + gidvalues=myldap_get_values(entry,attmap_group_gidNumber); + if ((gidvalues==NULL)||(gidvalues[0]==NULL)) + { + log_log(LOG_WARNING,"group entry %s does not contain %s value", + myldap_get_dn(entry),attmap_group_gidNumber); + return 0; + } + for (numgids=0;(gidvalues[numgids]!=NULL)&&(numgids<=MAXGIDS_PER_ENTRY);numgids++) + { + gids[numgids]=(gid_t)strtol(gidvalues[numgids],&tmp,0); + if ((*(gidvalues[numgids])=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"group entry %s contains non-numeric %s value", + myldap_get_dn(entry),attmap_group_gidNumber); + return 0; + } + } + } + /* get group passwd (userPassword) (use only first entry) */ + passwd=get_userpassword(entry,attmap_group_userPassword); + if (passwd==NULL) + passwd=default_group_userPassword; + /* get group memebers (memberUid&uniqueMember) */ + if (wantmembers) + members=getmembers(entry,session); + else + members=NULL; + /* write entries (split to a separate function so we can ensure the call + to free() below in case a write fails) */ + rc=do_write_group(fp,entry,names,gids,numgids,passwd,members); + /* free and return */ + if (members!=NULL) + set_free(members); + return rc; +} + +NSLCD_HANDLE( + group,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name)); + if (!isvalidgroupname(name)) { + log_log(LOG_WARNING,"nslcd_group_byname(%s): invalid group name",name); + return -1; + }, + log_log(LOG_DEBUG,"nslcd_group_byname(%s)",name);, + NSLCD_ACTION_GROUP_BYNAME, + mkfilter_group_byname(name,filter,sizeof(filter)), + write_group(fp,entry,name,NULL,1,session) +) + +NSLCD_HANDLE( + group,bygid, + gid_t gid; + char filter[1024]; + READ_TYPE(fp,gid,gid_t);, + log_log(LOG_DEBUG,"nslcd_group_bygid(%d)",(int)gid);, + NSLCD_ACTION_GROUP_BYGID, + mkfilter_group_bygid(gid,filter,sizeof(filter)), + write_group(fp,entry,NULL,&gid,1,session) +) + +NSLCD_HANDLE( + group,bymember, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name)); + if (!isvalidusername(name)) { + log_log(LOG_WARNING,"nslcd_group_bymember(%s): invalid user name",name); + return -1; + }, + log_log(LOG_DEBUG,"nslcd_group_bymember(%s)",name);, + NSLCD_ACTION_GROUP_BYMEMBER, + mkfilter_group_bymember(session,name,filter,sizeof(filter)), + write_group(fp,entry,NULL,NULL,0,session) +) + +NSLCD_HANDLE( + group,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_group_all()");, + NSLCD_ACTION_GROUP_ALL, + (filter=group_filter,0), + write_group(fp,entry,NULL,NULL,1,session) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/host.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/host.c new file mode 100644 index 0000000000..86875e5860 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/host.c @@ -0,0 +1,191 @@ +/* + host.c - host name lookup routines + Parts of this file were part of the nss_ldap library (as ldap-hosts.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.6 NAME 'ipHost' SUP top AUXILIARY + * DESC 'Abstraction of a host, an IP device. The distinguished + * value of the cn attribute denotes the host's canonical + * name. Device SHOULD be used as a structural class' + * MUST ( cn $ ipHostNumber ) + * MAY ( l $ description $ manager ) ) + */ + +/* the search base for searches */ +const char *host_base = NULL; + +/* the search scope for searches */ +int host_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *host_filter = "(objectClass=ipHost)"; + +/* the attributes to request with searches */ +const char *attmap_host_cn = "cn"; +const char *attmap_host_ipHostNumber = "ipHostNumber"; + +/* the attribute list to request with searches */ +static const char *host_attrs[3]; + +/* create a search filter for searching a host entry + by name, return -1 on errors */ +static int mkfilter_host_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + host_filter, + attmap_host_cn,buf2); +} + +static int mkfilter_host_byaddr(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + host_filter, + attmap_host_ipHostNumber,buf2); +} + +static void host_init(void) +{ + /* set up base */ + if (host_base==NULL) + host_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (host_scope==LDAP_SCOPE_DEFAULT) + host_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + host_attrs[0]=attmap_host_cn; + host_attrs[1]=attmap_host_ipHostNumber; + host_attrs[2]=NULL; +} + +/* write a single host entry to the stream */ +static int write_host(TFILE *fp,MYLDAP_ENTRY *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int numaddr,i; + const char *hostname; + const char **hostnames; + const char **addresses; + /* get the most canonical name */ + hostname=myldap_get_rdn_value(entry,attmap_host_cn); + /* get the other names for the host */ + hostnames=myldap_get_values(entry,attmap_host_cn); + if ((hostnames==NULL)||(hostnames[0]==NULL)) + { + log_log(LOG_WARNING,"host entry %s does not contain %s value", + myldap_get_dn(entry),attmap_host_cn); + return 0; + } + /* if the hostname is not yet found, get the first entry from hostnames */ + if (hostname==NULL) + hostname=hostnames[0]; + /* get the addresses */ + addresses=myldap_get_values(entry,attmap_host_ipHostNumber); + if ((addresses==NULL)||(addresses[0]==NULL)) + { + log_log(LOG_WARNING,"host entry %s does not contain %s value", + myldap_get_dn(entry),attmap_host_ipHostNumber); + return 0; + } + /* write the entry */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,hostname); + WRITE_STRINGLIST_EXCEPT(fp,hostnames,hostname); + for (numaddr=0;addresses[numaddr]!=NULL;numaddr++) + /*noting*/ ; + WRITE_INT32(fp,numaddr); + for (i=0;i +#include +#include +#include +#include +#include +#include +#include + +#include "log.h" + + +/* set the logname */ +#undef PACKAGE +#define PACKAGE "nslcd" + + +/* storage for logging modes */ +static struct cvsd_log { + FILE *fp; /* NULL==syslog */ + int loglevel; + struct cvsd_log *next; +} *cvsd_loglist=NULL; + + +/* default loglevel when no logging is configured */ +static int prelogging_loglevel=LOG_INFO; + + +/* set loglevel when no logging is configured */ +void log_setdefaultloglevel(int loglevel) +{ + prelogging_loglevel=loglevel; +} + + +/* add logging method to configuration list */ +static void log_addlogging_fp(FILE *fp,int loglevel) +{ + struct cvsd_log *tmp,*lst; + /* create new logstruct */ + tmp=(struct cvsd_log *)malloc(sizeof(struct cvsd_log)); + if (tmp==NULL) + { + fprintf(stderr,"malloc() failed: %s",strerror(errno)); + /* since this is done during initialisation it's best to bail out */ + exit(EXIT_FAILURE); + } + tmp->fp=fp; + tmp->loglevel=loglevel; + tmp->next=NULL; + /* save the struct in the list */ + if (cvsd_loglist==NULL) + cvsd_loglist=tmp; + else + { + for (lst=cvsd_loglist;lst->next!=NULL;lst=lst->next); + lst->next=tmp; + } +} + + +/* configure logging to a file */ +void log_addlogging_file(const char *filename,int loglevel) +{ + FILE *fp; + fp=fopen(filename,"a"); + if (fp==NULL) + { + log_log(LOG_ERR,"cannot open logfile (%s) for appending: %s",filename,strerror(errno)); + exit(EXIT_FAILURE); + } + log_addlogging_fp(fp,loglevel); +} + + +/* configure logging to syslog */ +void log_addlogging_syslog(int loglevel) +{ + openlog(PACKAGE,LOG_PID,LOG_DAEMON); + log_addlogging_fp(NULL,loglevel); +} + + +/* configure a null logging mode (no logging) */ +void log_addlogging_none() +{ + /* this is a hack, but it's so easy */ + log_addlogging_fp(NULL,LOG_EMERG); +} + + +/* start the logging with the configured logging methods + if no method is configured yet, logging is done to syslog */ +void log_startlogging(void) +{ + if (cvsd_loglist==NULL) + log_addlogging_syslog(LOG_INFO); + prelogging_loglevel=-1; +} + + +/* log the given message using the configured logging method */ +void log_log(int pri,const char *format, ...) +{ + int res; + struct cvsd_log *lst; + /* TODO: make this something better */ + #define maxbufferlen 200 + char buffer[maxbufferlen]; + va_list ap; + /* make the message */ + va_start(ap,format); + res=vsnprintf(buffer,maxbufferlen,format,ap); + if ((res<0)||(res>=maxbufferlen)) + { + /* truncate with "..." */ + buffer[maxbufferlen-2]='.'; + buffer[maxbufferlen-3]='.'; + buffer[maxbufferlen-4]='.'; + } + buffer[maxbufferlen-1]='\0'; + va_end(ap); + /* do the logging */ + if (prelogging_loglevel>=0) + { + /* if logging is not yet defined, log to stderr */ + if (pri<=prelogging_loglevel) + fprintf(stderr,"%s: %s%s\n",PACKAGE,pri==LOG_DEBUG?"DEBUG: ":"",buffer); + } + else + { + for (lst=cvsd_loglist;lst!=NULL;lst=lst->next) + { + if (pri<=lst->loglevel) + { + if (lst->fp==NULL) /* syslog */ + syslog(pri,"%s",buffer); + else /* file */ + { + fprintf(lst->fp,"%s: %s\n",PACKAGE,buffer); + fflush(lst->fp); + } + } + } + } +} + + +/* return the syslog loglevel represented by the string + return -1 on unknown */ +int log_getloglevel(const char *lvl) +{ + if ( strcmp(lvl,"crit")==0 ) + return LOG_CRIT; + else if ( (strcmp(lvl,"error")==0) || + (strcmp(lvl,"err")==0) ) + return LOG_ERR; + else if ( strcmp(lvl,"warning")==0 ) + return LOG_WARNING; + else if ( strcmp(lvl,"notice")==0 ) + return LOG_NOTICE; + else if ( strcmp(lvl,"info")==0 ) + return LOG_INFO; + else if ( strcmp(lvl,"debug")==0 ) + return LOG_DEBUG; + else + return -1; /* unknown */ +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/log.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/log.h new file mode 100644 index 0000000000..1a20f9c834 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/log.h @@ -0,0 +1,63 @@ +/* + log.h - definitions of logging funtions + + Copyright (C) 2002, 2003, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + + +#ifndef _LOG_H +#define _LOG_H 1 + + +#include +#include "compat/attrs.h" + + +/* set loglevel when no logging is configured */ +void log_setdefaultloglevel(int loglevel); + + +/* configure logging to a file */ +void log_addlogging_file(const char *filename,int loglevel); + + +/* configure logging to syslog */ +void log_addlogging_syslog(int loglevel); + + +/* configure a null logging mode (no logging) */ +void log_addlogging_none(void); + + +/* start the logging with the configured logging methods + if no method is configured yet, logging is done to syslog */ +void log_startlogging(void); + + +/* log the given message using the configured logging method */ +void log_log(int pri,const char *format, ...) + LIKE_PRINTF(2,3); + + +/* return the syslog loglevel represented by the string + return -1 on unknown */ +int log_getloglevel(const char *lvl) + MUST_USE; + + +#endif /* not _LOG_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.c new file mode 100644 index 0000000000..3584cab7b6 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.c @@ -0,0 +1,1521 @@ +/* + myldap.c - simple interface to do LDAP requests + Parts of this file were part of the nss_ldap library (as ldap-nss.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2006 Luke Howard + Copyright (C) 2006, 2007 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +/* + This library expects to use an LDAP library to provide the real + functionality and only provides a convenient wrapper. + Some pointers for more information on the LDAP API: + http://tools.ietf.org/id/draft-ietf-ldapext-ldap-c-api-05.txt + http://www.mozilla.org/directory/csdk-docs/function.htm + http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/apis/dirserv1.htm + http://www.openldap.org/software/man.cgi?query=ldap +*/ + +#include "config.h" + +/* also include deprecated LDAP functions for now */ +#define LDAP_DEPRECATED 1 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_LDAP_SSL_H +#include +#endif +#ifdef HAVE_GSSLDAP_H +#include +#endif +#ifdef HAVE_GSSSASL_H +#include +#endif +/* Try to handle systems with both SASL libraries installed */ +#if defined(HAVE_SASL_SASL_H) && defined(HAVE_SASL_AUXPROP_REQUEST) +#include +#elif defined(HAVE_SASL_H) +#include +#endif +#include +#include + +#include "myldap.h" +#include "compat/pagectrl.h" +#include "common.h" +#include "log.h" +#include "cfg.h" +#include "attmap.h" +#include "common/set.h" + +/* compatibility macros */ +#ifndef LDAP_CONST +#define LDAP_CONST const +#endif /* not LDAP_CONST */ +#ifndef LDAP_MSG_ONE +#define LDAP_MSG_ONE 0x00 +#endif /* not LDAP_MSG_ONE */ + +/* the maximum number of searches per session */ +#define MAX_SEARCHES_IN_SESSION 4 + +/* This refers to a current LDAP session that contains the connection + information. */ +struct ldap_session +{ + /* the connection */ + LDAP *ld; + /* timestamp of last activity */ + time_t lastactivity; + /* index into ldc_uris: currently connected LDAP uri */ + int current_uri; + /* a list of searches registered with this session */ + struct myldap_search *searches[MAX_SEARCHES_IN_SESSION]; +}; + +/* A search description set as returned by myldap_search(). */ +struct myldap_search +{ + /* reference to the session */ + MYLDAP_SESSION *session; + /* indicator that the search is still valid */ + int valid; + /* the parameters descibing the search */ + const char *base; + int scope; + const char *filter; + char **attrs; + /* a pointer to the current result entry, used for + freeing resource allocated with that entry */ + MYLDAP_ENTRY *entry; + /* LDAP message id for the search, -1 indicates absense of an active search */ + int msgid; + /* the last result that was returned by ldap_result() */ + LDAPMessage *msg; + /* cookie for paged searches */ + struct berval *cookie; +}; + +/* The maximum number of calls to myldap_get_values() that may be + done per returned entry. */ +#define MAX_ATTRIBUTES_PER_ENTRY 16 + +/* The maximum number of ranged attribute values that may be stoted + per entry. */ +#define MAX_RANGED_ATTRIBUTES_PER_ENTRY 2 + +/* A single entry from the LDAP database as returned by + myldap_get_entry(). */ +struct myldap_entry +{ + /* reference to the search to be used to get parameters + (e.g. LDAP connection) for other calls */ + MYLDAP_SEARCH *search; + /* the DN */ + const char *dn; + /* a cached version of the exploded rdn */ + char **exploded_rdn; + /* a cache of attribute to value list */ + char **attributevalues[MAX_ATTRIBUTES_PER_ENTRY]; + /* a reference to ranged attribute values so we can free() them later on */ + char **rangedattributevalues[MAX_RANGED_ATTRIBUTES_PER_ENTRY]; +}; + +static MYLDAP_ENTRY *myldap_entry_new(MYLDAP_SEARCH *search) +{ + MYLDAP_ENTRY *entry; + int i; + /* Note: as an alternative we could embed the myldap_entry into the + myldap_search struct to save on malloc() and free() calls. */ + /* allocate new entry */ + entry=(MYLDAP_ENTRY *)malloc(sizeof(struct myldap_entry)); + if (entry==NULL) + { + log_log(LOG_CRIT,"myldap_entry_new(): malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + /* fill in fields */ + entry->search=search; + entry->dn=NULL; + entry->exploded_rdn=NULL; + for (i=0;iattributevalues[i]=NULL; + for (i=0;irangedattributevalues[i]=NULL; + /* return the fresh entry */ + return entry; +} + +static void myldap_entry_free(MYLDAP_ENTRY *entry) +{ + int i; + /* free the DN */ + if (entry->dn!=NULL) + ldap_memfree((char *)entry->dn); + /* free the exploded RDN */ + if (entry->exploded_rdn!=NULL) + ldap_value_free(entry->exploded_rdn); + /* free all attribute values */ + for (i=0;iattributevalues[i]!=NULL) + ldap_value_free(entry->attributevalues[i]); + /* free all ranged attribute values */ + for (i=0;irangedattributevalues[i]!=NULL) + free(entry->rangedattributevalues[i]); + /* we don't need the result anymore, ditch it. */ + ldap_msgfree(entry->search->msg); + entry->search->msg=NULL; + /* free the actual memory for the struct */ + free(entry); +} + +static MYLDAP_SEARCH *myldap_search_new( + MYLDAP_SESSION *session, + const char *base,int scope,const char *filter,const char **attrs) +{ + char *buffer; + MYLDAP_SEARCH *search; + int i; + size_t sz; + /* figure out size for new memory block to allocate + this has the advantage that we can free the whole lot with one call */ + sz=sizeof(struct myldap_search); + sz+=strlen(base)+1+strlen(filter)+1; + for (i=0;attrs[i]!=NULL;i++) + sz+=strlen(attrs[i])+1; + sz+=(i+1)*sizeof(char *); + /* allocate new results memory region */ + buffer=(char *)malloc(sz); + if (buffer==NULL) + { + log_log(LOG_CRIT,"myldap_search_new(): malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + /* initialize struct */ + search=(MYLDAP_SEARCH *)(void *)(buffer); + buffer+=sizeof(struct myldap_search); + /* save pointer to session */ + search->session=session; + /* flag as valid search */ + search->valid=1; + /* initialize array of attributes */ + search->attrs=(char **)(void *)buffer; + buffer+=(i+1)*sizeof(char *); + /* copy base */ + strcpy(buffer,base); + search->base=buffer; + buffer+=strlen(base)+1; + /* just plainly store scope */ + search->scope=scope; + /* copy filter */ + strcpy(buffer,filter); + search->filter=buffer; + buffer+=strlen(filter)+1; + /* copy attributes themselves */ + for (i=0;attrs[i]!=NULL;i++) + { + strcpy(buffer,attrs[i]); + search->attrs[i]=buffer; + buffer+=strlen(attrs[i])+1; + } + search->attrs[i]=NULL; + /* initialize context */ + search->cookie=NULL; + search->msg=NULL; + search->msgid=-1; + /* clear result entry */ + search->entry=NULL; + /* return the new search struct */ + return search; +} + +static void myldap_search_free(MYLDAP_SEARCH *search) +{ + /* free any search entries */ + if (search->entry!=NULL) + myldap_entry_free(search->entry); + /* clean up cookie */ + if (search->cookie!=NULL) + ber_bvfree(search->cookie); + /* free read messages */ + if (search->msg!=NULL) + ldap_msgfree(search->msg); + /* free the storage we allocated */ + free(search); +} + +static MYLDAP_SESSION *myldap_session_new(void) +{ + MYLDAP_SESSION *session; + int i; + /* allocate memory for the session storage */ + session=(struct ldap_session *)malloc(sizeof(struct ldap_session)); + if (session==NULL) + { + log_log(LOG_CRIT,"myldap_session_new(): malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + /* initialize the session */ + session->ld=NULL; + session->lastactivity=0; + session->current_uri=0; + for (i=0;isearches[i]=NULL; + /* return the new session */ + return session; +} + +PURE static inline int is_valid_session(MYLDAP_SESSION *session) +{ + return (session!=NULL); +} + +PURE static inline int is_open_session(MYLDAP_SESSION *session) +{ + return is_valid_session(session)&&(session->ld!=NULL); +} + +/* note that this does not check the valid flag of the search */ +PURE static inline int is_valid_search(MYLDAP_SEARCH *search) +{ + return (search!=NULL)&&is_open_session(search->session); +} + +PURE static inline int is_valid_entry(MYLDAP_ENTRY *entry) +{ + return (entry!=NULL)&&is_valid_search(entry->search)&&(entry->search->msg!=NULL); +} + +#ifdef HAVE_SASL_INTERACT_T +/* this is registered with ldap_sasl_interactive_bind_s() in do_bind() */ +static int do_sasl_interact(LDAP UNUSED(*ld),unsigned UNUSED(flags),void *defaults,void *_interact) +{ + char *authzid=(char *)defaults; + sasl_interact_t *interact=(sasl_interact_t *)_interact; + while (interact->id!=SASL_CB_LIST_END) + { + if (interact->id!=SASL_CB_USER) + return LDAP_PARAM_ERROR; + if (authzid!=NULL) + { + interact->result=authzid; + interact->len=strlen(authzid); + } + else if (interact->defresult!=NULL) + { + interact->result=interact->defresult; + interact->len=strlen(interact->defresult); + } + else + { + interact->result=""; + interact->len=0; + } + interact++; + } + return LDAP_SUCCESS; +} +#endif /* HAVE_SASL_INTERACT_T */ + +#define LDAP_SET_OPTION(ld,option,invalue) \ + rc=ldap_set_option(ld,option,invalue); \ + if (rc!=LDAP_SUCCESS) \ + { \ + log_log(LOG_ERR,"ldap_set_option("__STRING(option)") failed: %s",ldap_err2string(rc)); \ + return rc; \ + } + +/* This function performs the authentication phase of opening a connection. + This returns an LDAP result code. */ +static int do_bind(MYLDAP_SESSION *session,const char *uri) +{ + int rc; +#ifndef HAVE_SASL_INTERACT_T + struct berval cred; +#endif /* not HAVE_SASL_INTERACT_T */ + /* check if StartTLS is requested */ + if (nslcd_cfg->ldc_ssl_on==SSL_START_TLS) + { + rc=ldap_start_tls_s(session->ld,NULL,NULL); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_WARNING,"ldap_start_tls_s() failed: %s: %s", + ldap_err2string(rc),strerror(errno)); + return rc; + } + } + /* TODO: store this information in the session */ + if (!nslcd_cfg->ldc_usesasl) + { + /* do a simple bind */ + if (nslcd_cfg->ldc_binddn) + log_log(LOG_DEBUG,"simple bind to %s as %s",uri,nslcd_cfg->ldc_binddn); + else + log_log(LOG_DEBUG,"simple anonymous bind to %s",uri); + return ldap_simple_bind_s(session->ld,nslcd_cfg->ldc_binddn,nslcd_cfg->ldc_bindpw); + } + else + { + /* do a SASL bind */ + log_log(LOG_DEBUG,"SASL bind to %s as %s",uri,nslcd_cfg->ldc_binddn); + if (nslcd_cfg->ldc_sasl_secprops!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_SASL_SECPROPS,(void *)nslcd_cfg->ldc_sasl_secprops); + } +#ifdef HAVE_SASL_INTERACT_T + return ldap_sasl_interactive_bind_s(session->ld,nslcd_cfg->ldc_binddn,"GSSAPI",NULL,NULL, + LDAP_SASL_QUIET, + do_sasl_interact,(void *)nslcd_cfg->ldc_saslid); +#else /* HAVE_SASL_INTERACT_T */ + cred.bv_val=nslcd_cfg->ldc_saslid; + cred.bv_len=strlen(nslcd_cfg->ldc_saslid); + return ldap_sasl_bind_s(session->ld,nslcd_cfg->ldc_binddn,"GSSAPI",&cred,NULL,NULL,NULL); +#endif /* not HAVE_SASL_INTERACT_T */ + } +} + +#ifdef HAVE_LDAP_SET_REBIND_PROC +/* This function is called by the LDAP library when chasing referrals. + It is configured with the ldap_set_rebind_proc() below. */ +static int do_rebind(LDAP *UNUSED(ld),LDAP_CONST char *url, + ber_tag_t UNUSED(request), + ber_int_t UNUSED(msgid),void *arg) +{ + log_log(LOG_DEBUG,"rebinding to %s",url); + return do_bind((MYLDAP_SESSION *)arg,url); +} +#endif /* HAVE_LDAP_SET_REBIND_PROC */ + +/* This function sets a number of properties on the connection, based + what is configured in the configfile. This function returns an + LDAP status code. */ +static int do_set_options(MYLDAP_SESSION *session) +{ + int rc; + struct timeval tv; +#ifdef LDAP_OPT_X_TLS + int tls=LDAP_OPT_X_TLS_HARD; +#endif /* LDAP_OPT_X_TLS */ + /* turn on debugging */ + if (nslcd_cfg->ldc_debug) + { +#ifdef LBER_OPT_DEBUG_LEVEL + rc=ber_set_option(NULL,LBER_OPT_DEBUG_LEVEL,&nslcd_cfg->ldc_debug); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_ERR,"ber_set_option(LBER_OPT_DEBUG_LEVEL) failed: %s",ldap_err2string(rc)); + return rc; + } +#endif /* LBER_OPT_DEBUG_LEVEL */ +#ifdef LDAP_OPT_DEBUG_LEVEL + LDAP_SET_OPTION(NULL,LDAP_OPT_DEBUG_LEVEL,&nslcd_cfg->ldc_debug); +#endif /* LDAP_OPT_DEBUG_LEVEL */ + } +#ifdef HAVE_LDAP_SET_REBIND_PROC + /* the rebind function that is called when chasing referrals, see + http://publib.boulder.ibm.com/infocenter/iseries/v5r3/topic/apis/ldap_set_rebind_proc.htm + http://www.openldap.org/software/man.cgi?query=ldap_set_rebind_proc&manpath=OpenLDAP+2.4-Release */ + /* TODO: probably only set this if we should chase referrals */ + rc=ldap_set_rebind_proc(session->ld,do_rebind,session); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_ERR,"ldap_set_rebind_proc() failed: %s",ldap_err2string(rc)); + return rc; + } +#endif /* HAVE_LDAP_SET_REBIND_PROC */ + /* set the protocol version to use */ + LDAP_SET_OPTION(session->ld,LDAP_OPT_PROTOCOL_VERSION,&nslcd_cfg->ldc_version); + /* set some other options */ + LDAP_SET_OPTION(session->ld,LDAP_OPT_DEREF,&nslcd_cfg->ldc_deref); + LDAP_SET_OPTION(session->ld,LDAP_OPT_TIMELIMIT,&nslcd_cfg->ldc_timelimit); + tv.tv_sec=nslcd_cfg->ldc_bind_timelimit; + tv.tv_usec=0; +#ifdef LDAP_OPT_TIMEOUT + LDAP_SET_OPTION(session->ld,LDAP_OPT_TIMEOUT,&tv); +#endif /* LDAP_OPT_TIMEOUT */ +#ifdef LDAP_OPT_NETWORK_TIMEOUT + LDAP_SET_OPTION(session->ld,LDAP_OPT_NETWORK_TIMEOUT,&tv); +#endif /* LDAP_OPT_NETWORK_TIMEOUT */ +#ifdef LDAP_X_OPT_CONNECT_TIMEOUT + LDAP_SET_OPTION(session->ld,LDAP_X_OPT_CONNECT_TIMEOUT,&tv); +#endif /* LDAP_X_OPT_CONNECT_TIMEOUT */ + LDAP_SET_OPTION(session->ld,LDAP_OPT_REFERRALS,nslcd_cfg->ldc_referrals?LDAP_OPT_ON:LDAP_OPT_OFF); + LDAP_SET_OPTION(session->ld,LDAP_OPT_RESTART,nslcd_cfg->ldc_restart?LDAP_OPT_ON:LDAP_OPT_OFF); +#ifdef LDAP_OPT_X_TLS + /* if SSL is desired, then enable it */ + if (nslcd_cfg->ldc_ssl_on==SSL_LDAPS) + { + /* use tls */ + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS,&tls); + /* rand file */ + if (nslcd_cfg->ldc_tls_randfile!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_RANDOM_FILE,nslcd_cfg->ldc_tls_randfile); + } + /* ca cert file */ + if (nslcd_cfg->ldc_tls_cacertfile!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_CACERTFILE,nslcd_cfg->ldc_tls_cacertfile); + } + /* ca cert directory */ + if (nslcd_cfg->ldc_tls_cacertdir!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_CACERTDIR,nslcd_cfg->ldc_tls_cacertdir); + } + /* require cert? */ + if (nslcd_cfg->ldc_tls_checkpeer>-1) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_REQUIRE_CERT,&nslcd_cfg->ldc_tls_checkpeer); + } + /* set cipher suite, certificate and private key */ + if (nslcd_cfg->ldc_tls_ciphers!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_CIPHER_SUITE,nslcd_cfg->ldc_tls_ciphers); + } + /* set certificate */ + if (nslcd_cfg->ldc_tls_cert!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_CERTFILE,nslcd_cfg->ldc_tls_cert); + } + /* set up key */ + if (nslcd_cfg->ldc_tls_key!=NULL) + { + LDAP_SET_OPTION(session->ld,LDAP_OPT_X_TLS_KEYFILE,nslcd_cfg->ldc_tls_key); + } + } +#endif /* LDAP_OPT_X_TLS */ + /* if nothing above failed, everything should be fine */ + return LDAP_SUCCESS; +} + +/* close the connection to the server and invalidate any running searches */ +static void do_close(MYLDAP_SESSION *session) +{ + int i; + int rc; + /* if we had reachability problems with the server close the connection */ + if (session->ld!=NULL) + { + /* go over the other searches and partially close them */ + for (i=0;isearches[i]!=NULL) + { + /* free any messages (because later ld is no longer valid) */ + if (session->searches[i]->msg!=NULL) + { + ldap_msgfree(session->searches[i]->msg); + session->searches[i]->msg=NULL; + } + /* abandon the search if there were more results to fetch */ + if (session->searches[i]->msgid!=-1) + { + if (ldap_abandon(session->searches[i]->session->ld,session->searches[i]->msgid)) + { + if (ldap_get_option(session->ld,LDAP_OPT_ERROR_NUMBER,&rc)==LDAP_SUCCESS) + rc=LDAP_OTHER; + log_log(LOG_WARNING,"ldap_abandon() failed to abandon search: %s",ldap_err2string(rc)); + } + session->searches[i]->msgid=-1; + } + /* flag the search as invalid */ + session->searches[i]->valid=0; + } + } + /* close the connection to the server */ + rc=ldap_unbind(session->ld); + session->ld=NULL; + if (rc!=LDAP_SUCCESS) + log_log(LOG_WARNING,"ldap_unbind() failed: %s",ldap_err2string(rc)); + } +} + +/* This checks the timeout value of the session and closes the connection + to the LDAP server if the timeout has expired and there are no pending + searches. */ +static void myldap_session_check(MYLDAP_SESSION *session) +{ + int i; + int runningsearches=0; + time_t current_time; + /* check parameters */ + if (!is_valid_session(session)) + { + log_log(LOG_ERR,"myldap_session_check(): invalid parameter passed"); + errno=EINVAL; + return; + } + /* check if we should time out the connection */ + if ((session->ld!=NULL)&&(nslcd_cfg->ldc_idle_timelimit>0)) + { + /* check if we have any running searches */ + for (i=0;isearches[i]!=NULL)&&(session->searches[i]->valid)) + { + runningsearches=1; + break; + } + } + /* only consider timeout if we have no running searches */ + if (!runningsearches) + { + time(¤t_time); + if ((session->lastactivity+nslcd_cfg->ldc_idle_timelimit)ld!=NULL) + return LDAP_SUCCESS; + /* we should build a new session now */ + session->ld=NULL; + session->lastactivity=0; + /* open the connection */ + rc=ldap_initialize(&(session->ld),nslcd_cfg->ldc_uris[session->current_uri].uri); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_WARNING,"ldap_initialize(%s) failed: %s: %s", + nslcd_cfg->ldc_uris[session->current_uri].uri, + ldap_err2string(rc),strerror(errno)); + if (session->ld!=NULL) + { + rc2=ldap_unbind(session->ld); + session->ld=NULL; + if (rc2!=LDAP_SUCCESS) + log_log(LOG_WARNING,"ldap_unbind() failed: %s",ldap_err2string(rc2)); + } + return rc; + } + else if (session->ld==NULL) + { + log_log(LOG_WARNING,"ldap_initialize() returned NULL"); + return LDAP_LOCAL_ERROR; + } + /* set the options for the connection */ + rc=do_set_options(session); + if (rc!=LDAP_SUCCESS) + { + rc2=ldap_unbind(session->ld); + session->ld=NULL; + if (rc2!=LDAP_SUCCESS) + log_log(LOG_WARNING,"ldap_unbind() failed: %s",ldap_err2string(rc2)); + return rc; + } + /* bind to the server */ + rc=do_bind(session,nslcd_cfg->ldc_uris[session->current_uri].uri); + if (rc!=LDAP_SUCCESS) + { + /* log actual LDAP error code */ + log_log(LOG_WARNING,"failed to bind to LDAP server %s: %s: %s", + nslcd_cfg->ldc_uris[session->current_uri].uri, + ldap_err2string(rc),strerror(errno)); + rc2=ldap_unbind(session->ld); + session->ld=NULL; + if (rc2!=LDAP_SUCCESS) + log_log(LOG_WARNING,"ldap_unbind() failed: %s",ldap_err2string(rc2)); + return rc; + } + /* disable keepalive on the LDAP connection socket (why?) */ + if (ldap_get_option(session->ld,LDAP_OPT_DESC,&sd)==LDAP_SUCCESS) + { + /* ignore errors */ + (void)setsockopt(sd,SOL_SOCKET,SO_KEEPALIVE,(void *)&off,sizeof(off)); + } + /* update last activity and finish off state */ + time(&(session->lastactivity)); + log_log(LOG_INFO,"connected to LDAP server %s", + nslcd_cfg->ldc_uris[session->current_uri].uri); + return LDAP_SUCCESS; +} + +static MYLDAP_SEARCH *do_try_search( + MYLDAP_SESSION *session, + const char *base,int scope,const char *filter,const char **attrs) +{ + int rc; + LDAPControl *serverCtrls[2]; + LDAPControl **pServerCtrls; + int msgid; + MYLDAP_SEARCH *search; + int i; + /* ensure that we have an open connection */ + rc=do_open(session); + if (rc!=LDAP_SUCCESS) + return NULL; + /* if we're using paging, build a page control */ + if ((nslcd_cfg->ldc_pagesize>0)&&(scope!=LDAP_SCOPE_BASE)) + { + rc=ldap_create_page_control(session->ld,nslcd_cfg->ldc_pagesize, + NULL,0,&serverCtrls[0]); + if (rc==LDAP_SUCCESS) + { + serverCtrls[1]=NULL; + pServerCtrls=serverCtrls; + } + else + { + log_log(LOG_WARNING,"ldap_create_page_control() failed: %s",ldap_err2string(rc)); + /* clear error flag */ + rc=LDAP_SUCCESS; + ldap_set_option(session->ld,LDAP_OPT_ERROR_NUMBER,&rc); + pServerCtrls=NULL; + } + } + else + pServerCtrls=NULL; + /* perform the search */ + rc=ldap_search_ext(session->ld, + base,scope,filter,(char **)attrs, + 0,pServerCtrls,NULL,NULL, + LDAP_NO_LIMIT,&msgid); + /* free the controls if we had them */ + if (pServerCtrls!=NULL) + { + ldap_control_free(serverCtrls[0]); + serverCtrls[0]=NULL; + } + /* handle errors */ + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_WARNING,"ldap_search_ext() failed: %s",ldap_err2string(rc)); + return NULL; + } + /* update the last activity on the connection */ + time(&(session->lastactivity)); + /* allocate a new search entry */ + search=myldap_search_new(session,base,scope,filter,attrs); + /* save msgid */ + search->msgid=msgid; + /* find a place in the session where we can register our search */ + for (i=0;(session->searches[i]!=NULL)&&(i=MAX_SEARCHES_IN_SESSION) + { + log_log(LOG_ERR,"myldap_search(): too many searches registered with session (max %d)", + MAX_SEARCHES_IN_SESSION); + myldap_search_close(search); + return NULL; + } + /* regsiter search with the session so we can free it later on */ + session->searches[i]=search; + /* return the new search */ + return search; +} + +MYLDAP_SESSION *myldap_create_session(void) +{ + return myldap_session_new(); +} + +void myldap_session_cleanup(MYLDAP_SESSION *session) +{ + int i; + /* check parameter */ + if (!is_valid_session(session)) + { + log_log(LOG_ERR,"myldap_session_cleanup(): invalid session passed"); + return; + } + /* go over all searches in the session and close them */ + for (i=0;isearches[i]!=NULL) + { + myldap_search_close(session->searches[i]); + session->searches[i]=NULL; + } + } +} + +void myldap_session_close(MYLDAP_SESSION *session) +{ + /* check parameter */ + if (!is_valid_session(session)) + { + log_log(LOG_ERR,"myldap_session_cleanup(): invalid session passed"); + return; + } + /* close pending searches */ + myldap_session_cleanup(session); + /* close any open connections */ + do_close(session); + /* free allocated memory */ + free(session); +} + +/* mutex for updating the times in the uri */ +pthread_mutex_t uris_mutex = PTHREAD_MUTEX_INITIALIZER; + +MYLDAP_SEARCH *myldap_search( + MYLDAP_SESSION *session, + const char *base,int scope,const char *filter,const char **attrs) +{ + MYLDAP_SEARCH *search; + int sleeptime=0; + int start_uri; + time_t endtime; + time_t nexttry; + time_t t; + /* check parameters */ + if (!is_valid_session(session)||(base==NULL)||(filter==NULL)||(attrs==NULL)) + { + log_log(LOG_ERR,"myldap_search(): invalid parameter passed"); + errno=EINVAL; + return NULL; + } + /* log the call */ + log_log(LOG_DEBUG,"myldap_search(base=\"%s\", filter=\"%s\")", + base,filter); + /* keep trying until we time out */ + endtime=time(NULL)+nslcd_cfg->ldc_reconnect_maxsleeptime; + nexttry=endtime; + while (1) + { + /* try each configured URL once */ + pthread_mutex_lock(&uris_mutex); + start_uri=session->current_uri; + do + { + /* only try if we haven't just had an error and it was a long tme + since the last ok */ + if ( ( ( nslcd_cfg->ldc_uris[session->current_uri].lastfail - + nslcd_cfg->ldc_uris[session->current_uri].lastok ) < nslcd_cfg->ldc_reconnect_maxsleeptime) || + ( time(NULL) >= (nslcd_cfg->ldc_uris[session->current_uri].lastfail+nslcd_cfg->ldc_reconnect_maxsleeptime) ) ) + { + pthread_mutex_unlock(&uris_mutex); + /* try to start the search */ + search=do_try_search(session,base,scope,filter,attrs); + if (search!=NULL) + { + /* update ok time and return search handle */ + pthread_mutex_lock(&uris_mutex); + nslcd_cfg->ldc_uris[session->current_uri].lastok=time(NULL); + pthread_mutex_unlock(&uris_mutex); + return search; + } + /* close the current connection */ + do_close(session); + /* update time of failure and figure out when we should retry */ + pthread_mutex_lock(&uris_mutex); + t=time(NULL); + nslcd_cfg->ldc_uris[session->current_uri].lastfail=t; + t+=nslcd_cfg->ldc_reconnect_sleeptime; + if (tldc_uris[session->current_uri].lastfail>0) + { + /* we are in a hard fail state, figure out when we can retry */ + t=(nslcd_cfg->ldc_uris[session->current_uri].lastfail+nslcd_cfg->ldc_reconnect_maxsleeptime); + if (tcurrent_uri++; + if (nslcd_cfg->ldc_uris[session->current_uri].uri==NULL) + session->current_uri=0; + } + while (session->current_uri!=start_uri); + pthread_mutex_unlock(&uris_mutex); + /* see if it is any use sleeping */ + if (nexttry>=endtime) + { + log_log(LOG_ERR,"no available LDAP server found"); + return NULL; + } + /* sleep between tries */ + sleeptime=nexttry-time(NULL); + if (sleeptime>0) + { + log_log(LOG_WARNING,"no available LDAP server found, sleeping %d seconds",sleeptime); + (void)sleep(sleeptime); + } + nexttry=time(NULL)+nslcd_cfg->ldc_reconnect_maxsleeptime; + } +} + +void myldap_search_close(MYLDAP_SEARCH *search) +{ + int i; + if (!is_valid_search(search)) + return; + /* free any messages */ + if (search->msg!=NULL) + { + ldap_msgfree(search->msg); + search->msg=NULL; + } + /* abandon the search if there were more results to fetch */ + if (search->msgid!=-1) + { + ldap_abandon(search->session->ld,search->msgid); + search->msgid=-1; + } + /* find the reference to this search in the session */ + for (i=0;isession->searches[i]==search) + search->session->searches[i]=NULL; + } + /* free this search */ + myldap_search_free(search); +} + +MYLDAP_ENTRY *myldap_get_entry(MYLDAP_SEARCH *search,int *rcp) +{ + int rc; + int parserc; + int msgid; + struct timeval tv,*tvp; + LDAPControl **resultcontrols; + LDAPControl *serverctrls[2]; + ber_int_t count; + /* check parameters */ + if (!is_valid_search(search)) + { + log_log(LOG_ERR,"myldap_get_entry(): invalid search passed"); + errno=EINVAL; + if (rcp!=NULL) + *rcp=LDAP_OPERATIONS_ERROR; + return NULL; + } + /* check if the connection wasn't closed in another search */ + if (!search->valid) + { + log_log(LOG_WARNING,"myldap_get_entry(): connection was closed"); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=LDAP_SERVER_DOWN; + return NULL; + } + /* set up a timelimit value for operations */ + if (nslcd_cfg->ldc_timelimit==LDAP_NO_LIMIT) + tvp=NULL; + else + { + tv.tv_sec=nslcd_cfg->ldc_timelimit; + tv.tv_usec=0; + tvp=&tv; + } + /* if we have an existing result entry, free it */ + if (search->entry!=NULL) + { + myldap_entry_free(search->entry); + search->entry=NULL; + } + /* try to parse results until we have a final error or ok */ + while (1) + { + /* free the previous message if there was any */ + if (search->msg!=NULL) + { + ldap_msgfree(search->msg); + search->msg=NULL; + } + /* get the next result */ + rc=ldap_result(search->session->ld,search->msgid,LDAP_MSG_ONE,tvp,&(search->msg)); + /* handle result */ + switch (rc) + { + case -1: + /* we have an error condition, try to get error code */ + if (ldap_get_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS) + rc=LDAP_UNAVAILABLE; + log_log(LOG_ERR,"ldap_result() failed: %s",ldap_err2string(rc)); + /* close connection on connection problems */ + if ((rc==LDAP_UNAVAILABLE)||(rc==LDAP_SERVER_DOWN)) + do_close(search->session); + /* close search */ + myldap_search_close(search); + if (rcp!=NULL) + *rcp=rc; + return NULL; + case 0: + /* the timeout expired */ + log_log(LOG_ERR,"ldap_result() timed out"); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=LDAP_TIMELIMIT_EXCEEDED; + return NULL; + case LDAP_RES_SEARCH_ENTRY: + /* we have a normal search entry, update timestamp and return result */ + time(&(search->session->lastactivity)); + search->entry=myldap_entry_new(search); + if (rcp!=NULL) + *rcp=LDAP_SUCCESS; + return search->entry; + case LDAP_RES_SEARCH_RESULT: + /* we have a search result, parse it */ + resultcontrols=NULL; + if (search->cookie!=NULL) + { + ber_bvfree(search->cookie); + search->cookie=NULL; + } + /* NB: this frees search->msg */ + parserc=ldap_parse_result(search->session->ld,search->msg,&rc,NULL, + NULL,NULL,&resultcontrols,1); + search->msg=NULL; + /* check for errors during parsing */ + if ((parserc!=LDAP_SUCCESS)&&(parserc!=LDAP_MORE_RESULTS_TO_RETURN)) + { + if (resultcontrols!=NULL) + ldap_controls_free(resultcontrols); + log_log(LOG_ERR,"ldap_parse_result() failed: %s",ldap_err2string(parserc)); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=parserc; + return NULL; + } + /* check for errors in message */ + if ((rc!=LDAP_SUCCESS)&&(rc!=LDAP_MORE_RESULTS_TO_RETURN)) + { + if (resultcontrols!=NULL) + ldap_controls_free(resultcontrols); + log_log(LOG_ERR,"ldap_result() failed: %s",ldap_err2string(rc)); + /* close connection on connection problems */ + if ((rc==LDAP_UNAVAILABLE)||(rc==LDAP_SERVER_DOWN)) + do_close(search->session); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=rc; + return NULL; + } + /* handle result controls */ + if (resultcontrols!=NULL) + { + /* see if there are any more pages to come */ + rc=ldap_parse_page_control(search->session->ld, + resultcontrols,&count, + &(search->cookie)); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_WARNING,"ldap_parse_page_control() failed: %s", + ldap_err2string(rc)); + /* clear error flag */ + rc=LDAP_SUCCESS; + ldap_set_option(search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc); + } + /* TODO: handle the above return code?? */ + ldap_controls_free(resultcontrols); + } + search->msgid=-1; + /* check if there are more pages to come */ + if ((search->cookie==NULL)||(search->cookie->bv_len==0)) + { + log_log(LOG_DEBUG,"ldap_result(): end of results"); + /* we are at the end of the search, no more results */ + myldap_search_close(search); + if (rcp!=NULL) + *rcp=LDAP_SUCCESS; + return NULL; + } + /* try the next page */ + serverctrls[0]=NULL; + serverctrls[1]=NULL; + rc=ldap_create_page_control(search->session->ld, + nslcd_cfg->ldc_pagesize, + search->cookie,0,&serverctrls[0]); + if (rc!=LDAP_SUCCESS) + { + if (serverctrls[0]!=NULL) + ldap_control_free(serverctrls[0]); + log_log(LOG_WARNING,"ldap_create_page_control() failed: %s", + ldap_err2string(rc)); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=rc; + return NULL; + } + /* set up a new search for the next page */ + rc=ldap_search_ext(search->session->ld, + search->base,search->scope,search->filter, + search->attrs,0,serverctrls,NULL,NULL, + LDAP_NO_LIMIT,&msgid); + ldap_control_free(serverctrls[0]); + if (rc!=LDAP_SUCCESS) + { + log_log(LOG_WARNING,"ldap_search_ext() failed: %s", + ldap_err2string(rc)); + /* close connection on connection problems */ + if ((rc==LDAP_UNAVAILABLE)||(rc==LDAP_SERVER_DOWN)) + do_close(search->session); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=rc; + return NULL; + } + search->msgid=msgid; + /* we continue with another pass */ + break; + case LDAP_RES_SEARCH_REFERENCE: + break; /* just ignore search references */ + default: + log_log(LOG_WARNING,"ldap_result() returned unexpected result type"); + myldap_search_close(search); + if (rcp!=NULL) + *rcp=LDAP_PROTOCOL_ERROR; + return NULL; + } + } +} + +/* Get the DN from the entry. This function only returns NULL (and sets + errno) if an incorrect entry is passed. If the DN value cannot be + retreived "unknown" is returned instead. */ +const char *myldap_get_dn(MYLDAP_ENTRY *entry) +{ + int rc; + /* check parameters */ + if (!is_valid_entry(entry)) + { + log_log(LOG_ERR,"myldap_get_dn(): invalid result entry passed"); + errno=EINVAL; + return "unknown"; + } + /* if we don't have it yet, retreive it */ + if ((entry->dn==NULL)&&(entry->search->valid)) + { + entry->dn=ldap_get_dn(entry->search->session->ld,entry->search->msg); + if (entry->dn==NULL) + { + if (ldap_get_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS) + rc=LDAP_UNAVAILABLE; + log_log(LOG_WARNING,"ldap_get_dn() returned NULL: %s",ldap_err2string(rc)); + /* close connection on connection problems */ + if ((rc==LDAP_UNAVAILABLE)||(rc==LDAP_SERVER_DOWN)) + do_close(entry->search->session); + } + } + /* if we still don't have it, return unknown */ + if (entry->dn==NULL) + return "unknown"; + /* return it */ + return entry->dn; +} + +/* Return a buffer that is an a list of strings that can be freed + with a single call to free(). This function frees the set. */ +static char **set2values(SET *set) +{ + char *buf; + char **values; + const char *val; + size_t sz; + int num; + /* check set */ + if (set==NULL) + return NULL; + /* count number of entries and needed space */ + sz=0; + num=1; + set_loop_first(set); + while ((val=set_loop_next(set))!=NULL) + { + num++; + sz+=strlen(val)+1; + } + /* allocate the needed memory */ + buf=(char *)malloc(num*sizeof(char *)+sz); + if (buf==NULL) + { + log_log(LOG_CRIT,"set2values(): malloc() failed to allocate memory"); + set_free(set); + return NULL; + } + values=(char **)buf; + buf+=num*sizeof(char *); + /* copy set into buffer */ + sz=0; + num=0; + set_loop_first(set); + while ((val=set_loop_next(set))!=NULL) + { + strcpy(buf,val); + values[num++]=buf; + buf+=strlen(buf)+1; + } + values[num]=NULL; + /* we're done */ + set_free(set); + return values; +} + +/* Perform ranged retreival of attributes. + http://msdn.microsoft.com/en-us/library/aa367017(vs.85).aspx + http://www.tkk.fi/cc/docs/kerberos/draft-kashi-incremental-00.txt */ +static char **myldap_get_ranged_values(MYLDAP_ENTRY *entry,const char *attr) +{ + char **values; + char *attn; + const char *attrs[2]; + BerElement *ber; + int i; + int startat=0,nxt=0; + char attbuf[80]; + const char *dn=myldap_get_dn(entry); + MYLDAP_SESSION *session=entry->search->session; + MYLDAP_SEARCH *search=NULL; + SET *set=NULL; + /* build the attribute name to find */ + if (mysnprintf(attbuf,sizeof(attbuf),"%s;range=0-*",attr)) + return NULL; + /* keep doing lookups untul we can't get any more results */ + while (1) + { + /* go over all attributes to find the ranged attribute */ + ber=NULL; + attn=ldap_first_attribute(entry->search->session->ld,entry->search->msg,&ber); + values=NULL; + while (attn!=NULL) + { + if (strncasecmp(attn,attbuf,strlen(attbuf)-1)==0) + { + log_log(LOG_DEBUG,"found ranged results %s",attn); + nxt=atoi(attn+strlen(attbuf)-1)+1; + values=ldap_get_values(entry->search->session->ld,entry->search->msg,attn); + ldap_memfree(attn); + break; + } + /* free old attribute name and get next one */ + ldap_memfree(attn); + attn=ldap_next_attribute(entry->search->session->ld,entry->search->msg,ber); + } + ber_free(ber,0); + /* see if we found any values */ + if ((values==NULL)||(*values==NULL)) + break; + /* allocate memory */ + if (set==NULL) + { + set=set_new(); + if (set==NULL) + { + ldap_value_free(values); + log_log(LOG_CRIT,"myldap_get_ranged_values(): set_new() failed to allocate memory"); + return NULL; + } + } + /* add to the set */ + for (i=0;values[i]!=NULL;i++) + set_add(set,values[i]); + /* free results */ + ldap_value_free(values); + /* check if we should start a new search */ + if (nxt<=startat) + break; + startat=nxt; + /* build attributes for a new search */ + if (mysnprintf(attbuf,sizeof(attbuf),"%s;range=%d-*",attr,startat)) + break; + attrs[0]=attbuf; + attrs[1]=NULL; + /* close the previous search, if any */ + if (search!=NULL) + myldap_search_close(search); + /* start the new search */ + search=myldap_search(session,dn,LDAP_SCOPE_BASE,"(objectClass=*)",attrs); + if (search==NULL) + break; + entry=myldap_get_entry(search,NULL); + if (entry==NULL) + break; + } + /* close any started searches */ + if (search!=NULL) + myldap_search_close(search); + return set2values(set); +} + +/* Simple wrapper around ldap_get_values(). */ +const char **myldap_get_values(MYLDAP_ENTRY *entry,const char *attr) +{ + char **values; + int rc; + int i; + /* check parameters */ + if (!is_valid_entry(entry)) + { + log_log(LOG_ERR,"myldap_get_values(): invalid result entry passed"); + errno=EINVAL; + return NULL; + } + else if (attr==NULL) + { + log_log(LOG_ERR,"myldap_get_values(): invalid attribute name passed"); + errno=EINVAL; + return NULL; + } + if (!entry->search->valid) + return NULL; /* search has been stopped */ + /* get from LDAP */ + values=ldap_get_values(entry->search->session->ld,entry->search->msg,attr); + if (values==NULL) + { + if (ldap_get_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc)!=LDAP_SUCCESS) + rc=LDAP_UNAVAILABLE; + /* ignore decoding errors as they are just nonexisting attribute values */ + if (rc==LDAP_DECODING_ERROR) + { + rc=LDAP_SUCCESS; + ldap_set_option(entry->search->session->ld,LDAP_OPT_ERROR_NUMBER,&rc); + } + else if (rc==LDAP_SUCCESS) + { + /* we have a success code but no values, let's try to get ranged + values */ + values=myldap_get_ranged_values(entry,attr); + if (values==NULL) + return NULL; + /* store values entry so we can free it later on */ + for (i=0;irangedattributevalues[i]==NULL) + { + entry->rangedattributevalues[i]=values; + return (const char **)values; + } + /* we found no room to store the values */ + log_log(LOG_ERR,"ldap_get_values() couldn't store results, increase MAX_RANGED_ATTRIBUTES_PER_ENTRY"); + free(values); + return NULL; + } + else + log_log(LOG_WARNING,"ldap_get_values() of attribute \"%s\" on entry \"%s\" returned NULL: %s", + attr,myldap_get_dn(entry),ldap_err2string(rc)); + return NULL; + } + /* store values entry so we can free it later on */ + for (i=0;iattributevalues[i]==NULL) + { + entry->attributevalues[i]=values; + return (const char **)values; + } + /* we found no room to store the entry */ + log_log(LOG_ERR,"ldap_get_values() couldn't store results, increase MAX_ATTRIBUTES_PER_ENTRY"); + ldap_value_free(values); + return NULL; +} + +/* Go over the entries in exploded_rdn and see if any start with + the requested attribute. Return a reference to the value part of + the DN (does not modify exploded_rdn). */ +static const char *find_rdn_value(char **exploded_rdn,const char *attr) +{ + int i,j; + int l; + if (exploded_rdn==NULL) + return NULL; + /* go over all RDNs */ + l=strlen(attr); + for (i=0;exploded_rdn[i]!=NULL;i++) + { + /* check that RDN starts with attr */ + if (strncasecmp(exploded_rdn[i],attr,l)!=0) + continue; + /* skip spaces */ + for (j=l;isspace(exploded_rdn[i][j]);j++) + /* nothing here */; + /* ensure that we found an equals sign now */ + if (exploded_rdn[i][j]!='=') + j++; + /* skip more spaces */ + for (j++;isspace(exploded_rdn[i][j]);j++) + /* nothing here */; + /* ensure that we're not at the end of the string */ + if (exploded_rdn[i][j]=='\0') + continue; + /* we found our value */ + return exploded_rdn[i]+j; + } + /* fail */ + return NULL; +} + +/* explode the first part of DN into parts + (e.g. "cn=Test", "uid=test") + The returned value should be freed with ldap_value_free(). */ +static char **get_exploded_rdn(const char *dn) +{ + char **exploded_dn; + char **exploded_rdn; + /* check if we have a DN */ + if ((dn==NULL)||(strcasecmp(dn,"unknown")==0)) + return NULL; + /* explode dn into { "uid=test", "ou=people", ..., NULL } */ + exploded_dn=ldap_explode_dn(dn,0); + if ((exploded_dn==NULL)||(exploded_dn[0]==NULL)) + { + log_log(LOG_WARNING,"ldap_explode_dn(%s) returned NULL: %s", + dn,strerror(errno)); + return NULL; + } + /* explode rdn (first part of exploded_dn), + e.g. "cn=Test User+uid=testusr" into + { "cn=Test User", "uid=testusr", NULL } */ + exploded_rdn=ldap_explode_rdn(exploded_dn[0],0); + if ((exploded_rdn==NULL)||(exploded_rdn[0]==NULL)) + { + log_log(LOG_WARNING,"ldap_explode_rdn(%s) returned NULL: %s", + exploded_dn[0],strerror(errno)); + if (exploded_rdn!=NULL) + ldap_value_free(exploded_rdn); + ldap_value_free(exploded_dn); + return NULL; + } + ldap_value_free(exploded_dn); + return exploded_rdn; +} + +const char *myldap_get_rdn_value(MYLDAP_ENTRY *entry,const char *attr) +{ + /* check parameters */ + if (!is_valid_entry(entry)) + { + log_log(LOG_ERR,"myldap_get_rdn_value(): invalid result entry passed"); + errno=EINVAL; + return NULL; + } + else if (attr==NULL) + { + log_log(LOG_ERR,"myldap_get_rdn_value(): invalid attribute name passed"); + errno=EINVAL; + return NULL; + } + /* check if entry contains exploded_rdn */ + if (entry->exploded_rdn==NULL) + { + entry->exploded_rdn=get_exploded_rdn(myldap_get_dn(entry)); + if (entry->exploded_rdn==NULL) + return NULL; + } + /* find rnd value */ + return find_rdn_value(entry->exploded_rdn,attr); +} + +const char *myldap_cpy_rdn_value(const char *dn,const char *attr, + char *buf,size_t buflen) +{ + char **exploded_rdn; + const char *value; + /* explode dn into { "cn=Test", "uid=test", NULL } */ + exploded_rdn=get_exploded_rdn(dn); + if (exploded_rdn==NULL) + return NULL; + /* see if we have a match */ + value=find_rdn_value(exploded_rdn,attr); + /* if we have something store it in the buffer */ + if ((value!=NULL)&&(strlen(value)=(buflen+4)) + return -1; + /* do escaping for some characters */ + switch (*src) + { + case '*': + strcpy(buffer+pos,"\\2a"); + pos+=3; + break; + case '(': + strcpy(buffer+pos,"\\28"); + pos+=3; + break; + case ')': + strcpy(buffer+pos,"\\29"); + pos+=3; + break; + case '\\': + strcpy(buffer+pos,"\\5c"); + pos+=3; + break; + default: + /* just copy character */ + buffer[pos++]=*src; + break; + } + } + /* terminate destination string */ + buffer[pos]='\0'; + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.h b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.h new file mode 100644 index 0000000000..8242604bf0 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/myldap.h @@ -0,0 +1,125 @@ +/* + myldap.h - simple interface to do LDAP requests + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +/* + This file describes the API of the myldap module which takes the complexity + out of using the OpenLDAP library. Memory management, paging, reconnect + logic, idle timeout of connections, etc is taken care of by the module. + + Use of this module is very straightforeward. You first have to create a + session (with myldap_create_session()), with this session you can start + searches (with myldap_search()), from a search you can get entries (with + myldap_get_entry()) from the LDAP database and from these entries you can + get attribute values (with myldap_get_values()). +*/ + +#ifndef _MYLDAP_H +#define _MYLDAP_H + +/* for size_t */ +#include +/* for LDAP_SCOPE_* */ +#include +#include + +#include "compat/attrs.h" + +#ifndef LDAP_SCOPE_DEFAULT +#define LDAP_SCOPE_DEFAULT LDAP_SCOPE_SUBTREE +#endif /* not LDAP_SCOPE_DEFAULT */ + +/* This a a generic session handle. */ +typedef struct ldap_session MYLDAP_SESSION; + +/* Note that this session handle may be used within one thread only. No + locking is performed to prevent concurrent modifications. Most LDAP + libraries also are not thread-safe in that a single connection may be + shared by multiple threads. It seems however that OpenLDAP at least does + not have any problems with an LDAP *ld per thread. + http://www.openldap.org/lists/openldap-software/200606/msg00252.html */ + +/* A result set as returned by myldap_search(). */ +typedef struct myldap_search MYLDAP_SEARCH; + +/* A single entry from the LDAP database as returned by myldap_get_entry(). */ +typedef struct myldap_entry MYLDAP_ENTRY; + +/* Create a new session, this does not yet connect to the LDAP server. The + connection to the server is made on-demand when a search is performed. This + uses the configuration to find the URLs to attempt connections to. */ +MUST_USE MYLDAP_SESSION *myldap_create_session(void); + +/* Closes all pending searches and deallocates any memory that is allocated + with these searches. This does not close the session. */ +void myldap_session_cleanup(MYLDAP_SESSION *session); + +/* Close the session and free all the resources allocated for the session. + After a call to this function the referenced handle is invalid. */ +void myldap_session_close(MYLDAP_SESSION *session); + +/* Do an LDAP search and return a reference to the results (returns NULL on + error). This function uses paging, and does reconnects to the configured + URLs transparently. */ +MUST_USE MYLDAP_SEARCH *myldap_search( + MYLDAP_SESSION *session, + const char *base,int scope,const char *filter,const char **attrs); + +/* Close the specified search. This frees all the memory that was allocated + for the search and its results. */ +void myldap_search_close(MYLDAP_SEARCH *search); + +/* Get an entry from the result set, going over all results (returns NULL if + no more entries are available). Note that any memory allocated to return + information about the previous entry (e.g. with myldap_get_values()) is + freed with this call. The search is autoamtically closed when no more + results are available. The function returns an LDAP status code in the + location pointed to by rcp if it is non-NULL. */ +MUST_USE MYLDAP_ENTRY *myldap_get_entry(MYLDAP_SEARCH *search,int *rcp); + +/* Get the DN from the entry. This function does not return NULL (on error + "unknown" is returned). */ +MUST_USE const char *myldap_get_dn(MYLDAP_ENTRY *entry); + +/* Get the attribute values from a certain entry as a NULL terminated list. + May return NULL or an empty array. */ +MUST_USE const char **myldap_get_values(MYLDAP_ENTRY *entry,const char *attr); + +/* Checks to see if the entry has the specified object class. */ +MUST_USE int myldap_has_objectclass(MYLDAP_ENTRY *entry,const char *objectclass); + +/* Get the RDN's value: eg. if the RDN was cn=lukeh, getrdnvalue(entry,cn) + would return lukeh. If the attribute was not found in the DN or on error + NULL is returned. This method may be used to get the "most authorative" + value for an attribute. */ +MUST_USE const char *myldap_get_rdn_value(MYLDAP_ENTRY *entry,const char *attr); + +/* Just like myldap_get_rdn_value() but use the supplied character sequence + and copy the result into the buffer. + Returns a pointer to the start of the string on success and NULL on + failure. */ +MUST_USE const char *myldap_cpy_rdn_value(const char *dn,const char *attr, + char *buf,size_t buflen); + +/* Escapes characters in a string for use in a search filter. */ +MUST_USE int myldap_escape(const char *src,char *buffer,size_t buflen); + +#endif /* not _MYLDAP_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/netgroup.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/netgroup.c new file mode 100644 index 0000000000..64dbb3b39a --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/netgroup.c @@ -0,0 +1,240 @@ +/* + netgroup.c - netgroup lookup routines + Parts of this file were part of the nss_ldap library (as ldap-netgrp.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.8 NAME 'nisNetgroup' SUP top STRUCTURAL + * DESC 'Abstraction of a netgroup. May refer to other netgroups' + * MUST cn + * MAY ( nisNetgroupTriple $ memberNisNetgroup $ description ) ) + */ + +/* the search base for searches */ +const char *netgroup_base = NULL; + +/* the search scope for searches */ +int netgroup_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *netgroup_filter = "(objectClass=nisNetgroup)"; + +/* the attributes to request with searches */ +const char *attmap_netgroup_cn = "cn"; +const char *attmap_netgroup_nisNetgroupTriple = "nisNetgroupTriple"; +const char *attmap_netgroup_memberNisNetgroup = "memberNisNetgroup"; + +/* the attribute list to request with searches */ +static const char *netgroup_attrs[4]; + +static int mkfilter_netgroup_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + netgroup_filter, + attmap_netgroup_cn,buf2); +} + +static void netgroup_init(void) +{ + /* set up base */ + if (netgroup_base==NULL) + netgroup_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (netgroup_scope==LDAP_SCOPE_DEFAULT) + netgroup_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + netgroup_attrs[0]=attmap_netgroup_cn; + netgroup_attrs[1]=attmap_netgroup_nisNetgroupTriple; + netgroup_attrs[2]=attmap_netgroup_memberNisNetgroup; + netgroup_attrs[3]=NULL; +} + +static int write_string_stripspace_len(TFILE *fp,const char *str,int len) +{ + int32_t tmpint32; + int i,j; + DEBUG_PRINT("WRITE_STRING: var="__STRING(str)" string=\"%s\"",str); + if (str==NULL) + { + WRITE_INT32(fp,0); + } + else + { + /* skip leading spaces */ + for (i=0;(str[i]!='\0')&&(isspace(str[i]));i++) + /* nothing else to do */ ; + /* skip trailing spaces */ + for (j=len;(j>i)&&(isspace(str[j-1]));j--) + /* nothing else to do */ ; + /* write length of string */ + WRITE_INT32(fp,j-i); + /* write string itself */ + if (j>i) + { + WRITE(fp,str+i,j-i); + } + } + /* we're done */ + return 0; +} + +#define WRITE_STRING_STRIPSPACE_LEN(fp,str,len) \ + if (write_string_stripspace_len(fp,str,len)) \ + return -1; + +#define WRITE_STRING_STRIPSPACE(fp,str) \ + WRITE_STRING_STRIPSPACE_LEN(fp,str,strlen(str)) + +static int write_netgroup_triple(TFILE *fp,const char *triple) +{ + int32_t tmpint32; + int i; + int hostb,hoste,userb,usere,domainb,domaine; + /* skip leading spaces */ + for (i=0;(triple[i]!='\0')&&(isspace(triple[i]));i++) + /* nothing else to do */ ; + /* we should have a bracket now */ + if (triple[i]!='(') + { + log_log(LOG_WARNING,"write_netgroup_triple(): entry does not begin with '(' (entry skipped)"); + return 0; + } + i++; + hostb=i; + /* find comma (end of host string) */ + for (;(triple[i]!='\0')&&(triple[i]!=',');i++) + /* nothing else to do */ ; + if (triple[i]!=',') + { + log_log(LOG_WARNING,"write_netgroup_triple(): missing ',' (entry skipped)"); + return 0; + } + hoste=i; + i++; + userb=i; + /* find comma (end of user string) */ + for (;(triple[i]!='\0')&&(triple[i]!=',');i++) + /* nothing else to do */ ; + if (triple[i]!=',') + { + log_log(LOG_WARNING,"write_netgroup_triple(): missing ',' (entry skipped)"); + return 0; + } + usere=i; + i++; + domainb=i; + /* find closing bracket (end of domain string) */ + for (;(triple[i]!='\0')&&(triple[i]!=')');i++) + /* nothing else to do */ ; + if (triple[i]!=')') + { + log_log(LOG_WARNING,"write_netgroup_triple(): missing ')' (entry skipped)"); + return 0; + } + domaine=i; + i++; + /* skip trailing spaces */ + for (;(triple[i]!='\0')&&(isspace(triple[i]));i++) + /* nothing else to do */ ; + /* if anything is left in the string we have a problem */ + if (triple[i]!='\0') + { + log_log(LOG_WARNING,"write_netgroup_triple(): string contains trailing data (entry skipped)"); + return 0; + } + /* write strings */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_INT32(fp,NETGROUP_TYPE_TRIPLE); + WRITE_STRING_STRIPSPACE_LEN(fp,triple+hostb,hoste-hostb) + WRITE_STRING_STRIPSPACE_LEN(fp,triple+userb,usere-userb) + WRITE_STRING_STRIPSPACE_LEN(fp,triple+domainb,domaine-domainb) + /* we're done */ + return 0; +} + +#define WRITE_NETGROUP_TRIPLE(fp,triple) \ + if (write_netgroup_triple(fp,triple)) \ + return -1; + +static int write_netgroup(TFILE *fp,MYLDAP_ENTRY *entry) +{ + int32_t tmpint32; + int i; + const char **triples; + const char **members; + /* get the netgroup triples and member */ + triples=myldap_get_values(entry,attmap_netgroup_nisNetgroupTriple); + members=myldap_get_values(entry,attmap_netgroup_memberNisNetgroup); + /* write the netgroup triples */ + if (triples!=NULL) + for (i=0;triples[i]!=NULL;i++) + { + WRITE_NETGROUP_TRIPLE(fp,triples[i]); + } + /* write netgroup members */ + if (members!=NULL) + for (i=0;members[i]!=NULL;i++) + { + /* write the result code */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + /* write triple indicator */ + WRITE_INT32(fp,NETGROUP_TYPE_NETGROUP); + /* write netgroup name */ + WRITE_STRING_STRIPSPACE(fp,members[i]); + } + /* we're done */ + return 0; +} + +NSLCD_HANDLE( + netgroup,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_netgroup_byname(%s)",name);, + NSLCD_ACTION_NETGROUP_BYNAME, + mkfilter_netgroup_byname(name,filter,sizeof(filter)), + write_netgroup(fp,entry) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/network.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/network.c new file mode 100644 index 0000000000..9a554550d9 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/network.c @@ -0,0 +1,190 @@ +/* + network.c - network address entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-network.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.7 NAME 'ipNetwork' SUP top STRUCTURAL + * DESC 'Abstraction of a network. The distinguished value of + * MUST ( cn $ ipNetworkNumber ) + * MAY ( ipNetmaskNumber $ l $ description $ manager ) ) + */ + +/* the search base for searches */ +const char *network_base = NULL; + +/* the search scope for searches */ +int network_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *network_filter = "(objectClass=ipNetwork)"; + +/* the attributes used in searches */ +const char *attmap_network_cn = "cn"; +const char *attmap_network_ipNetworkNumber = "ipNetworkNumber"; +/*const char *attmap_network_ipNetmaskNumber = "ipNetmaskNumber"; */ + +/* the attribute list to request with searches */ +static const char *network_attrs[3]; + +/* create a search filter for searching a network entry + by name, return -1 on errors */ +static int mkfilter_network_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + network_filter, + attmap_network_cn,buf2); +} + +static int mkfilter_network_byaddr(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + network_filter, + attmap_network_ipNetworkNumber,buf2); +} + +static void network_init(void) +{ + /* set up base */ + if (network_base==NULL) + network_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (network_scope==LDAP_SCOPE_DEFAULT) + network_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + network_attrs[0]=attmap_network_cn; + network_attrs[1]=attmap_network_ipNetworkNumber; + network_attrs[2]=NULL; +} + +/* write a single network entry to the stream */ +static int write_network(TFILE *fp,MYLDAP_ENTRY *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int numaddr,i; + const char *networkname; + const char **networknames; + const char **addresses; + /* get the most canonical name */ + networkname=myldap_get_rdn_value(entry,attmap_network_cn); + /* get the other names for the network */ + networknames=myldap_get_values(entry,attmap_network_cn); + if ((networknames==NULL)||(networknames[0]==NULL)) + { + log_log(LOG_WARNING,"network entry %s does not contain %s value", + myldap_get_dn(entry),attmap_network_cn); + return 0; + } + /* if the networkname is not yet found, get the first entry from networknames */ + if (networkname==NULL) + networkname=networknames[0]; + /* get the addresses */ + addresses=myldap_get_values(entry,attmap_network_ipNetworkNumber); + if ((addresses==NULL)||(addresses[0]==NULL)) + { + log_log(LOG_WARNING,"network entry %s does not contain %s value", + myldap_get_dn(entry),attmap_network_ipNetworkNumber); + return 0; + } + /* write the entry */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,networkname); + WRITE_STRINGLIST_EXCEPT(fp,networknames,networkname); + for (numaddr=0;addresses[numaddr]!=NULL;numaddr++) + /*noting*/ ; + WRITE_INT32(fp,numaddr); + for (i=0;i +#include +#include +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ +#include +#include +#include +#ifdef HAVE_GETOPT_H +#include +#endif /* HAVE_GETOPT_H */ +#include +#include +#include +#include +#include +#include +#include +#include +#ifdef HAVE_GRP_H +#include +#endif /* HAVE_GRP_H */ +#ifdef HAVE_NSS_H +#include +#endif /* HAVE_NSS_H */ +#include +#ifndef HAVE_GETOPT_LONG +#include "compat/getopt_long.h" +#endif /* not HAVE_GETOPT_LONG */ +#ifndef HAVE_DAEMON +#include "compat/daemon.h" +#endif /* not HAVE_DAEMON */ + +#include "nslcd.h" +#include "log.h" +#include "cfg.h" +#include "common.h" +#include "compat/attrs.h" +#include "compat/getpeercred.h" + +/* buffer sizes for I/O */ +#define READBUFFER_MINSIZE 32 +#define READBUFFER_MAXSIZE 64 +#define WRITEBUFFER_MINSIZE 64 +#define WRITEBUFFER_MAXSIZE 64*1024 + +/* the definition of the environment */ +extern char **environ; + +/* flag to indictate if we are in debugging mode */ +static int nslcd_debugging=0; + +/* the exit flag to indicate that a signal was received */ +static volatile int nslcd_exitsignal=0; + +/* the server socket used for communication */ +static int nslcd_serversocket=-1; + +/* thread ids of all running threads */ +static pthread_t *nslcd_threads; + +/* display version information */ +static void display_version(FILE *fp) +{ + fprintf(fp,"%s\n",PACKAGE_STRING); + fprintf(fp,"Written by Luke Howard and Arthur de Jong.\n\n"); + fprintf(fp,"Copyright (C) 1997-2008 Luke Howard, Arthur de Jong and West Consulting\n" + "This is free software; see the source for copying conditions. There is NO\n" + "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); +} + +/* display usage information to stdout and exit(status) */ +static void display_usage(FILE *fp,const char *program_name) +{ + fprintf(fp,"Usage: %s [OPTION]...\n",program_name); + fprintf(fp,"Name Service LDAP connection daemon.\n"); + fprintf(fp," -d, --debug don't fork and print debugging to stderr\n"); + fprintf(fp," --help display this help and exit\n"); + fprintf(fp," --version output version information and exit\n"); + fprintf(fp,"\n" + "Report bugs to <%s>.\n",PACKAGE_BUGREPORT); +} + +/* the definition of options for getopt(). see getopt(2) */ +static struct option const nslcd_options[] = +{ + { "debug", no_argument, NULL, 'd' }, + { "help", no_argument, NULL, 'h' }, + { "version", no_argument, NULL, 'V' }, + { NULL, 0, NULL, 0 } +}; +#define NSLCD_OPTIONSTRING "dhV" + +/* parse command line options and save settings in struct */ +static void parse_cmdline(int argc,char *argv[]) +{ + int optc; + while ((optc=getopt_long(argc,argv,NSLCD_OPTIONSTRING,nslcd_options,NULL))!=-1) + { + switch (optc) + { + case 'd': /* -d, --debug don't fork and print debugging to stderr */ + nslcd_debugging++; + log_setdefaultloglevel(LOG_DEBUG); + break; + case 'h': /* --help display this help and exit */ + display_usage(stdout,argv[0]); + exit(EXIT_SUCCESS); + case 'V': /* --version output version information and exit */ + display_version(stdout); + exit(EXIT_SUCCESS); + case ':': /* missing required parameter */ + case '?': /* unknown option character or extraneous parameter */ + default: + fprintf(stderr,"Try '%s --help' for more information.\n", + argv[0]); + exit(EXIT_FAILURE); + } + } + /* check for remaining arguments */ + if (optindldc_threads;i++) + if (pthread_cancel(nslcd_threads[i])) + { + /* TODO: figure out if we can actually log from within a signal handler */ + log_log(LOG_WARNING,"failed to stop thread %d (ignored): %s",i,strerror(errno)); + } +} + +/* do some cleaning up before terminating */ +static void exithandler(void) +{ + /* close socket if it's still in use */ + if (nslcd_serversocket >= 0) + { + if (close(nslcd_serversocket)) + log_log(LOG_WARNING,"problem closing server socket (ignored): %s",strerror(errno)); + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + log_log(LOG_DEBUG,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno)); + } + /* remove pidfile */ + if (unlink(NSLCD_PIDFILE)<0) + { + log_log(LOG_DEBUG,"unlink() of "NSLCD_PIDFILE" failed (ignored): %s", + strerror(errno)); + } + /* log exit */ + log_log(LOG_INFO,"version %s bailing out",VERSION); +} + +/* returns a socket ready to answer requests from the client, + exit()s on error */ +static int open_socket(void) +{ + int sock; + struct sockaddr_un addr; + /* create a socket */ + if ( (sock=socket(PF_UNIX,SOCK_STREAM,0))<0 ) + { + log_log(LOG_ERR,"cannot create socket: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + log_log(LOG_DEBUG,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno)); + } + /* create socket address structure */ + memset(&addr,0,sizeof(struct sockaddr_un)); + addr.sun_family=AF_UNIX; + strncpy(addr.sun_path,NSLCD_SOCKET,sizeof(addr.sun_path)); + addr.sun_path[sizeof(addr.sun_path)-1]='\0'; + /* bind to the named socket */ + if (bind(sock,(struct sockaddr *)&addr,sizeof(struct sockaddr_un))) + { + log_log(LOG_ERR,"bind() to "NSLCD_SOCKET" failed: %s", + strerror(errno)); + if (close(sock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* close the file descriptor on exit */ + if (fcntl(sock,F_SETFD,FD_CLOEXEC)<0) + { + log_log(LOG_ERR,"fctnl(F_SETFL,O_NONBLOCK) failed: %s",strerror(errno)); + if (close(sock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* set permissions of socket so anybody can do requests */ + /* Note: we use chmod() here instead of fchmod() because + fchmod does not work on sockets + http://www.opengroup.org/onlinepubs/009695399/functions/fchmod.html + http://lkml.org/lkml/2005/5/16/11 */ + if (chmod(NSLCD_SOCKET,(mode_t)0666)) + { + log_log(LOG_ERR,"chmod(0666) failed: %s",strerror(errno)); + if (close(sock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* start listening for connections */ + if (listen(sock,SOMAXCONN)<0) + { + log_log(LOG_ERR,"listen() failed: %s",strerror(errno)); + if (close(sock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* we're done */ + return sock; +} + +/* read the version information and action from the stream + this function returns the read action in location pointer to by action */ +static int read_header(TFILE *fp,int32_t *action) +{ + int32_t tmpint32; + /* read the protocol version */ + READ_TYPE(fp,tmpint32,int32_t); + if (tmpint32 != (int32_t)NSLCD_VERSION) + { + log_log(LOG_DEBUG,"wrong nslcd version id (%d)",(int)tmpint32); + return -1; + } + /* read the request type */ + READ(fp,action,sizeof(int32_t)); + return 0; +} + +/* read a request message, returns <0 in case of errors, + this function closes the socket */ +static void handleconnection(int sock,MYLDAP_SESSION *session) +{ + TFILE *fp; + int32_t action; + struct timeval readtimeout,writetimeout; + uid_t uid; + gid_t gid; + pid_t pid; + /* log connection */ + if (getpeercred(sock,&uid,&gid,&pid)) + log_log(LOG_DEBUG,"connection from unknown client: %s",strerror(errno)); + else + log_log(LOG_DEBUG,"connection from pid=%d uid=%d gid=%d", + (int)pid,(int)uid,(int)gid); + /* set the timeouts */ + readtimeout.tv_sec=0; /* clients should send their request quickly */ + readtimeout.tv_usec=500000; + writetimeout.tv_sec=5; /* clients could be taking some time to process the results */ + writetimeout.tv_usec=0; + /* create a stream object */ + if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout, + READBUFFER_MINSIZE,READBUFFER_MAXSIZE, + WRITEBUFFER_MINSIZE,WRITEBUFFER_MAXSIZE))==NULL) + { + log_log(LOG_WARNING,"cannot create stream for writing: %s",strerror(errno)); + (void)close(sock); + return; + } + /* read request */ + if (read_header(fp,&action)) + { + (void)tio_close(fp); + return; + } + /* handle request */ + switch (action) + { + case NSLCD_ACTION_ALIAS_BYNAME: (void)nslcd_alias_byname(fp,session); break; + case NSLCD_ACTION_ALIAS_ALL: (void)nslcd_alias_all(fp,session); break; + case NSLCD_ACTION_ETHER_BYNAME: (void)nslcd_ether_byname(fp,session); break; + case NSLCD_ACTION_ETHER_BYETHER: (void)nslcd_ether_byether(fp,session); break; + case NSLCD_ACTION_ETHER_ALL: (void)nslcd_ether_all(fp,session); break; + case NSLCD_ACTION_GROUP_BYNAME: (void)nslcd_group_byname(fp,session); break; + case NSLCD_ACTION_GROUP_BYGID: (void)nslcd_group_bygid(fp,session); break; + case NSLCD_ACTION_GROUP_BYMEMBER: (void)nslcd_group_bymember(fp,session); break; + case NSLCD_ACTION_GROUP_ALL: (void)nslcd_group_all(fp,session); break; + case NSLCD_ACTION_HOST_BYNAME: (void)nslcd_host_byname(fp,session); break; + case NSLCD_ACTION_HOST_BYADDR: (void)nslcd_host_byaddr(fp,session); break; + case NSLCD_ACTION_HOST_ALL: (void)nslcd_host_all(fp,session); break; + case NSLCD_ACTION_NETGROUP_BYNAME: (void)nslcd_netgroup_byname(fp,session); break; + case NSLCD_ACTION_NETWORK_BYNAME: (void)nslcd_network_byname(fp,session); break; + case NSLCD_ACTION_NETWORK_BYADDR: (void)nslcd_network_byaddr(fp,session); break; + case NSLCD_ACTION_NETWORK_ALL: (void)nslcd_network_all(fp,session); break; + case NSLCD_ACTION_PASSWD_BYNAME: (void)nslcd_passwd_byname(fp,session); break; + case NSLCD_ACTION_PASSWD_BYUID: (void)nslcd_passwd_byuid(fp,session); break; + case NSLCD_ACTION_PASSWD_ALL: (void)nslcd_passwd_all(fp,session); break; + case NSLCD_ACTION_PROTOCOL_BYNAME: (void)nslcd_protocol_byname(fp,session); break; + case NSLCD_ACTION_PROTOCOL_BYNUMBER:(void)nslcd_protocol_bynumber(fp,session); break; + case NSLCD_ACTION_PROTOCOL_ALL: (void)nslcd_protocol_all(fp,session); break; + case NSLCD_ACTION_RPC_BYNAME: (void)nslcd_rpc_byname(fp,session); break; + case NSLCD_ACTION_RPC_BYNUMBER: (void)nslcd_rpc_bynumber(fp,session); break; + case NSLCD_ACTION_RPC_ALL: (void)nslcd_rpc_all(fp,session); break; + case NSLCD_ACTION_SERVICE_BYNAME: (void)nslcd_service_byname(fp,session); break; + case NSLCD_ACTION_SERVICE_BYNUMBER: (void)nslcd_service_bynumber(fp,session); break; + case NSLCD_ACTION_SERVICE_ALL: (void)nslcd_service_all(fp,session); break; + case NSLCD_ACTION_SHADOW_BYNAME: if (uid==0) (void)nslcd_shadow_byname(fp,session); break; + case NSLCD_ACTION_SHADOW_ALL: if (uid==0) (void)nslcd_shadow_all(fp,session); break; + default: + log_log(LOG_WARNING,"invalid request id: %d",(int)action); + break; + } + /* we're done with the request */ + myldap_session_cleanup(session); + (void)tio_close(fp); + return; +} + +/* accept a connection on the socket */ +static void acceptconnection(MYLDAP_SESSION *session) +{ + int csock; + int j; + struct sockaddr_storage addr; + socklen_t alen; + /* accept a new connection */ + alen=(socklen_t)sizeof(struct sockaddr_storage); + csock=accept(nslcd_serversocket,(struct sockaddr *)&addr,&alen); + if (csock<0) + { + if ((errno==EINTR)||(errno==EAGAIN)||(errno==EWOULDBLOCK)) + { + log_log(LOG_DEBUG,"accept() failed (ignored): %s",strerror(errno)); + return; + } + log_log(LOG_ERR,"accept() failed: %s",strerror(errno)); + return; + } + /* make sure O_NONBLOCK is not inherited */ + if ((j=fcntl(csock,F_GETFL,0))<0) + { + log_log(LOG_ERR,"fctnl(F_GETFL) failed: %s",strerror(errno)); + if (close(csock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + return; + } + if (fcntl(csock,F_SETFL,j&~O_NONBLOCK)<0) + { + log_log(LOG_ERR,"fctnl(F_SETFL,~O_NONBLOCK) failed: %s",strerror(errno)); + if (close(csock)) + log_log(LOG_WARNING,"problem closing socket: %s",strerror(errno)); + return; + } + /* handle the connection */ + handleconnection(csock,session); +} + +/* write the current process id to the specified file */ +static void write_pidfile(const char *filename) +{ + FILE *fp; + if (filename!=NULL) + { + if ((fp=fopen(filename,"w"))==NULL) + { + log_log(LOG_ERR,"cannot open pid file (%s): %s",filename,strerror(errno)); + exit(EXIT_FAILURE); + } + if (fprintf(fp,"%d\n",(int)getpid())<=0) + { + log_log(LOG_ERR,"error writing pid file (%s)",filename); + exit(EXIT_FAILURE); + } + if (fclose(fp)) + { + log_log(LOG_ERR,"error writing pid file (%s): %s",filename,strerror(errno)); + exit(EXIT_FAILURE); + } + } +} + +/* try to install signal handler and check result */ +static void install_sighandler(int signum,RETSIGTYPE (*handler) (int)) +{ + struct sigaction act; + memset(&act,0,sizeof(struct sigaction)); + act.sa_handler=handler; + sigemptyset(&act.sa_mask); + act.sa_flags=SA_RESTART|SA_NOCLDSTOP; + if (sigaction(signum,&act,NULL)!=0) + { + log_log(LOG_ERR,"error installing signal handler for '%s': %s",signame(signum),strerror(errno)); + exit(EXIT_FAILURE); + } +} + +static void worker_cleanup(void *arg) +{ + MYLDAP_SESSION *session=(MYLDAP_SESSION *)arg; + myldap_session_close(session); +} + +static void *worker(void UNUSED(*arg)) +{ + MYLDAP_SESSION *session; + /* create a new LDAP session */ + session=myldap_create_session(); + /* clean up the session if we're done */ + pthread_cleanup_push(worker_cleanup,session); + /* start waiting for incoming connections */ + while (1) + { + /* wait for a new connection */ + acceptconnection(session); + } + pthread_cleanup_pop(1); + return NULL; +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + gid_t mygid=(gid_t)-1; + uid_t myuid=(uid_t)-1; + int i; + /* parse the command line */ + parse_cmdline(argc,argv); + /* clear the environment */ + /* TODO:implement */ + /* check if we are already running */ + /* FIXME: implement (maybe pass along options or commands) */ + /* disable ldap lookups of host names to avoid lookup loop + and fall back to files dns (a sensible default) */ + /* TODO: parse /etc/nsswitch ourselves and just remove ldap from the list */ +#ifdef HAVE___NSS_CONFIGURE_LOOKUP + if (__nss_configure_lookup("hosts","files dns")) + log_log(LOG_ERR,"unable to override hosts lookup method: %s",strerror(errno)); +#endif /* HAVE___NSS_CONFIGURE_LOOKUP */ + /* FIXME: have some other mechanism for systems that don't have this */ + /* read configuration file */ + cfg_init(NSS_LDAP_PATH_CONF); + nslcd_cfg->ldc_debug=nslcd_debugging?nslcd_debugging-1:0; + /* daemonize */ + if ((!nslcd_debugging)&&(daemon(0,0)<0)) + { + log_log(LOG_ERR,"unable to daemonize: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* set default mode for pidfile and socket */ + (void)umask((mode_t)0022); + /* intilialize logging */ + if (!nslcd_debugging) + log_startlogging(); + log_log(LOG_INFO,"version %s starting",VERSION); + /* install handler to close stuff off on exit and log notice */ + if (atexit(exithandler)) + { + log_log(LOG_ERR,"atexit() failed: %s",strerror(errno)); + exit(EXIT_FAILURE); + } + /* write pidfile */ + write_pidfile(NSLCD_PIDFILE); + /* create socket */ + nslcd_serversocket=open_socket(); +#ifdef HAVE_SETGROUPS + /* drop all supplemental groups */ + if (setgroups(0,NULL)<0) + log_log(LOG_WARNING,"cannot setgroups(0,NULL) (ignored): %s",strerror(errno)); + else + log_log(LOG_DEBUG,"setgroups(0,NULL) done"); +#else /* HAVE_SETGROUPS */ + log_log(LOG_DEBUG,"setgroups() not available"); +#endif /* not HAVE_SETGROUPS */ + /* change to nslcd gid */ + if (mygid!=((gid_t)-1)) + { + if (setgid(mygid)!=0) + { + log_log(LOG_ERR,"cannot setgid(%d): %s",(int)mygid,strerror(errno)); + exit(EXIT_FAILURE); + } + log_log(LOG_DEBUG,"setgid(%d) done",(int)mygid); + } + /* change to nslcd uid */ + if (myuid!=((uid_t)-1)) + { + if (setuid(myuid)!=0) + { + log_log(LOG_ERR,"cannot setuid(%d): %s",(int)myuid,strerror(errno)); + exit(EXIT_FAILURE); + } + log_log(LOG_DEBUG,"setuid(%d) done",(int)myuid); + } + /* install signalhandlers for some signals */ + install_sighandler(SIGHUP, sigexit_handler); + install_sighandler(SIGINT, sigexit_handler); + install_sighandler(SIGQUIT,sigexit_handler); + install_sighandler(SIGABRT,sigexit_handler); + install_sighandler(SIGPIPE,SIG_IGN); + install_sighandler(SIGTERM,sigexit_handler); + install_sighandler(SIGUSR1,sigexit_handler); + install_sighandler(SIGUSR2,sigexit_handler); + /* TODO: install signal handlers for reloading configuration */ + log_log(LOG_INFO,"accepting connections"); + /* start worker threads */ + nslcd_threads=(pthread_t *)malloc(nslcd_cfg->ldc_threads*sizeof(pthread_t)); + if (nslcd_threads==NULL) + { + log_log(LOG_CRIT,"main(): malloc() failed to allocate memory"); + exit(EXIT_FAILURE); + } + for (i=0;ildc_threads;i++) + { + if (pthread_create(&nslcd_threads[i],NULL,worker,NULL)) + { + log_log(LOG_ERR,"unable to start worker thread %d: %s",i,strerror(errno)); + exit(EXIT_FAILURE); + } + } + /* wait for all threads to die */ + /* BUG: this causes problems if for some reason we want to exit but one + of our threads hangs (e.g. has one of the LDAP locks) + Other than that it may be a good idea to keep this thread more or less alive + to do general house keeping things (e.g. checking signals etc) */ + /* it is also better to always do thread_cancel() here instead of in the signal + handler */ + for (i=0;ildc_threads;i++) + { + if (pthread_join(nslcd_threads[i],NULL)) + { + log_log(LOG_ERR,"unable to wait for worker thread %d: %s",i,strerror(errno)); + exit(EXIT_FAILURE); + } + } + free(nslcd_threads); + /* print something about received signals */ + if (nslcd_exitsignal!=0) + { + log_log(LOG_INFO,"caught signal %s (%d), shutting down", + signame(nslcd_exitsignal),nslcd_exitsignal); + } + return EXIT_FAILURE; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/passwd.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/passwd.c new file mode 100644 index 0000000000..beb9ebf2e4 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/passwd.c @@ -0,0 +1,520 @@ +/* + passwd.c - password entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-pwd.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" +#include "common/dict.h" + +/* ( nisSchema.2.0 NAME 'posixAccount' SUP top AUXILIARY + * DESC 'Abstraction of an account with POSIX attributes' + * MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) + * MAY ( userPassword $ loginShell $ gecos $ description ) ) + */ + +/* the search base for searches */ +const char *passwd_base = NULL; + +/* the search scope for searches */ +int passwd_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *passwd_filter = "(objectClass=posixAccount)"; + +/* the attributes used in searches */ +const char *attmap_passwd_uid = "uid"; +const char *attmap_passwd_userPassword = "userPassword"; +const char *attmap_passwd_uidNumber = "uidNumber"; +const char *attmap_passwd_gidNumber = "gidNumber"; +const char *attmap_passwd_gecos = "gecos"; +const char *attmap_passwd_cn = "cn"; +const char *attmap_passwd_homeDirectory = "homeDirectory"; +const char *attmap_passwd_loginShell = "loginShell"; + +/* default values for attributes */ +static const char *default_passwd_userPassword = "*"; /* unmatchable */ +static const char *default_passwd_homeDirectory = ""; +static const char *default_passwd_loginShell = ""; + +/* the attribute list to request with searches */ +static const char *passwd_attrs[10]; + +/* create a search filter for searching a passwd entry + by name, return -1 on errors */ +static int mkfilter_passwd_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if(myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + passwd_filter, + attmap_passwd_uid,buf2); +} + +/* create a search filter for searching a passwd entry + by uid, return -1 on errors */ +static int mkfilter_passwd_byuid(uid_t uid, + char *buffer,size_t buflen) +{ + return mysnprintf(buffer,buflen, + "(&%s(%s=%d))", + passwd_filter, + attmap_passwd_uidNumber,uid); +} + +static void passwd_init(void) +{ + /* set up base */ + if (passwd_base==NULL) + passwd_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (passwd_scope==LDAP_SCOPE_DEFAULT) + passwd_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + passwd_attrs[0]=attmap_passwd_uid; + passwd_attrs[1]=attmap_passwd_userPassword; + passwd_attrs[2]=attmap_passwd_uidNumber; + passwd_attrs[3]=attmap_passwd_gidNumber; + passwd_attrs[4]=attmap_passwd_cn; + passwd_attrs[5]=attmap_passwd_homeDirectory; + passwd_attrs[6]=attmap_passwd_loginShell; + passwd_attrs[7]=attmap_passwd_gecos; + passwd_attrs[8]="objectClass"; + passwd_attrs[9]=NULL; +} + +/* + Checks to see if the specified name is a valid user name. + + This test is based on the definition from POSIX (IEEE Std 1003.1, 2004, 3.426 User Name + and 3.276 Portable Filename Character Set): + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_426 + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276 + + The standard defines user names valid if they contain characters from + the set [A-Za-z0-9._-] where the hyphen should not be used as first + character. As an extension this test allows the dolar '$' sign as the last + character to support Samba special accounts. +*/ +int isvalidusername(const char *name) +{ + int i; + if ((name==NULL)||(name[0]=='\0')) + return 0; + /* check first character */ + if ( ! ( (name[0]>='A' && name[0] <= 'Z') || + (name[0]>='a' && name[0] <= 'z') || + (name[0]>='0' && name[0] <= '9') || + name[0]=='.' || name[0]=='_' ) ) + return 0; + /* check other characters */ + for (i=1;name[i]!='\0';i++) + { + if ( name[i]=='$' ) + { + /* if the char is $ we require it to be the last char */ + if (name[i+1]!='\0') + return 0; + } + else if ( ! ( (name[i]>='A' && name[i] <= 'Z') || + (name[i]>='a' && name[i] <= 'z') || + (name[i]>='0' && name[i] <= '9') || + name[i]=='.' || name[i]=='_' || name[i]=='-') ) + return 0; + } + /* no test failed so it must be good */ + return -1; +} + +/* the cache that is used in dn2uid() */ +static pthread_mutex_t dn2uid_cache_mutex=PTHREAD_MUTEX_INITIALIZER; +static DICT *dn2uid_cache=NULL; +struct dn2uid_cache_entry +{ + time_t timestamp; + char *uid; +}; +#define DN2UID_CACHE_TIMEOUT (15*60) + +/* Perform an LDAP lookup to translate the DN into a uid. + This function either returns NULL or a strdup()ed string. */ +static char *lookup_dn2uid(MYLDAP_SESSION *session,const char *dn) +{ + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + static const char *attrs[2]; + int rc; + const char **values; + char *uid; + /* we have to look up the entry */ + attrs[0]=attmap_passwd_uid; + attrs[1]=NULL; + search=myldap_search(session,dn,LDAP_SCOPE_BASE,passwd_filter,attrs); + if (search==NULL) + { + log_log(LOG_WARNING,"lookup of user %s failed",dn); + return NULL; + } + entry=myldap_get_entry(search,&rc); + if (entry==NULL) + { + if (rc!=LDAP_SUCCESS) + log_log(LOG_WARNING,"lookup of user %s failed: %s",dn,ldap_err2string(rc)); + return NULL; + } + /* get uid (just use first one) */ + values=myldap_get_values(entry,attmap_passwd_uid); + /* check the result for presence and validity */ + if ((values!=NULL)&&(values[0]!=NULL)&&isvalidusername(values[0])) + uid=strdup(values[0]); + else + uid=NULL; + myldap_search_close(search); + return uid; +} + +char *dn2uid(MYLDAP_SESSION *session,const char *dn,char *buf,size_t buflen) +{ + struct dn2uid_cache_entry *cacheentry=NULL; + char *uid; + /* check for empty string */ + if ((dn==NULL)||(*dn=='\0')) + return NULL; + /* try to look up uid within DN string */ + if (myldap_cpy_rdn_value(dn,attmap_passwd_uid,buf,buflen)!=NULL) + { + /* check if it is valid */ + if (!isvalidusername(buf)) + return NULL; + return buf; + } + /* see if we have a cached entry */ + pthread_mutex_lock(&dn2uid_cache_mutex); + if (dn2uid_cache==NULL) + dn2uid_cache=dict_new(); + if ((dn2uid_cache!=NULL) && ((cacheentry=dict_get(dn2uid_cache,dn))!=NULL)) + { + /* if the cached entry is still valid, return that */ + if (time(NULL) < (cacheentry->timestamp+DN2UID_CACHE_TIMEOUT)) + { + if ((cacheentry->uid!=NULL)&&(strlen(cacheentry->uid)uid); + else + buf=NULL; + pthread_mutex_unlock(&dn2uid_cache_mutex); + return buf; + } + /* leave the entry intact, just replace the uid below */ + } + pthread_mutex_unlock(&dn2uid_cache_mutex); + /* look up the uid using an LDAP query */ + uid=lookup_dn2uid(session,dn); + /* store the result in the cache */ + pthread_mutex_lock(&dn2uid_cache_mutex); + if (cacheentry==NULL) + { + /* allocate a new entry in the cache */ + cacheentry=(struct dn2uid_cache_entry *)malloc(sizeof(struct dn2uid_cache_entry)); + if (cacheentry!=NULL) + dict_put(dn2uid_cache,dn,cacheentry); + } + else if (cacheentry->uid!=NULL) + free(cacheentry->uid); + /* update the cache entry */ + if (cacheentry!=NULL) + { + cacheentry->timestamp=time(NULL); + cacheentry->uid=uid; + } + pthread_mutex_unlock(&dn2uid_cache_mutex); + /* copy the result into the buffer */ + if ((uid!=NULL)&&(strlen(uid) +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.4 NAME 'ipProtocol' SUP top STRUCTURAL + * DESC 'Abstraction of an IP protocol. Maps a protocol number + * to one or more names. The distinguished value of the cn + * attribute denotes the protocol's canonical name' + * MUST ( cn $ ipProtocolNumber ) + * MAY description ) + */ + +/* the search base for searches */ +const char *protocol_base = NULL; + +/* the search scope for searches */ +int protocol_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *protocol_filter = "(objectClass=ipProtocol)"; + +/* the attributes used in searches */ +const char *attmap_protocol_cn = "cn"; +const char *attmap_protocol_ipProtocolNumber = "ipProtocolNumber"; + +/* the attribute list to request with searches */ +static const char *protocol_attrs[3]; + +static int mkfilter_protocol_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + protocol_filter, + attmap_protocol_cn,buf2); +} + +/* create a search filter for searching a protocol entry + by uid, return -1 on errors */ +static int mkfilter_protocol_bynumber(int protocol, + char *buffer,size_t buflen) +{ + return mysnprintf(buffer,buflen, + "(&%s(%s=%d))", + protocol_filter, + attmap_protocol_ipProtocolNumber,protocol); +} + +static void protocol_init(void) +{ + /* set up base */ + if (protocol_base==NULL) + protocol_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (protocol_scope==LDAP_SCOPE_DEFAULT) + protocol_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + protocol_attrs[0]=attmap_protocol_cn; + protocol_attrs[1]=attmap_protocol_ipProtocolNumber; + protocol_attrs[2]=NULL; +} + +static int write_protocol(TFILE *fp,MYLDAP_ENTRY *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + const char *name; + const char **aliases; + const char **protos; + char *tmp; + int proto; + /* get the most canonical name */ + name=myldap_get_rdn_value(entry,attmap_protocol_cn); + /* get the other names for the protocol */ + aliases=myldap_get_values(entry,attmap_protocol_cn); + if ((aliases==NULL)||(aliases[0]==NULL)) + { + log_log(LOG_WARNING,"protocol entry %s does not contain %s value", + myldap_get_dn(entry),attmap_protocol_cn); + return 0; + } + /* if the protocol name is not yet found, get the first entry */ + if (name==NULL) + name=aliases[0]; + /* get the protocol number */ + protos=myldap_get_values(entry,attmap_protocol_ipProtocolNumber); + if ((protos==NULL)||(protos[0]==NULL)) + { + log_log(LOG_WARNING,"protocol entry %s does not contain %s value", + myldap_get_dn(entry),attmap_protocol_ipProtocolNumber); + return 0; + } + else if (protos[1]!=NULL) + { + log_log(LOG_WARNING,"protocol entry %s contains multiple %s values", + myldap_get_dn(entry),attmap_protocol_ipProtocolNumber); + } + proto=(int)strtol(protos[0],&tmp,0); + if ((*(protos[0])=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"protocol entry %s contains non-numeric %s value", + myldap_get_dn(entry),attmap_protocol_ipProtocolNumber); + return 0; + } + /* write entry */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,name); + WRITE_STRINGLIST_EXCEPT(fp,aliases,name); + WRITE_INT32(fp,proto); + return 0; +} + +NSLCD_HANDLE( + protocol,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_protocol_byname(%s)",name);, + NSLCD_ACTION_PROTOCOL_BYNAME, + mkfilter_protocol_byname(name,filter,sizeof(filter)), + write_protocol(fp,entry) +) + +NSLCD_HANDLE( + protocol,bynumber, + int protocol; + char filter[1024]; + READ_INT32(fp,protocol);, + log_log(LOG_DEBUG,"nslcd_protocol_bynumber(%d)",protocol);, + NSLCD_ACTION_PROTOCOL_BYNUMBER, + mkfilter_protocol_bynumber(protocol,filter,sizeof(filter)), + write_protocol(fp,entry) +) + +NSLCD_HANDLE( + protocol,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_protocol_all()");, + NSLCD_ACTION_PROTOCOL_ALL, + (filter=protocol_filter,0), + write_protocol(fp,entry) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/rpc.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/rpc.c new file mode 100644 index 0000000000..b779027587 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/rpc.c @@ -0,0 +1,181 @@ +/* + rpc.c - rpc name lookup routines + Parts of this file were part of the nss_ldap library (as ldap-rpc.c) which + has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.5 NAME 'oncRpc' SUP top STRUCTURAL + * DESC 'Abstraction of an Open Network Computing (ONC) + * [RFC1057] Remote Procedure Call (RPC) binding. + * This class maps an ONC RPC number to a name. + * The distinguished value of the cn attribute denotes + * the RPC service's canonical name' + * MUST ( cn $ oncRpcNumber ) + * MAY description ) + */ + +/* the search base for searches */ +const char *rpc_base = NULL; + +/* the search scope for searches */ +int rpc_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *rpc_filter = "(objectClass=oncRpc)"; + +/* the attributes to request with searches */ +const char *attmap_rpc_cn = "cn"; +const char *attmap_rpc_oncRpcNumber = "oncRpcNumber"; + +/* the attribute list to request with searches */ +static const char *rpc_attrs[3]; + +static int mkfilter_rpc_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + rpc_filter, + attmap_rpc_cn,buf2); +} + +static int mkfilter_rpc_bynumber(int number, + char *buffer,size_t buflen) +{ + return mysnprintf(buffer,buflen, + "(&%s(%s=%d))", + rpc_filter, + attmap_rpc_oncRpcNumber,number); +} + +static void rpc_init(void) +{ + /* set up base */ + if (rpc_base==NULL) + rpc_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (rpc_scope==LDAP_SCOPE_DEFAULT) + rpc_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + rpc_attrs[0]=attmap_rpc_cn; + rpc_attrs[1]=attmap_rpc_oncRpcNumber; + rpc_attrs[2]=NULL; +} + +/* write a single rpc entry to the stream */ +static int write_rpc(TFILE *fp,MYLDAP_ENTRY *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + const char *name; + const char **aliases; + const char **numbers; + char *tmp; + int number; + /* get the most canonical name */ + name=myldap_get_rdn_value(entry,attmap_rpc_cn); + /* get the other names for the rpc entries */ + aliases=myldap_get_values(entry,attmap_rpc_cn); + if ((aliases==NULL)||(aliases[0]==NULL)) + { + log_log(LOG_WARNING,"rpc entry %s does not contain %s value", + myldap_get_dn(entry),attmap_rpc_cn); + return 0; + } + /* if the rpc name is not yet found, get the first entry */ + if (name==NULL) + name=aliases[0]; + /* get the rpc number */ + numbers=myldap_get_values(entry,attmap_rpc_oncRpcNumber); + if ((numbers==NULL)||(numbers[0]==NULL)) + { + log_log(LOG_WARNING,"rpc entry %s does not contain %s value", + myldap_get_dn(entry),attmap_rpc_oncRpcNumber); + return 0; + } + else if (numbers[1]!=NULL) + { + log_log(LOG_WARNING,"rpc entry %s contains multiple %s values", + myldap_get_dn(entry),attmap_rpc_oncRpcNumber); + } + number=(int)strtol(numbers[0],&tmp,0); + if ((*(numbers[0])=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"rpc entry %s contains non-numeric %s value", + myldap_get_dn(entry),attmap_rpc_oncRpcNumber); + return 0; + } + /* write the entry */ + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,name); + WRITE_STRINGLIST_EXCEPT(fp,aliases,name); + WRITE_INT32(fp,number); + return 0; +} + +NSLCD_HANDLE( + rpc,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_rpc_byname(%s)",name);, + NSLCD_ACTION_RPC_BYNAME, + mkfilter_rpc_byname(name,filter,sizeof(filter)), + write_rpc(fp,entry) +) + +NSLCD_HANDLE( + rpc,bynumber, + int number; + char filter[1024]; + READ_INT32(fp,number);, + log_log(LOG_DEBUG,"nslcd_rpc_bynumber(%d)",number);, + NSLCD_ACTION_RPC_BYNUMBER, + mkfilter_rpc_bynumber(number,filter,sizeof(filter)), + write_rpc(fp,entry) +) + +NSLCD_HANDLE( + rpc,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_rpc_all()");, + NSLCD_ACTION_RPC_ALL, + (filter=rpc_filter,0), + write_rpc(fp,entry) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/service.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/service.c new file mode 100644 index 0000000000..cf32438678 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/service.c @@ -0,0 +1,235 @@ +/* + service.c - service entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-service.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.3 NAME 'ipService' SUP top STRUCTURAL + * DESC 'Abstraction an Internet Protocol service. + * Maps an IP port and protocol (such as tcp or udp) + * to one or more names; the distinguished value of + * the cn attribute denotes the service's canonical + * name' + * MUST ( cn $ ipServicePort $ ipServiceProtocol ) + * MAY ( description ) ) + */ + +/* the search base for searches */ +const char *service_base = NULL; + +/* the search scope for searches */ +int service_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *service_filter = "(objectClass=ipService)"; + +/* the attributes to request with searches */ +const char *attmap_service_cn = "cn"; +const char *attmap_service_ipServicePort = "ipServicePort"; +const char *attmap_service_ipServiceProtocol = "ipServiceProtocol"; + +/* the attribute list to request with searches */ +static const char *service_attrs[4]; + +static int mkfilter_service_byname(const char *name, + const char *protocol, + char *buffer,size_t buflen) +{ + char buf2[1024],buf3[1024]; + /* escape attributes */ + if (myldap_escape(name,buf2,sizeof(buf2))) + return -1; + if (*protocol!='\0') + if (myldap_escape(protocol,buf3,sizeof(buf3))) + return -1; + /* build filter */ + if (*protocol!='\0') + return mysnprintf(buffer,buflen, + "(&%s(%s=%s)(%s=%s))", + service_filter, + attmap_service_cn,buf2, + attmap_service_ipServiceProtocol,buf3); + else + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + service_filter, + attmap_service_cn,buf2); +} + +static int mkfilter_service_bynumber(int number, + const char *protocol, + char *buffer,size_t buflen) +{ + char buf3[1024]; + /* escape attribute */ + if (*protocol!='\0') + if (myldap_escape(protocol,buf3,sizeof(buf3))) + return -1; + /* build filter */ + if (*protocol!='\0') + return mysnprintf(buffer,buflen, + "(&%s(%s=%d)(%s=%s))", + service_filter, + attmap_service_ipServicePort,number, + attmap_service_ipServiceProtocol,buf3); + else + return mysnprintf(buffer,buflen, + "(&%s(%s=%d))", + service_filter, + attmap_service_ipServicePort,number); +} + +static void service_init(void) +{ + /* set up base */ + if (service_base==NULL) + service_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (service_scope==LDAP_SCOPE_DEFAULT) + service_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + service_attrs[0]=attmap_service_cn; + service_attrs[1]=attmap_service_ipServicePort; + service_attrs[2]=attmap_service_ipServiceProtocol; + service_attrs[3]=NULL; +} + +static int write_service(TFILE *fp,MYLDAP_ENTRY *entry,const char *reqprotocol) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + const char *name; + const char **aliases; + const char **ports; + const char **protocols; + const char *tmparr[2]; + char *tmp; + int port; + int i; + /* get the most canonical name */ + name=myldap_get_rdn_value(entry,attmap_service_cn); + /* get the other names for the service entries */ + aliases=myldap_get_values(entry,attmap_service_cn); + if ((aliases==NULL)||(aliases[0]==NULL)) + { + log_log(LOG_WARNING,"service entry %s does not contain %s value", + myldap_get_dn(entry),attmap_service_cn); + return 0; + } + /* if the service name is not yet found, get the first entry */ + if (name==NULL) + name=aliases[0]; + /* get the service number */ + ports=myldap_get_values(entry,attmap_service_ipServicePort); + if ((ports==NULL)||(ports[0]==NULL)) + { + log_log(LOG_WARNING,"service entry %s does not contain %s value", + myldap_get_dn(entry),attmap_service_ipServicePort); + return 0; + } + else if (ports[1]!=NULL) + { + log_log(LOG_WARNING,"service entry %s contains multiple %s values", + myldap_get_dn(entry),attmap_service_ipServicePort); + } + port=(int)strtol(ports[0],&tmp,0); + if ((*(ports[0])=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"service entry %s contains non-numeric %s value", + myldap_get_dn(entry),attmap_service_ipServicePort); + return 0; + } + /* get protocols */ + if ((reqprotocol!=NULL)&&(*reqprotocol!='\0')) + { + protocols=tmparr; + protocols[0]=reqprotocol; + protocols[1]=NULL; + } + else + { + protocols=myldap_get_values(entry,attmap_service_ipServiceProtocol); + if ((protocols==NULL)||(protocols[0]==NULL)) + { + log_log(LOG_WARNING,"service entry %s does not contain %s value", + myldap_get_dn(entry),attmap_service_ipServiceProtocol); + return 0; + } + } + /* write the entries */ + for (i=0;protocols[i]!=NULL;i++) + { + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,name); + WRITE_STRINGLIST_EXCEPT(fp,aliases,name); + WRITE_INT32(fp,port); + WRITE_STRING(fp,protocols[i]); + } + return 0; +} + +NSLCD_HANDLE( + service,byname, + char name[256]; + char protocol[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name)); + READ_STRING_BUF2(fp,protocol,sizeof(protocol));, + log_log(LOG_DEBUG,"nslcd_service_byname(%s,%s)",name,protocol);, + NSLCD_ACTION_SERVICE_BYNAME, + mkfilter_service_byname(name,protocol,filter,sizeof(filter)), + write_service(fp,entry,protocol) +) + +NSLCD_HANDLE( + service,bynumber, + int number; + char protocol[256]; + char filter[1024]; + READ_INT32(fp,number); + READ_STRING_BUF2(fp,protocol,sizeof(protocol));, + log_log(LOG_DEBUG,"nslcd_service_bynumber(%d,%s)",number,protocol);, + NSLCD_ACTION_SERVICE_BYNUMBER, + mkfilter_service_bynumber(number,protocol,filter,sizeof(filter)), + write_service(fp,entry,protocol) +) + +NSLCD_HANDLE( + service,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_service_all()");, + NSLCD_ACTION_SERVICE_ALL, + (filter=service_filter,0), + write_service(fp,entry,NULL) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nslcd/shadow.c b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/shadow.c new file mode 100644 index 0000000000..cbd9447334 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nslcd/shadow.c @@ -0,0 +1,284 @@ +/* + shadow.c - service entry lookup routines + Parts of this file were part of the nss_ldap library (as ldap-spwd.c) + which has been forked into the nss-ldapd library. + + Copyright (C) 1997-2005 Luke Howard + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "common.h" +#include "log.h" +#include "myldap.h" +#include "cfg.h" +#include "attmap.h" + +/* ( nisSchema.2.1 NAME 'shadowAccount' SUP top AUXILIARY + * DESC 'Additional attributes for shadow passwords' + * MUST uid + * MAY ( userPassword $ shadowLastChange $ shadowMin + * shadowMax $ shadowWarning $ shadowInactive $ + * shadowExpire $ shadowFlag $ description ) ) + */ + +/* the search base for searches */ +const char *shadow_base = NULL; + +/* the search scope for searches */ +int shadow_scope = LDAP_SCOPE_DEFAULT; + +/* the basic search filter for searches */ +const char *shadow_filter = "(objectClass=shadowAccount)"; + +/* the attributes to request with searches */ +const char *attmap_shadow_uid = "uid"; +const char *attmap_shadow_userPassword = "userPassword"; +const char *attmap_shadow_shadowLastChange = "shadowLastChange"; +const char *attmap_shadow_shadowMin = "shadowMin"; +const char *attmap_shadow_shadowMax = "shadowMax"; +const char *attmap_shadow_shadowWarning = "shadowWarning"; +const char *attmap_shadow_shadowInactive = "shadowInactive"; +const char *attmap_shadow_shadowExpire = "shadowExpire"; +const char *attmap_shadow_shadowFlag = "shadowFlag"; + +/* default values for attributes */ +static const char *default_shadow_userPassword = "*"; /* unmatchable */ +static const char *default_shadow_shadowLastChange = "-1"; +static const char *default_shadow_shadowMin = "-1"; +static const char *default_shadow_shadowMax = "-1"; +static const char *default_shadow_shadowWarning = "-1"; +static const char *default_shadow_shadowInactive = "-1"; +static const char *default_shadow_shadowExpire = "-1"; +static const char *default_shadow_shadowFlag = "0"; + +/* the attribute list to request with searches */ +static const char *shadow_attrs[10]; + +static int mkfilter_shadow_byname(const char *name, + char *buffer,size_t buflen) +{ + char buf2[1024]; + /* escape attribute */ + if(myldap_escape(name,buf2,sizeof(buf2))) + return -1; + /* build filter */ + return mysnprintf(buffer,buflen, + "(&%s(%s=%s))", + shadow_filter, + attmap_shadow_uid,buf2); +} + +static void shadow_init(void) +{ + /* set up base */ + if (shadow_base==NULL) + shadow_base=nslcd_cfg->ldc_base; + /* set up scope */ + if (shadow_scope==LDAP_SCOPE_DEFAULT) + shadow_scope=nslcd_cfg->ldc_scope; + /* set up attribute list */ + shadow_attrs[0]=attmap_shadow_uid; + shadow_attrs[1]=attmap_shadow_userPassword; + shadow_attrs[2]=attmap_shadow_shadowLastChange; + shadow_attrs[3]=attmap_shadow_shadowMax; + shadow_attrs[4]=attmap_shadow_shadowMin; + shadow_attrs[5]=attmap_shadow_shadowWarning; + shadow_attrs[6]=attmap_shadow_shadowInactive; + shadow_attrs[7]=attmap_shadow_shadowExpire; + shadow_attrs[8]=attmap_shadow_shadowFlag; + shadow_attrs[9]=NULL; +} + +static long to_date(const char *date,const char *attr) +{ + char buffer[8]; + long value; + char *tmp; + size_t l; + /* do some special handling for date values on AD */ + if (strcasecmp(attr,"pwdLastSet")==0) + { + /* we expect an AD 64-bit datetime value; + we should do date=date/864000000000-134774 + but that causes problems on 32-bit platforms, + first we devide by 1000000000 by stripping the + last 9 digits from the string and going from there */ + l=strlen(date)-9; + if (l>(sizeof(buffer)-1)) + return 0; /* error */ + strncpy(buffer,date,l); + buffer[l]='\0'; + value=strtol(date,&tmp,0); + if ((*date=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"shadow entry contains non-numeric %s value",attr); + return 0; + } + return value/864-134774; + /* note that AD does not have expiry dates but a lastchangeddate + and some value that needs to be added */ + } + value=strtol(date,&tmp,0); + if ((*date=='\0')||(*tmp!='\0')) + { + log_log(LOG_WARNING,"shadow entry contains non-numeric %s value",attr); + return 0; + } + return value; +} + +#ifndef UF_DONT_EXPIRE_PASSWD +#define UF_DONT_EXPIRE_PASSWD 0x10000 +#endif + +#define GET_OPTIONAL_LONG(var,att) \ + tmpvalues=myldap_get_values(entry,attmap_shadow_##att); \ + if ((tmpvalues==NULL)||(tmpvalues[0]==NULL)) \ + var=strtol(default_shadow_##att,NULL,0); \ + else \ + { \ + if (tmpvalues[1]!=NULL) \ + { \ + log_log(LOG_WARNING,"shadow entry %s contains multiple %s values", \ + myldap_get_dn(entry),attmap_shadow_##att); \ + } \ + var=strtol(tmpvalues[0],&tmp,0); \ + if ((*(tmpvalues[0])=='\0')||(*tmp!='\0')) \ + { \ + log_log(LOG_WARNING,"shadow entry %s contains non-numeric %s value", \ + myldap_get_dn(entry),attmap_shadow_##att); \ + return 0; \ + } \ + } + +#define GET_OPTIONAL_DATE(var,att) \ + tmpvalues=myldap_get_values(entry,attmap_shadow_##att); \ + if ((tmpvalues==NULL)||(tmpvalues[0]==NULL)) \ + var=to_date(default_shadow_##att,attmap_shadow_##att); \ + else \ + { \ + if (tmpvalues[1]!=NULL) \ + { \ + log_log(LOG_WARNING,"shadow entry %s contains multiple %s values", \ + myldap_get_dn(entry),attmap_shadow_##att); \ + } \ + var=to_date(tmpvalues[0],attmap_shadow_##att); \ + } + +static int write_shadow(TFILE *fp,MYLDAP_ENTRY *entry,const char *requser) +{ + int32_t tmpint32; + const char *tmparr[2]; + const char **tmpvalues; + char *tmp; + const char **usernames; + const char *passwd; + long lastchangedate; + long mindays; + long maxdays; + long warndays; + long inactdays; + long expiredate; + unsigned long flag; + int i; + /* get username */ + if (requser!=NULL) + { + usernames=tmparr; + usernames[0]=requser; + usernames[1]=NULL; + } + else + { + usernames=myldap_get_values(entry,attmap_shadow_uid); + if ((usernames==NULL)||(usernames[0]==NULL)) + { + log_log(LOG_WARNING,"passwd entry %s does not contain %s value", + myldap_get_dn(entry),attmap_shadow_uid); + return 0; + } + } + /* get password */ + passwd=get_userpassword(entry,attmap_shadow_userPassword); + if (passwd==NULL) + passwd=default_shadow_userPassword; + /* get lastchange date */ + GET_OPTIONAL_DATE(lastchangedate,shadowLastChange); + /* get mindays */ + GET_OPTIONAL_LONG(mindays,shadowMin); + /* get maxdays */ + GET_OPTIONAL_LONG(maxdays,shadowMax); + /* get warndays */ + GET_OPTIONAL_LONG(warndays,shadowWarning); + /* get inactdays */ + GET_OPTIONAL_LONG(inactdays,shadowInactive); + /* get expire date */ + GET_OPTIONAL_LONG(expiredate,shadowExpire); + /* get flag */ + GET_OPTIONAL_LONG(flag,shadowFlag); + /* if we're using AD handle the flag specially */ + if (strcasecmp(attmap_shadow_shadowLastChange,"pwdLastSet")==0) + { + if (flag&UF_DONT_EXPIRE_PASSWD) + maxdays=99999; + flag=0; + } + /* write the entries */ + for (i=0;usernames[i]!=NULL;i++) + { + WRITE_INT32(fp,NSLCD_RESULT_SUCCESS); + WRITE_STRING(fp,usernames[i]); + WRITE_STRING(fp,passwd); + WRITE_INT32(fp,lastchangedate); + WRITE_INT32(fp,mindays); + WRITE_INT32(fp,maxdays); + WRITE_INT32(fp,warndays); + WRITE_INT32(fp,inactdays); + WRITE_INT32(fp,expiredate); + WRITE_INT32(fp,flag); + } + return 0; +} + +NSLCD_HANDLE( + shadow,byname, + char name[256]; + char filter[1024]; + READ_STRING_BUF2(fp,name,sizeof(name));, + log_log(LOG_DEBUG,"nslcd_shadow_byname(%s)",name);, + NSLCD_ACTION_SHADOW_BYNAME, + mkfilter_shadow_byname(name,filter,sizeof(filter)), + write_shadow(fp,entry,name) +) + +NSLCD_HANDLE( + shadow,all, + const char *filter; + /* no parameters to read */, + log_log(LOG_DEBUG,"nslcd_shadow_all()");, + NSLCD_ACTION_SHADOW_ALL, + (filter=shadow_filter,0), + write_shadow(fp,entry,NULL) +) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss-ldapd.conf b/contrib/slapd-modules/nssov/nss-ldapd/nss-ldapd.conf new file mode 100644 index 0000000000..117c6fe0b9 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss-ldapd.conf @@ -0,0 +1,138 @@ +# This is the configuration file for the LDAP nameservice +# switch library's nslcd daemon. It configures the mapping +# between NSS names (see /etc/nsswitch.conf) and LDAP +# information in the directory. +# See the manual page nss-ldapd.conf(5) for more information. + +# The uri pointing to the LDAP server to use for name lookups. +# Mulitple entries may be specified. The address that is used +# here should be resolvable without using LDAP (obviously). +#uri ldap://127.0.0.1/ +#uri ldaps://127.0.0.1/ +#uri ldapi://%2fvar%2frun%2fldapi_sock/ +# Note: %2f encodes the '/' used as directory separator +uri ldap://127.0.0.1/ + +# The LDAP version to use (defaults to 3 +# if supported by client library) +#ldap_version 3 + +# The distinguished name of the search base. +base dc=example,dc=net + +# The distinguished name to bind to the server with. +# Optional: default is to bind anonymously. +#binddn cn=proxyuser,dc=padl,dc=com + +# The credentials to bind with. +# Optional: default is no credentials. +#bindpw secret + +# The default search scope. +#scope sub +#scope one +#scope base + +# Customize certain database lookups. +#base group ou=Groups,dc=example,dc=net +#base passwd ou=People,dc=example,dc=net +#base shadow ou=People,dc=example,dc=net +#scope group onelevel +#scope hosts sub + +# Bind/connect timelimit. +#bind_timelimit 30 + +# Search timelimit. +#timelimit 30 + +# Idle timelimit. nslcd will close connections if the +# server has not been contacted for the number of seconds. +#idle_timelimit 3600 + +# Netscape SDK LDAPS +#ssl on + +# Netscape SDK SSL options +#sslpath /etc/ssl/certs + +# OpenLDAP SSL mechanism +# start_tls mechanism uses the normal LDAP port, LDAPS typically 636 +#ssl start_tls +#ssl on + +# OpenLDAP SSL options +# Require and verify server certificate (yes/no) +# Default is to use libldap's default behavior, which can be configured in +# /etc/openldap/ldap.conf using the TLS_REQCERT setting. The default for +# OpenLDAP 2.0 and earlier is "no", for 2.1 and later is "yes". +#tls_checkpeer yes + +# CA certificates for server certificate verification +# At least one of these are required if tls_checkpeer is "yes" +#tls_cacertdir /etc/ssl/certs +#tls_cacertfile /etc/ssl/ca.cert + +# Seed the PRNG if /dev/urandom is not provided +#tls_randfile /var/run/egd-pool + +# SSL cipher suite +# See man ciphers for syntax +#tls_ciphers TLSv1 + +# Client certificate and key +# Use these, if your server requires client authentication. +#tls_cert +#tls_key + +# NDS mappings +#map group uniqueMember member + +# Mappings for Services for UNIX 3.5 +#filter passwd (objectClass=User) +#map passwd uid msSFU30Name +#map passwd userPassword msSFU30Password +#map passwd homeDirectory msSFU30HomeDirectory +#map passwd homeDirectory msSFUHomeDirectory +#filter shadow (objectClass=User) +#map shadow uid msSFU30Name +#map shadow userPassword msSFU30Password +#filter group (objectClass=Group) +#map group uniqueMember msSFU30PosixMember + +# Mappings for Services for UNIX 2.0 +#filter passwd (objectClass=User) +#map passwd uid msSFUName +#map passwd userPassword msSFUPassword +#map passwd homeDirectory msSFUHomeDirectory +#map passwd cn msSFUName +#filter shadow (objectClass=User) +#map shadow uid msSFUName +#map shadow userPassword msSFUPassword +#map shadow shadowLastChange pwdLastSet +#filter group (objectClass=Group) +#map group uniqueMember posixMember + +# Mappings for Active Directory +#pagesize 1000 +#referrals off +#filter passwd (objectClass=user) +#map passwd uid sAMAccountName +#map passwd homeDirectory unixHomeDirectory +#map passwd gecos name +#filter shadow (objectClass=user) +#map shadow uid sAMAccountName +#map shadow shadowLastChange pwdLastSet +#filter group (objectClass=group) +#map group uniqueMember member + +# Mappings for AIX SecureWay +#filter passwd (objectClass=aixAccount) +#map passwd uid userName +#map passwd userPassword passwordChar +#map passwd uidNumber uid +#map passwd gidNumber gid +#filter group (objectClass=aixAccessGroup) +#map group cn groupName +#map group uniqueMember member +#map group gidNumber gid diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.am new file mode 100644 index 0000000000..0167d20dff --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.am @@ -0,0 +1,50 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +noinst_PROGRAMS = nss_ldap.so + +AM_CPPFLAGS=-I$(top_srcdir) +AM_CFLAGS = -fPIC + +# determin version numbers to use in installed files +NSS_VERS = 2 +NSS_LDAP_NSS_VERSIONED = libnss_ldap.so.$(NSS_VERS) + +nss_ldap_so_SOURCES = common.c common.h prototypes.h \ + ../nslcd.h ../nslcd-common.h \ + ../compat/attrs.h \ + aliases.c ethers.c group.c hosts.c netgroup.c \ + networks.c passwd.c protocols.c rpc.c services.c \ + shadow.c +nss_ldap_so_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_NSS_VERSIONED) \ + -Wl,--version-script,\$(srcdir)/exports.linux +nss_ldap_so_LDADD = @nss_ldap_so_LIBS@ ../common/libtio.a + +EXTRA_DIST = exports.linux + +install-exec-local: install-nss_ldap_so +uninstall-local: uninstall-nss_ldap_so + +# install libnss_ldap.so.2 +install-nss_ldap_so: nss_ldap.so + $(INSTALL_PROGRAM) -D nss_ldap.so $(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED) +uninstall-nss_ldap_so: + -rm -f $(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED) diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in new file mode 100644 index 0000000000..6ffc23af64 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/Makefile.in @@ -0,0 +1,473 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 Luke Howard +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +noinst_PROGRAMS = nss_ldap.so$(EXEEXT) +subdir = nss +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(noinst_PROGRAMS) +am_nss_ldap_so_OBJECTS = common.$(OBJEXT) aliases.$(OBJEXT) \ + ethers.$(OBJEXT) group.$(OBJEXT) hosts.$(OBJEXT) \ + netgroup.$(OBJEXT) networks.$(OBJEXT) passwd.$(OBJEXT) \ + protocols.$(OBJEXT) rpc.$(OBJEXT) services.$(OBJEXT) \ + shadow.$(OBJEXT) +nss_ldap_so_OBJECTS = $(am_nss_ldap_so_OBJECTS) +nss_ldap_so_DEPENDENCIES = ../common/libtio.a +nss_ldap_so_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(nss_ldap_so_LDFLAGS) $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(nss_ldap_so_SOURCES) +DIST_SOURCES = $(nss_ldap_so_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +AM_CPPFLAGS = -I$(top_srcdir) +AM_CFLAGS = -fPIC + +# determin version numbers to use in installed files +NSS_VERS = 2 +NSS_LDAP_NSS_VERSIONED = libnss_ldap.so.$(NSS_VERS) +nss_ldap_so_SOURCES = common.c common.h prototypes.h \ + ../nslcd.h ../nslcd-common.h \ + ../compat/attrs.h \ + aliases.c ethers.c group.c hosts.c netgroup.c \ + networks.c passwd.c protocols.c rpc.c services.c \ + shadow.c + +nss_ldap_so_LDFLAGS = -shared -Wl,-soname,$(NSS_LDAP_NSS_VERSIONED) \ + -Wl,--version-script,\$(srcdir)/exports.linux + +nss_ldap_so_LDADD = @nss_ldap_so_LIBS@ ../common/libtio.a +EXTRA_DIST = exports.linux +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu nss/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu nss/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-noinstPROGRAMS: + -test -z "$(noinst_PROGRAMS)" || rm -f $(noinst_PROGRAMS) +nss_ldap.so$(EXEEXT): $(nss_ldap_so_OBJECTS) $(nss_ldap_so_DEPENDENCIES) + @rm -f nss_ldap.so$(EXEEXT) + $(nss_ldap_so_LINK) $(nss_ldap_so_OBJECTS) $(nss_ldap_so_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aliases.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ethers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hosts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netgroup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocols.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/services.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-generic clean-noinstPROGRAMS mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: install-exec-local + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-local + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ + clean-noinstPROGRAMS ctags distclean distclean-compile \ + distclean-generic distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-data \ + install-data-am install-dvi install-dvi-am install-exec \ + install-exec-am install-exec-local install-html \ + install-html-am install-info install-info-am install-man \ + install-pdf install-pdf-am install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ + tags uninstall uninstall-am uninstall-local + + +install-exec-local: install-nss_ldap_so +uninstall-local: uninstall-nss_ldap_so + +# install libnss_ldap.so.2 +install-nss_ldap_so: nss_ldap.so + $(INSTALL_PROGRAM) -D nss_ldap.so $(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED) +uninstall-nss_ldap_so: + -rm -f $(DESTDIR)$(libdir)/$(NSS_LDAP_NSS_VERSIONED) +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/aliases.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/aliases.c new file mode 100644 index 0000000000..10d557678e --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/aliases.c @@ -0,0 +1,73 @@ +/* + aliases.c - NSS lookup functions for aliases database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" + +static enum nss_status read_aliasent( + TFILE *fp,struct aliasent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32,tmp2int32; + size_t bufptr=0; + /* auto-genereted read code */ + READ_STRING_BUF(fp,result->alias_name); + READ_STRINGLIST_NUM(fp,result->alias_members,result->alias_members_len); + /* fill in remaining gaps in struct */ + result->alias_local=0; + /* we're done */ + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getaliasbyname_r( + const char *name,struct aliasent *result, + char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_ALIAS_BYNAME, + name, + read_aliasent(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *aliasentfp; + +enum nss_status _nss_ldap_setaliasent(void) +{ + NSS_SETENT(aliasentfp); +} + +enum nss_status _nss_ldap_getaliasent_r(struct aliasent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(aliasentfp,NSLCD_ACTION_ALIAS_ALL, + read_aliasent(aliasentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endaliasent(void) +{ + NSS_ENDENT(aliasentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/common.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/common.c new file mode 100644 index 0000000000..223cbfa93e --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/common.c @@ -0,0 +1,85 @@ +/* + common.c - common functions for NSS lookups + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "nslcd.h" +#include "common.h" +#include "common/tio.h" + +/* buffer sizes for I/O */ +#define READBUFFER_MINSIZE 1024 +#define READBUFFER_MAXSIZE 32*1024 +#define WRITEBUFFER_MINSIZE 32 +#define WRITEBUFFER_MAXSIZE 32 + +/* returns a socket to the server or NULL on error (see errno), + socket should be closed with fclose() */ +TFILE *nslcd_client_open() +{ + int sock; + struct sockaddr_un addr; + struct timeval readtimeout,writetimeout; + TFILE *fp; + /* create a socket */ + if ( (sock=socket(PF_UNIX,SOCK_STREAM,0))<0 ) + return NULL; + /* create socket address structure */ + memset(&addr,0,sizeof(struct sockaddr_un)); + addr.sun_family=AF_UNIX; + strncpy(addr.sun_path,NSLCD_SOCKET,sizeof(addr.sun_path)); + addr.sun_path[sizeof(addr.sun_path)-1]='\0'; + /* connect to the socket */ + if (connect(sock,(struct sockaddr *)&addr,(socklen_t)sizeof(struct sockaddr_un))<0) + { + (void)close(sock); + return NULL; + } + /* set the timeouts */ + readtimeout.tv_sec=20; /* looking up stuff may take some time */ + readtimeout.tv_usec=0; + writetimeout.tv_sec=10; /* nslcd could be loaded with requests */ + writetimeout.tv_usec=0; + /* create a stream object */ + if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout, + READBUFFER_MINSIZE,READBUFFER_MAXSIZE, + WRITEBUFFER_MINSIZE,WRITEBUFFER_MAXSIZE))==NULL) + { + (void)close(sock); + return NULL; + } + /* return the stream */ + return fp; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/common.h b/contrib/slapd-modules/nssov/nss-ldapd/nss/common.h new file mode 100644 index 0000000000..ed37ec39ac --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/common.h @@ -0,0 +1,211 @@ +/* + common.h - common functions for NSS lookups + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _NSS_COMMON_H +#define _NSS_COMMON_H 1 + +#include +#include + +#include "nslcd.h" +#include "nslcd-common.h" +#include "compat/attrs.h" +#include "common/tio.h" + +/* returns a socket to the server or NULL on error (see errno), + socket should be closed with tio_close() */ +TFILE *nslcd_client_open(void) + MUST_USE; + +/* These are macors for performing common operations in the nslcd + request/response protocol, they are an extension for client + applications to the macros defined in nslcd-common.h. */ + +/* Open a client socket. */ +#define OPEN_SOCK(fp) \ + if ((fp=nslcd_client_open())==NULL) \ + { ERROR_OUT_OPENERROR } + +/* Write a request header with a request code. */ +#define WRITE_REQUEST(fp,req) \ + WRITE_INT32(fp,(int32_t)NSLCD_VERSION) \ + WRITE_INT32(fp,(int32_t)req) + +/* Read a response header and check that the returned request + code equals the expected code. */ +#define READ_RESPONSEHEADER(fp,req) \ + READ_TYPE(fp,tmpint32,int32_t); \ + if (tmpint32!=(int32_t)NSLCD_VERSION) \ + { ERROR_OUT_READERROR(fp) } \ + READ_TYPE(fp,tmpint32,int32_t); \ + if (tmpint32!=(int32_t)(req)) \ + { ERROR_OUT_READERROR(fp) } + +/* Read the response code (the result code of the query) from + the stream. */ +#define READ_RESPONSE_CODE(fp) \ + READ_TYPE(fp,tmpint32,int32_t); \ + if (tmpint32!=(int32_t)NSLCD_RESULT_SUCCESS) \ + { ERROR_OUT_NOSUCCESS(fp,tmpint32) } + +/* These are macros for handling read and write problems, they are + NSS specific due to the return code so are defined here. They + genrally close the open file, set an error code and return with + an error status. */ + +/* Macro is called to handle errors in opening a client connection. */ +#define ERROR_OUT_OPENERROR \ + *errnop=ENOENT; \ + return (errno==EAGAIN)?NSS_STATUS_TRYAGAIN:NSS_STATUS_UNAVAIL; + +/* Macro is called to handle errors on read operations. */ +#define ERROR_OUT_READERROR(fp) \ + (void)tio_close(fp); \ + fp=NULL; \ + *errnop=ENOENT; \ + return NSS_STATUS_UNAVAIL; + +/* Macro is called to handle problems with too small a buffer. + This triggers the caller to call the function with a larger + buffer (see NSS_GETENT below). */ +#define ERROR_OUT_BUFERROR(fp) \ + *errnop=ERANGE; \ + return NSS_STATUS_TRYAGAIN; + +/* This macro is called if there was a problem with a write + operation. */ +#define ERROR_OUT_WRITEERROR(fp) \ + ERROR_OUT_READERROR(fp) + +/* This macro is called if the read status code is not + NSLCD_RESULT_SUCCESS. */ +#define ERROR_OUT_NOSUCCESS(fp,retv) \ + (void)tio_close(fp); \ + fp=NULL; \ + return NSS_STATUS_NOTFOUND; + +/* The following macros to automatically generate get..byname(), + get..bynumber(), setent(), getent() and endent() function + bodies. These functions have very common code so this can + easily be reused. */ + +/* This is a generic get..by..() generation macro. The action + parameter is the NSLCD_ACTION_.. action, the param is the + operation for writing the parameter and readfn is the function + name for reading a single result entry. The function is assumed + to have result, buffer, buflen and errnop parameters that define + the result structure, the user buffer with length and the + errno to return. This macro should be called through some of + the customized ones below. */ +#define NSS_BYGEN(action,writefn,readfn) \ + TFILE *fp; \ + int32_t tmpint32; \ + enum nss_status retv; \ + /* open socket and write request */ \ + OPEN_SOCK(fp); \ + WRITE_REQUEST(fp,action); \ + writefn; \ + WRITE_FLUSH(fp); \ + /* read response header */ \ + READ_RESPONSEHEADER(fp,action); \ + /* read response */ \ + READ_RESPONSE_CODE(fp); \ + retv=readfn; \ + /* close socket and we're done */ \ + if ((retv==NSS_STATUS_SUCCESS)||(retv==NSS_STATUS_TRYAGAIN)) \ + (void)tio_close(fp); \ + return retv; + +/* This macro can be used to generate a get..byname() function + body. */ +#define NSS_BYNAME(action,name,readfn) \ + NSS_BYGEN(action,WRITE_STRING(fp,name),readfn) + +/* This macro can be used to generate a get..by..() function + body where the value that is the key has the specified type. */ +#define NSS_BYTYPE(action,val,type,readfn) \ + NSS_BYGEN(action,WRITE_TYPE(fp,val,type),readfn) + +/* This macro can be used to generate a get..by..() function + body where the value should be passed as an int32_t. */ +#define NSS_BYINT32(action,val,readfn) \ + NSS_BYGEN(action,WRITE_INT32(fp,val),readfn) + +/* This macro generates a simple setent() function body. A stream + is opened, a request is written and a check is done for + a response header. */ +#define NSS_SETENT(fp) \ + if (fp!=NULL) \ + { \ + (void)tio_close(fp); \ + fp=NULL; \ + } \ + return NSS_STATUS_SUCCESS; + +/* This macro generates a getent() function body. A single entry + is read with the readfn() function. */ +#define NSS_GETENT(fp,action,readfn) \ + int32_t tmpint32; \ + enum nss_status retv; \ + /* check that we have a valid file descriptor */ \ + if (fp==NULL) \ + { \ + /* open a new stream and write the request */ \ + OPEN_SOCK(fp); \ + WRITE_REQUEST(fp,action); \ + WRITE_FLUSH(fp); \ + /* read response header */ \ + READ_RESPONSEHEADER(fp,action); \ + } \ + /* prepare for buffer errors */ \ + tio_mark(fp); \ + /* read a response */ \ + READ_RESPONSE_CODE(fp); \ + retv=readfn; \ + /* check read result */ \ + if (retv==NSS_STATUS_TRYAGAIN) \ + { \ + /* if we have a full buffer try to reset the stream */ \ + if (tio_reset(fp)) \ + { \ + tio_close(fp); \ + fp=NULL; \ + /* fail with permanent error to prevent retries */ \ + *errnop=EINVAL; \ + return NSS_STATUS_UNAVAIL; \ + } \ + } \ + else if (retv!=NSS_STATUS_SUCCESS) \ + fp=NULL; /* file should be closed by now */ \ + return retv; + +/* This macro generates a endent() function body. This just closes + the stream. */ +#define NSS_ENDENT(fp) \ + if (fp!=NULL) \ + { \ + (void)tio_close(fp); \ + fp=NULL; \ + } \ + return NSS_STATUS_SUCCESS; + +#endif /* not _NSS_COMMON_H */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/ethers.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/ethers.c new file mode 100644 index 0000000000..bf9ebb8415 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/ethers.c @@ -0,0 +1,83 @@ +/* + ethers.c - NSS lookup functions for ethers database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_etherent( + TFILE *fp,struct etherent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->e_name); + READ_TYPE(fp,result->e_addr,uint8_t[6]); + return NSS_STATUS_SUCCESS; +} + +/* map a hostname to the corresponding ethernet address */ +enum nss_status _nss_ldap_gethostton_r( + const char *name,struct etherent *result, + char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_ETHER_BYNAME, + name, + read_etherent(fp,result,buffer,buflen,errnop)); +} + +/* map an ethernet address to the corresponding hostname */ +enum nss_status _nss_ldap_getntohost_r( + const struct ether_addr *addr,struct etherent *result, + char *buffer,size_t buflen,int *errnop) +{ + NSS_BYTYPE(NSLCD_ACTION_ETHER_BYETHER, + *addr,uint8_t[6], + read_etherent(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *etherentfp; + +enum nss_status _nss_ldap_setetherent(int UNUSED(stayopen)) +{ + NSS_SETENT(etherentfp); +} + +enum nss_status _nss_ldap_getetherent_r( + struct etherent *result, + char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(etherentfp,NSLCD_ACTION_ETHER_ALL, + read_etherent(etherentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endetherent(void) +{ + NSS_ENDENT(etherentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/exports.linux b/contrib/slapd-modules/nssov/nss-ldapd/nss/exports.linux new file mode 100644 index 0000000000..62c031399f --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/exports.linux @@ -0,0 +1,85 @@ +EXPORTED { + + # published NSS service functions + global: + + # aliases - mail aliases + _nss_ldap_getaliasbyname_r; + _nss_ldap_setaliasent; + _nss_ldap_getaliasent_r; + _nss_ldap_endaliasent; + + # ethers - ethernet numbers + _nss_ldap_gethostton_r; + _nss_ldap_getntohost_r; + _nss_ldap_setetherent; + _nss_ldap_getetherent_r; + _nss_ldap_endetherent; + + # group - groups of users + _nss_ldap_getgrnam_r; + _nss_ldap_getgrgid_r; + _nss_ldap_initgroups_dyn; + _nss_ldap_setgrent; + _nss_ldap_getgrent_r; + _nss_ldap_endgrent; + + # hosts - host names and numbers + _nss_ldap_gethostbyname_r; + _nss_ldap_gethostbyname2_r; + _nss_ldap_gethostbyaddr_r; + _nss_ldap_sethostent; + _nss_ldap_gethostent_r; + _nss_ldap_endhostent; + + # netgroup - list of host and users + _nss_ldap_setnetgrent; + _nss_ldap_getnetgrent_r; + _nss_ldap_endnetgrent; + + # networks - network names and numbers + _nss_ldap_getnetbyname_r; + _nss_ldap_getnetbyaddr_r; + _nss_ldap_setnetent; + _nss_ldap_getnetent_r; + _nss_ldap_endnetent; + + # passwd - user database and passwords + _nss_ldap_getpwnam_r; + _nss_ldap_getpwuid_r; + _nss_ldap_setpwent; + _nss_ldap_getpwent_r; + _nss_ldap_endpwent; + + # protocols - network protocols + _nss_ldap_getprotobyname_r; + _nss_ldap_getprotobynumber_r; + _nss_ldap_setprotoent; + _nss_ldap_getprotoent_r; + _nss_ldap_endprotoent; + + # rpc - remote procedure call names and numbers + _nss_ldap_getrpcbyname_r; + _nss_ldap_getrpcbynumber_r; + _nss_ldap_setrpcent; + _nss_ldap_getrpcent_r; + _nss_ldap_endrpcent; + + # services - network services + _nss_ldap_getservbyname_r; + _nss_ldap_getservbyport_r; + _nss_ldap_setservent; + _nss_ldap_getservent_r; + _nss_ldap_endservent; + + # shadow - extended user information + _nss_ldap_getspnam_r; + _nss_ldap_setspent; + _nss_ldap_getspent_r; + _nss_ldap_endspent; + + # everything else should not be exported + local: + *; + +}; diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/group.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/group.c new file mode 100644 index 0000000000..1571e8fc8b --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/group.c @@ -0,0 +1,159 @@ +/* + group.c - NSS lookup functions for group database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_group( + TFILE *fp,struct group *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->gr_name); + READ_STRING_BUF(fp,result->gr_passwd); + READ_TYPE(fp,result->gr_gid,gid_t); + READ_STRINGLIST_NULLTERM(fp,result->gr_mem); + return NSS_STATUS_SUCCESS; +} + +/* read all group entries from the stream and add + gids of these groups to the list */ +static enum nss_status read_gids( + TFILE *fp,gid_t skipgroup,long int *start,long int *size, + gid_t **groupsp,long int limit,int *errnop) +{ + int32_t res=(int32_t)NSLCD_RESULT_SUCCESS; + int32_t tmpint32,tmp2int32,tmp3int32; + gid_t gid; + gid_t *newgroups; + long int newsize; + /* loop over results */ + while (res==(int32_t)NSLCD_RESULT_SUCCESS) + { + /* skip group name */ + SKIP_STRING(fp); + /* skip passwd entry */ + SKIP_STRING(fp); + /* read gid */ + READ_TYPE(fp,gid,gid_t); + /* skip members */ + SKIP_STRINGLIST(fp); + /* only add the group to the list if it is not the specified group */ + if (gid!=skipgroup) + { + /* check if we reached the limit */ + if ( (limit>0) && (*start>=limit) ) + return NSS_STATUS_TRYAGAIN; + /* check if our buffer is large enough */ + if ((*start)>=(*size)) + { + /* for some reason Glibc expects us to grow the array (completely + different from all other NSS functions) */ + /* calculate new size */ + newsize=2*(*size); + if ( (limit>0) && (*start>=limit) ) + newsize=limit; + /* allocate new memory */ + newgroups=realloc(*groupsp,newsize*sizeof(gid_t)); + if (newgroups==NULL) + return NSS_STATUS_TRYAGAIN; + *groupsp=newgroups; + *size=newsize; + } + /* add gid to list */ + (*groupsp)[(*start)++]=gid; + } + /* read next response code + (don't bail out on not success since we just want to build + up a list) */ + READ_TYPE(fp,res,int32_t); + } + /* return the proper status code */ + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getgrnam_r(const char *name,struct group *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_GROUP_BYNAME, + name, + read_group(fp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYTYPE(NSLCD_ACTION_GROUP_BYGID, + gid,gid_t, + read_group(fp,result,buffer,buflen,errnop)); +} + +/* this function returns a list of groups, documentation for the + interface is scarce (any pointers are welcome) but this is + what is assumed the parameters mean: + + user IN - the user name to find groups for + skipgroup IN - a group to not include in the list + *start IN/OUT - where to write in the array, is incremented + *size IN/OUT - the size of the supplied array (gid_t entries, not bytes) + **groupsp IN/OUT - pointer to the array of returned groupids + limit IN - the maxium size of the array + *errnop OUT - for returning errno + + This function cannot grow the array if it becomes too large + (and will return NSS_STATUS_TRYAGAIN on buffer problem) + because it has no way of free()ing the buffer. +*/ +enum nss_status _nss_ldap_initgroups_dyn( + const char *user,gid_t skipgroup,long int *start, + long int *size,gid_t **groupsp,long int limit,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_GROUP_BYMEMBER, + user, + read_gids(fp,skipgroup,start,size,groupsp,limit,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *grentfp; + +enum nss_status _nss_ldap_setgrent(int UNUSED(stayopen)) +{ + NSS_SETENT(grentfp); +} + +enum nss_status _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(grentfp,NSLCD_ACTION_GROUP_ALL, + read_group(grentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endgrent(void) +{ + NSS_ENDENT(grentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/hosts.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/hosts.c new file mode 100644 index 0000000000..a73b83b2b2 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/hosts.c @@ -0,0 +1,233 @@ +/* + hosts.c - NSS lookup functions for hosts database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +/* Redifine some ERROR_OUT macros as we also want to set h_errnop. */ + +#undef ERROR_OUT_OPENERROR +#define ERROR_OUT_OPENERROR \ + *errnop=ENOENT; \ + *h_errnop=HOST_NOT_FOUND; \ + return (errno==EAGAIN)?NSS_STATUS_TRYAGAIN:NSS_STATUS_UNAVAIL; + +#undef ERROR_OUT_READERROR +#define ERROR_OUT_READERROR(fp) \ + (void)tio_close(fp); \ + fp=NULL; \ + *errnop=ENOENT; \ + *h_errnop=NO_RECOVERY; \ + return NSS_STATUS_UNAVAIL; + +#undef ERROR_OUT_BUFERROR +#define ERROR_OUT_BUFERROR(fp) \ + (void)tio_close(fp); \ + fp=NULL; \ + *errnop=ERANGE; \ + *h_errnop=TRY_AGAIN; \ + return NSS_STATUS_TRYAGAIN; + +#undef ERROR_OUT_WRITEERROR +#define ERROR_OUT_WRITEERROR(fp) \ + ERROR_OUT_READERROR(fp) + +/* read a single host entry from the stream, filtering on the + specified address family, result is stored in result + it will an empty entry if no addresses in the address family + were available */ +static enum nss_status read_hostent( + TFILE *fp,int af,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int32_t numaddr; + int i; + int readaf; + size_t bufptr=0; + /* read the host entry */ + READ_STRING_BUF(fp,result->h_name); + READ_STRINGLIST_NULLTERM(fp,result->h_aliases); + result->h_addrtype=af; + result->h_length=0; + /* read number of addresses to follow */ + READ_INT32(fp,numaddr); + /* allocate memory for array */ + /* Note: this may allocate too much memory (e.g. also for + address records of other address families) but + this is a simple way to do it */ + BUF_ALLOC(fp,result->h_addr_list,char *,numaddr+1); + /* go through the address list and filter on af */ + i=0; + while (--numaddr>=0) + { + /* read address family and size */ + READ_INT32(fp,readaf); + READ_INT32(fp,tmp2int32); + if (readaf==af) + { + /* read the address */ + result->h_length=tmp2int32; + READ_BUF(fp,result->h_addr_list[i++],tmp2int32); + } + else + { + SKIP(fp,tmpint32); + } + } + /* null-terminate address list */ + result->h_addr_list[i]=NULL; + return NSS_STATUS_SUCCESS; +} + +/* this is a wrapper around read_hostent() that does error handling + if the read address list does not contain any addresses for the + specified address familiy */ +static enum nss_status read_hostent_erronempty( + TFILE *fp,int af,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + enum nss_status retv; + retv=read_hostent(fp,af,result,buffer,buflen,errnop,h_errnop); + /* check result */ + if (retv!=NSS_STATUS_SUCCESS) + return retv; + /* check empty address list + (note that we cannot do this in the read_hostent() function as closing + the socket there will cause problems with the {set,get,end}ent() functions + below) + */ + if (result->h_addr_list[0]==NULL) + { + *errnop=ENOENT; + *h_errnop=NO_ADDRESS; + (void)tio_close(fp); + return NSS_STATUS_NOTFOUND; + } + return NSS_STATUS_SUCCESS; +} + +/* this is a wrapper around read_hostent() that skips to the + next address if the address list does not contain any addresses for the + specified address familiy */ +static enum nss_status read_hostent_nextonempty( + TFILE *fp,int af,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + int32_t tmpint32; + enum nss_status retv; + /* check until we read an non-empty entry */ + do + { + /* read a host entry */ + retv=read_hostent(fp,af,result,buffer,buflen,errnop,h_errnop); + /* check result */ + if (retv!=NSS_STATUS_SUCCESS) + return retv; + /* skip to the next entry if we read an empty address */ + if (result->h_addr_list[0]==NULL) + { + retv=NSS_STATUS_NOTFOUND; + READ_RESPONSE_CODE(fp); + } + /* do another loop run if we read an empty address */ + } + while (retv!=NSS_STATUS_SUCCESS); + return NSS_STATUS_SUCCESS; +} + +/* this function looks up a single host entry and returns all the addresses + associated with the host in a single address familiy + name - IN - hostname to lookup + af - IN - address familty to present results for + result - OUT - entry found + buffer,buflen - OUT - buffer to store allocated stuff on + errnop,h_errnop - OUT - for reporting errors */ +enum nss_status _nss_ldap_gethostbyname2_r( + const char *name,int af,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_BYNAME(NSLCD_ACTION_HOST_BYNAME, + name, + read_hostent_erronempty(fp,af,result,buffer,buflen,errnop,h_errnop)); +} + +/* this function just calls the gethostbyname2() variant with the address + familiy set */ +enum nss_status _nss_ldap_gethostbyname_r( + const char *name,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + return _nss_ldap_gethostbyname2_r(name,AF_INET,result,buffer,buflen,errnop,h_errnop); +} + +/* write an address value */ +#define WRITE_ADDRESS(fp,af,len,addr) \ + WRITE_INT32(fp,af); \ + WRITE_INT32(fp,len); \ + WRITE(fp,addr,len); + +/* this function looks up a single host entry and returns all the addresses + associated with the host in a single address familiy + addr - IN - the address to look up + len - IN - the size of the addr struct + af - IN - address familty the address is specified as + result - OUT - entry found + buffer,buflen - OUT - buffer to store allocated stuff on + errnop,h_errnop - OUT - for reporting errors */ +enum nss_status _nss_ldap_gethostbyaddr_r( + const void *addr,socklen_t len,int af,struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_BYGEN(NSLCD_ACTION_HOST_BYADDR, + WRITE_ADDRESS(fp,af,len,addr), + read_hostent_erronempty(fp,af,result,buffer,buflen,errnop,h_errnop)) +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *hostentfp; + +enum nss_status _nss_ldap_sethostent(int UNUSED(stayopen)) +{ + NSS_SETENT(hostentfp); +} + +/* this function only returns addresses of the AF_INET address family */ +enum nss_status _nss_ldap_gethostent_r( + struct hostent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_GETENT(hostentfp,NSLCD_ACTION_HOST_ALL, + read_hostent_nextonempty(hostentfp,AF_INET,result,buffer,buflen,errnop,h_errnop)); +} + +enum nss_status _nss_ldap_endhostent(void) +{ + NSS_ENDENT(hostentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/netgroup.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/netgroup.c new file mode 100644 index 0000000000..9d82f04f36 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/netgroup.c @@ -0,0 +1,123 @@ +/* + netgroup.c - NSS lookup functions for netgroup entries + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +/* we redefine this here because we need to return NSS_STATUS_RETURN + instead of NSS_STATUS_NOTFOUND */ +#undef ERROR_OUT_NOSUCCESS +#define ERROR_OUT_NOSUCCESS(fp,retv) \ + (void)tio_close(fp); \ + fp=NULL; \ + return NSS_STATUS_RETURN; + +/* function for reading a single result entry */ +static enum nss_status read_netgrent( + TFILE *fp,struct __netgrent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32; + int type; + size_t bufptr=0; + /* read netgroup type */ + READ_INT32(fp,type); + if (type==NETGROUP_TYPE_NETGROUP) + { + /* the response is a reference to another netgroup */ + result->type=group_val; + READ_STRING_BUF(fp,result->val.group); + } + else if (type==NETGROUP_TYPE_TRIPLE) + { + /* the response is a host/user/domain triple */ + result->type=triple_val; + /* read host and revert to NULL on empty string */ + READ_STRING_BUF(fp,result->val.triple.host); + if (result->val.triple.host[0]=='\0') + { + result->val.triple.host=NULL; + bufptr--; /* free unused space */ + } + /* read user and revert to NULL on empty string */ + READ_STRING_BUF(fp,result->val.triple.user); + if (result->val.triple.user[0]=='\0') + { + result->val.triple.user=NULL; + bufptr--; /* free unused space */ + } + /* read domain and revert to NULL on empty string */ + READ_STRING_BUF(fp,result->val.triple.domain); + if (result->val.triple.domain[0]=='\0') + { + result->val.triple.domain=NULL; + bufptr--; /* free unused space */ + } + } + else + return NSS_STATUS_UNAVAIL; + /* we're done */ + return NSS_STATUS_SUCCESS; +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *netgrentfp; + +enum nss_status _nss_ldap_setnetgrent(const char *group,struct __netgrent UNUSED(*result)) +{ + /* we cannot use NSS_SETENT() here because we have a parameter that is only + available in this function */ + int32_t tmpint32; + int errnocp; + int *errnop; + errnop=&errnocp; + /* check parameter */ + if ((group==NULL)||(group[0]=='\0')) + return NSS_STATUS_UNAVAIL; + /* open a new stream and write the request */ + OPEN_SOCK(netgrentfp); + WRITE_REQUEST(netgrentfp,NSLCD_ACTION_NETGROUP_BYNAME); + WRITE_STRING(netgrentfp,group); + WRITE_FLUSH(netgrentfp); + /* read response header */ + READ_RESPONSEHEADER(netgrentfp,NSLCD_ACTION_NETGROUP_BYNAME); + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getnetgrent_r(struct __netgrent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(netgrentfp,NSLCD_ACTION_NETGROUP_BYNAME, + read_netgrent(netgrentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endnetgrent(struct __netgrent UNUSED(* result)) +{ + NSS_ENDENT(netgrentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/networks.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/networks.c new file mode 100644 index 0000000000..6b3dcd1d83 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/networks.c @@ -0,0 +1,142 @@ +/* + networks.c - NSS lookup functions for networks database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +/* Redifine some ERROR_OUT macros as we also want to set h_errnop. */ + +#undef ERROR_OUT_OPENERROR +#define ERROR_OUT_OPENERROR \ + *errnop=ENOENT; \ + *h_errnop=HOST_NOT_FOUND; \ + return (errno==EAGAIN)?NSS_STATUS_TRYAGAIN:NSS_STATUS_UNAVAIL; + +#undef ERROR_OUT_READERROR +#define ERROR_OUT_READERROR(fp) \ + (void)tio_close(fp); \ + fp=NULL; \ + *errnop=ENOENT; \ + *h_errnop=NO_RECOVERY; \ + return NSS_STATUS_UNAVAIL; + +#undef ERROR_OUT_BUFERROR +#define ERROR_OUT_BUFERROR(fp) \ + (void)tio_close(fp); \ + fp=NULL; \ + *errnop=ERANGE; \ + *h_errnop=TRY_AGAIN; \ + return NSS_STATUS_TRYAGAIN; + +#undef ERROR_OUT_WRITEERROR +#define ERROR_OUT_WRITEERROR(fp) \ + ERROR_OUT_READERROR(fp) + +/* read a single network entry from the stream, ignoring entries + that are not AF_INET (IPv4), result is stored in result */ +static enum nss_status read_netent( + TFILE *fp,struct netent *result, + char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int32_t numaddr,i; + int readaf; + size_t bufptr=0; + enum nss_status retv=NSS_STATUS_NOTFOUND; + /* read the network entry */ + READ_STRING_BUF(fp,result->n_name); + READ_STRINGLIST_NULLTERM(fp,result->n_aliases); + result->n_addrtype=AF_INET; + /* read number of addresses to follow */ + READ_TYPE(fp,numaddr,int32_t); + /* go through the address list and filter on af */ + i=0; + while (--numaddr>=0) + { + /* read address family and size */ + READ_INT32(fp,readaf); + READ_INT32(fp,tmp2int32); + if ((readaf==AF_INET)&&(tmp2int32==4)) + { + /* read address and translate to host byte order */ + READ_TYPE(fp,tmpint32,int32_t); + result->n_net=ntohl((uint32_t)tmpint32); + /* signal that we've read a proper entry */ + retv=NSS_STATUS_SUCCESS; + /* don't return here to not upset the stream */ + } + else + { + /* skip unsupported address families */ + SKIP(fp,tmpint32); + } + } + return retv; +} + +enum nss_status _nss_ldap_getnetbyname_r(const char *name,struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_BYNAME(NSLCD_ACTION_NETWORK_BYNAME, + name, + read_netent(fp,result,buffer,buflen,errnop,h_errnop)); +} + +/* write an address value */ +#define WRITE_ADDRESS(fp,af,len,addr) \ + WRITE_INT32(fp,af); \ + WRITE_INT32(fp,len); \ + WRITE(fp,addr,len); + +/* Note: the af parameter is ignored and is assumed to be AF_INET */ +/* TODO: implement handling of af parameter */ +enum nss_status _nss_ldap_getnetbyaddr_r(uint32_t addr,int UNUSED(af),struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_BYGEN(NSLCD_ACTION_NETWORK_BYADDR, + WRITE_ADDRESS(fp,AF_INET,4,&addr), + read_netent(fp,result,buffer,buflen,errnop,h_errnop)) +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *netentfp; + +enum nss_status _nss_ldap_setnetent(int UNUSED(stayopen)) +{ + NSS_SETENT(netentfp); +} + +enum nss_status _nss_ldap_getnetent_r(struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop) +{ + NSS_GETENT(netentfp,NSLCD_ACTION_NETWORK_ALL, + read_netent(netentfp,result,buffer,buflen,errnop,h_errnop)); +} + +enum nss_status _nss_ldap_endnetent(void) +{ + NSS_ENDENT(netentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/passwd.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/passwd.c new file mode 100644 index 0000000000..29d70fceec --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/passwd.c @@ -0,0 +1,83 @@ +/* + passwd.c - NSS lookup functions for passwd database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_passwd( + TFILE *fp,struct passwd *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->pw_name); + READ_STRING_BUF(fp,result->pw_passwd); + READ_TYPE(fp,result->pw_uid,uid_t); + READ_TYPE(fp,result->pw_gid,gid_t); + READ_STRING_BUF(fp,result->pw_gecos); + READ_STRING_BUF(fp,result->pw_dir); + READ_STRING_BUF(fp,result->pw_shell); + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getpwnam_r(const char *name,struct passwd *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_PASSWD_BYNAME, + name, + read_passwd(fp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYTYPE(NSLCD_ACTION_PASSWD_BYUID, + uid,uid_t, + read_passwd(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *pwentfp; + +/* open a connection to the nslcd and write the request */ +enum nss_status _nss_ldap_setpwent(int UNUSED(stayopen)) +{ + NSS_SETENT(pwentfp); +} + +/* read password data from an opened stream */ +enum nss_status _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(pwentfp,NSLCD_ACTION_PASSWD_ALL, + read_passwd(pwentfp,result,buffer,buflen,errnop)); +} + +/* close the stream opened with setpwent() above */ +enum nss_status _nss_ldap_endpwent(void) +{ + NSS_ENDENT(pwentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/protocols.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/protocols.c new file mode 100644 index 0000000000..855c4adf80 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/protocols.c @@ -0,0 +1,76 @@ +/* + protocols.c - NSS lookup functions for protocol database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_protoent( + TFILE *fp,struct protoent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->p_name); + READ_STRINGLIST_NULLTERM(fp,result->p_aliases); + READ_INT32(fp,result->p_proto); + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getprotobyname_r(const char *name,struct protoent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_PROTOCOL_BYNAME, + name, + read_protoent(fp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_getprotobynumber_r(int number,struct protoent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYINT32(NSLCD_ACTION_PROTOCOL_BYNUMBER, + number, + read_protoent(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *protoentfp; + +enum nss_status _nss_ldap_setprotoent(int UNUSED(stayopen)) +{ + NSS_SETENT(protoentfp); +} + +enum nss_status _nss_ldap_getprotoent_r(struct protoent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(protoentfp,NSLCD_ACTION_PROTOCOL_ALL, + read_protoent(protoentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endprotoent(void) +{ + NSS_ENDENT(protoentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/prototypes.h b/contrib/slapd-modules/nssov/nss-ldapd/nss/prototypes.h new file mode 100644 index 0000000000..6d4335cc35 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/prototypes.h @@ -0,0 +1,169 @@ +/* + prototypes.h - all functions exported by the NSS library + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#ifndef _NSS_EXPORTS_H +#define _NSS_EXPORTS_H 1 + +#include +#include +#include +#include +#include +#include +#include +#include + +/* We define struct etherent here because it does not seem to + be defined in any publicly available header file exposed + by glibc. This is taken from include/netinet/ether.h + of the glibc (2.3.6) source tarball. */ +struct etherent +{ + const char *e_name; + struct ether_addr e_addr; +}; + +/* We also define struct __netgrent because it's definition is + not publically available. This is taken from inet/netgroup.h + of the glibc (2.3.6) source tarball. + The first part of the struct is the only part that is modified + by the getnetgrent() function, all the other fields are not + touched at all. */ +struct __netgrent +{ + enum { triple_val, group_val } type; + union + { + struct + { + const char *host; + const char *user; + const char *domain; + } triple; + const char *group; + } val; + /* the following stuff is used by some NSS services + but not by ours (it's not completely clear how these + are shared between different services) or is used + by our caller */ + char *data; + size_t data_size; + union + { + char *cursor; + unsigned long int position; + } insertedname; /* added name to union to avoid warning */ + int first; + struct name_list *known_groups; + struct name_list *needed_groups; + void *nip; /* changed from `service_user *nip' */ +}; + +/* + These are prototypes for functions exported from the ldap NSS module. + For more complete definitions of these functions check the GLIBC + documentation. + + Other services than those mentioned here are currently not implemented. + + These definitions partially came from examining the GLIBC source code + as no complete documentation of the NSS interface is available. + This however is a useful pointer: + http://www.gnu.org/software/libc/manual/html_node/Name-Service-Switch.html +*/ + +/* aliases - mail aliases */ +enum nss_status _nss_ldap_getaliasbyname_r(const char *name,struct aliasent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setaliasent(void); +enum nss_status _nss_ldap_getaliasent_r(struct aliasent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endaliasent(void); + +/* ethers - ethernet numbers */ +enum nss_status _nss_ldap_gethostton_r(const char *name,struct etherent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getntohost_r(const struct ether_addr *addr,struct etherent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setetherent(int stayopen); +enum nss_status _nss_ldap_getetherent_r(struct etherent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endetherent(void); + +/* group - groups of users */ +enum nss_status _nss_ldap_getgrnam_r(const char *name,struct group *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getgrgid_r(gid_t gid,struct group *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_initgroups_dyn(const char *user,gid_t group,long int *start,long int *size,gid_t **groupsp,long int limit,int *errnop); +enum nss_status _nss_ldap_setgrent(int stayopen); +enum nss_status _nss_ldap_getgrent_r(struct group *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endgrent(void); + +/* hosts - host names and numbers */ +enum nss_status _nss_ldap_gethostbyname_r(const char *name,struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_gethostbyname2_r(const char *name,int af,struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_gethostbyaddr_r(const void *addr,socklen_t len,int af,struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_sethostent(int stayopen); +enum nss_status _nss_ldap_gethostent_r(struct hostent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_endhostent(void); + +/* netgroup - list of host and users */ +enum nss_status _nss_ldap_setnetgrent(const char *group,struct __netgrent *result); +enum nss_status _nss_ldap_getnetgrent_r(struct __netgrent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endnetgrent(struct __netgrent *result); + +/* networks - network names and numbers */ +enum nss_status _nss_ldap_getnetbyname_r(const char *name,struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_getnetbyaddr_r(uint32_t addr,int af,struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_setnetent(int stayopen); +enum nss_status _nss_ldap_getnetent_r(struct netent *result,char *buffer,size_t buflen,int *errnop,int *h_errnop); +enum nss_status _nss_ldap_endnetent(void); + +/* passwd - user database and passwords */ +enum nss_status _nss_ldap_getpwnam_r(const char *name,struct passwd *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getpwuid_r(uid_t uid,struct passwd *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setpwent(int stayopen); +enum nss_status _nss_ldap_getpwent_r(struct passwd *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endpwent(void); + +/* protocols - network protocols */ +enum nss_status _nss_ldap_getprotobyname_r(const char *name,struct protoent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getprotobynumber_r(int number,struct protoent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setprotoent(int stayopen); +enum nss_status _nss_ldap_getprotoent_r(struct protoent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endprotoent(void); + +/* rpc - remote procedure call names and numbers */ +enum nss_status _nss_ldap_getrpcbyname_r(const char *name,struct rpcent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setrpcent(int stayopen); +enum nss_status _nss_ldap_getrpcent_r(struct rpcent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endrpcent(void); + +/* services - network services */ +enum nss_status _nss_ldap_getservbyname_r(const char *name,const char *protocol,struct servent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_getservbyport_r(int port,const char *protocol,struct servent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setservent(int stayopen); +enum nss_status _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endservent(void); + +/* shadow - extended user information */ +enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_setspent(int stayopen); +enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t buflen,int *errnop); +enum nss_status _nss_ldap_endspent(void); + +#endif /* not NSS_EXPORTS */ diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/rpc.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/rpc.c new file mode 100644 index 0000000000..8d73ee7fc0 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/rpc.c @@ -0,0 +1,76 @@ +/* + rpc.c - NSS lookup functions for rpc database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_rpcent( + TFILE *fp,struct rpcent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->r_name); + READ_STRINGLIST_NULLTERM(fp,result->r_aliases); + READ_INT32(fp,result->r_number); + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getrpcbyname_r(const char *name,struct rpcent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_RPC_BYNAME, + name, + read_rpcent(fp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_getrpcbynumber_r(int number,struct rpcent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYINT32(NSLCD_ACTION_RPC_BYNUMBER, + number, + read_rpcent(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *protoentfp; + +enum nss_status _nss_ldap_setrpcent(int UNUSED(stayopen)) +{ + NSS_SETENT(protoentfp); +} + +enum nss_status _nss_ldap_getrpcent_r(struct rpcent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(protoentfp,NSLCD_ACTION_RPC_ALL, + read_rpcent(protoentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endrpcent(void) +{ + NSS_ENDENT(protoentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/services.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/services.c new file mode 100644 index 0000000000..27625e699d --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/services.c @@ -0,0 +1,81 @@ +/* + service.c - NSS lookup functions for services database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_servent( + TFILE *fp,struct servent *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->s_name); + READ_STRINGLIST_NULLTERM(fp,result->s_aliases); + /* store port number in network byte order */ + READ_TYPE(fp,tmpint32,int32_t); + result->s_port=ntohs((uint16_t)tmpint32); + READ_STRING_BUF(fp,result->s_proto); + /* we're done */ + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getservbyname_r(const char *name,const char *protocol,struct servent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNAME, + WRITE_STRING(fp,name);WRITE_STRING(fp,protocol), + read_servent(fp,result,buffer,buflen,errnop)); + +} + +enum nss_status _nss_ldap_getservbyport_r(int port,const char *protocol,struct servent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYGEN(NSLCD_ACTION_SERVICE_BYNUMBER, + WRITE_INT32(fp,ntohs(port));WRITE_STRING(fp,protocol), + read_servent(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *protoentfp; + +enum nss_status _nss_ldap_setservent(int UNUSED(stayopen)) +{ + NSS_SETENT(protoentfp); +} + +enum nss_status _nss_ldap_getservent_r(struct servent *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(protoentfp,NSLCD_ACTION_SERVICE_ALL, + read_servent(protoentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endservent(void) +{ + NSS_ENDENT(protoentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/nss/shadow.c b/contrib/slapd-modules/nssov/nss-ldapd/nss/shadow.c new file mode 100644 index 0000000000..195489a730 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/nss/shadow.c @@ -0,0 +1,75 @@ +/* + shadow.c - NSS lookup functions for shadow database + + Copyright (C) 2006 West Consulting + Copyright (C) 2006, 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "prototypes.h" +#include "common.h" +#include "compat/attrs.h" + +static enum nss_status read_spwd( + TFILE *fp,struct spwd *result, + char *buffer,size_t buflen,int *errnop) +{ + int32_t tmpint32; + size_t bufptr=0; + READ_STRING_BUF(fp,result->sp_namp); + READ_STRING_BUF(fp,result->sp_pwdp); + READ_INT32(fp,result->sp_lstchg); + READ_INT32(fp,result->sp_min); + READ_INT32(fp,result->sp_max); + READ_INT32(fp,result->sp_warn); + READ_INT32(fp,result->sp_inact); + READ_INT32(fp,result->sp_expire); + READ_INT32(fp,result->sp_flag); + return NSS_STATUS_SUCCESS; +} + +enum nss_status _nss_ldap_getspnam_r(const char *name,struct spwd *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_BYNAME(NSLCD_ACTION_SHADOW_BYNAME, + name, + read_spwd(fp,result,buffer,buflen,errnop)); +} + +/* thread-local file pointer to an ongoing request */ +static __thread TFILE *spentfp; + +enum nss_status _nss_ldap_setspent(int UNUSED(stayopen)) +{ + NSS_SETENT(spentfp); +} + +enum nss_status _nss_ldap_getspent_r(struct spwd *result,char *buffer,size_t buflen,int *errnop) +{ + NSS_GETENT(spentfp,NSLCD_ACTION_SHADOW_ALL, + read_spwd(spentfp,result,buffer,buflen,errnop)); +} + +enum nss_status _nss_ldap_endspent(void) +{ + NSS_ENDENT(spentfp); +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.am b/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.am new file mode 100644 index 0000000000..bba61b3c52 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.am @@ -0,0 +1,90 @@ +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +TESTS = test_dict test_set test_tio test_cfg test_myldap.sh test_nsscmds.sh + +check_PROGRAMS = test_dict test_set test_tio test_cfg test_myldap + +EXTRA_PROGRAMS = test_aliases test_ethers test_group test_hosts \ + test_netgroup test_networks test_passwd test_protocols \ + test_rpc test_services test_shadow \ + test_nslcd_group + +EXTRA_DIST = nss-ldapd-test.conf test_myldap.sh test_nsscmds.sh usernames.txt + +CLEANFILES = $(EXTRA_PROGRAMS) + +AM_CPPFLAGS = -I$(top_srcdir) +AM_CFLAGS = $(PTHREAD_CFLAGS) -g + +# the following enables verbose protocol debugging information to be dumped +#AM_CPPFLAGS += -DDEBUG_PROT -DDEBUG_PROT_DUMP + +# the following enabled verbose tio stats logging +#AM_CPPFLAGS += -DDEBUG_TIO_STATS + +test_dict_SOURCES = test_dict.c ../common/dict.h ../common/dict.c +#test_dict_LDADD = ../common/dict.o + +test_set_SOURCES = test_set.c ../common/set.h +test_set_LDADD = ../common/libdict.a + +test_tio_SOURCES = test_tio.c ../common/tio.h ../common/tio.c +test_tio_LDFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) + +test_cfg_SOURCES = test_cfg.c +test_cfg_LDADD = ../nslcd/log.o ../nslcd/attmap.o \ + ../nslcd/common.o ../nslcd/myldap.o \ + ../nslcd/alias.o ../nslcd/ether.o ../nslcd/group.o \ + ../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \ + ../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \ + ../nslcd/service.o ../nslcd/shadow.o \ + @nslcd_LIBS@ ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a + +test_myldap_SOURCES = test_myldap.c +test_myldap_LDADD = ../nslcd/log.o ../nslcd/common.o ../nslcd/cfg.o \ + ../nslcd/myldap.o @nslcd_LIBS@ ../common/libtio.a \ + ../common/libdict.a ../compat/libcompat.a + +common_SOURCES = ../nss/common.c ../nslcd.h ../nss/prototypes.h \ + ../common/tio.c ../common/tio.h + +test_aliases_SOURCES = test_aliases.c ../nss/aliases.c $(common_SOURCES) +test_ethers_SOURCES = test_ethers.c ../nss/ethers.c $(common_SOURCES) +test_group_SOURCES = test_group.c ../nss/group.c $(common_SOURCES) +test_hosts_SOURCES = test_hosts.c ../nss/hosts.c $(common_SOURCES) +test_netgroup_SOURCES = test_netgroup.c ../nss/netgroup.c $(common_SOURCES) +test_networks_SOURCES = test_networks.c ../nss/networks.c $(common_SOURCES) +test_passwd_SOURCES = test_passwd.c ../nss/passwd.c $(common_SOURCES) +test_protocols_SOURCES = test_protocols.c ../nss/protocols.c $(common_SOURCES) +test_rpc_SOURCES = test_rpc.c ../nss/rpc.c $(common_SOURCES) +test_services_SOURCES = test_services.c ../nss/services.c $(common_SOURCES) +test_shadow_SOURCES = test_shadow.c ../nss/shadow.c $(common_SOURCES) + +test_nslcd_group_SOURCES = test_nslcd_group.c +test_nslcd_group_LDADD = ../nslcd/log.o ../nslcd/attmap.o ../common/dict.o \ + ../nslcd/common.o ../nslcd/myldap.o \ + ../nslcd/alias.o ../nslcd/ether.o \ + ../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \ + ../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \ + ../nslcd/service.o ../nslcd/shadow.o \ + @nslcd_LIBS@ ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a ../nslcd/cfg.o diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.in b/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.in new file mode 100644 index 0000000000..81ad583efd --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/Makefile.in @@ -0,0 +1,930 @@ +# Makefile.in generated by automake 1.10.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, +# 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# Makefile.am - use automake to generate Makefile.in +# +# Copyright (C) 2006 West Consulting +# Copyright (C) 2006, 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA +VPATH = @srcdir@ +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +target_triplet = @target@ +TESTS = test_dict$(EXEEXT) test_set$(EXEEXT) test_tio$(EXEEXT) \ + test_cfg$(EXEEXT) test_myldap.sh test_nsscmds.sh +check_PROGRAMS = test_dict$(EXEEXT) test_set$(EXEEXT) \ + test_tio$(EXEEXT) test_cfg$(EXEEXT) test_myldap$(EXEEXT) +EXTRA_PROGRAMS = test_aliases$(EXEEXT) test_ethers$(EXEEXT) \ + test_group$(EXEEXT) test_hosts$(EXEEXT) test_netgroup$(EXEEXT) \ + test_networks$(EXEEXT) test_passwd$(EXEEXT) \ + test_protocols$(EXEEXT) test_rpc$(EXEEXT) \ + test_services$(EXEEXT) test_shadow$(EXEEXT) \ + test_nslcd_group$(EXEEXT) +subdir = tests +DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \ + $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +am__objects_1 = common.$(OBJEXT) tio.$(OBJEXT) +am_test_aliases_OBJECTS = test_aliases.$(OBJEXT) aliases.$(OBJEXT) \ + $(am__objects_1) +test_aliases_OBJECTS = $(am_test_aliases_OBJECTS) +test_aliases_LDADD = $(LDADD) +am_test_cfg_OBJECTS = test_cfg.$(OBJEXT) +test_cfg_OBJECTS = $(am_test_cfg_OBJECTS) +test_cfg_DEPENDENCIES = ../nslcd/log.o ../nslcd/attmap.o \ + ../nslcd/common.o ../nslcd/myldap.o ../nslcd/alias.o \ + ../nslcd/ether.o ../nslcd/group.o ../nslcd/host.o \ + ../nslcd/netgroup.o ../nslcd/network.o ../nslcd/passwd.o \ + ../nslcd/protocol.o ../nslcd/rpc.o ../nslcd/service.o \ + ../nslcd/shadow.o ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a +am_test_dict_OBJECTS = test_dict.$(OBJEXT) dict.$(OBJEXT) +test_dict_OBJECTS = $(am_test_dict_OBJECTS) +test_dict_LDADD = $(LDADD) +am_test_ethers_OBJECTS = test_ethers.$(OBJEXT) ethers.$(OBJEXT) \ + $(am__objects_1) +test_ethers_OBJECTS = $(am_test_ethers_OBJECTS) +test_ethers_LDADD = $(LDADD) +am_test_group_OBJECTS = test_group.$(OBJEXT) group.$(OBJEXT) \ + $(am__objects_1) +test_group_OBJECTS = $(am_test_group_OBJECTS) +test_group_LDADD = $(LDADD) +am_test_hosts_OBJECTS = test_hosts.$(OBJEXT) hosts.$(OBJEXT) \ + $(am__objects_1) +test_hosts_OBJECTS = $(am_test_hosts_OBJECTS) +test_hosts_LDADD = $(LDADD) +am_test_myldap_OBJECTS = test_myldap.$(OBJEXT) +test_myldap_OBJECTS = $(am_test_myldap_OBJECTS) +test_myldap_DEPENDENCIES = ../nslcd/log.o ../nslcd/common.o \ + ../nslcd/cfg.o ../nslcd/myldap.o ../common/libtio.a \ + ../common/libdict.a ../compat/libcompat.a +am_test_netgroup_OBJECTS = test_netgroup.$(OBJEXT) netgroup.$(OBJEXT) \ + $(am__objects_1) +test_netgroup_OBJECTS = $(am_test_netgroup_OBJECTS) +test_netgroup_LDADD = $(LDADD) +am_test_networks_OBJECTS = test_networks.$(OBJEXT) networks.$(OBJEXT) \ + $(am__objects_1) +test_networks_OBJECTS = $(am_test_networks_OBJECTS) +test_networks_LDADD = $(LDADD) +am_test_nslcd_group_OBJECTS = test_nslcd_group.$(OBJEXT) +test_nslcd_group_OBJECTS = $(am_test_nslcd_group_OBJECTS) +test_nslcd_group_DEPENDENCIES = ../nslcd/log.o ../nslcd/attmap.o \ + ../common/dict.o ../nslcd/common.o ../nslcd/myldap.o \ + ../nslcd/alias.o ../nslcd/ether.o ../nslcd/host.o \ + ../nslcd/netgroup.o ../nslcd/network.o ../nslcd/passwd.o \ + ../nslcd/protocol.o ../nslcd/rpc.o ../nslcd/service.o \ + ../nslcd/shadow.o ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a ../nslcd/cfg.o +am_test_passwd_OBJECTS = test_passwd.$(OBJEXT) passwd.$(OBJEXT) \ + $(am__objects_1) +test_passwd_OBJECTS = $(am_test_passwd_OBJECTS) +test_passwd_LDADD = $(LDADD) +am_test_protocols_OBJECTS = test_protocols.$(OBJEXT) \ + protocols.$(OBJEXT) $(am__objects_1) +test_protocols_OBJECTS = $(am_test_protocols_OBJECTS) +test_protocols_LDADD = $(LDADD) +am_test_rpc_OBJECTS = test_rpc.$(OBJEXT) rpc.$(OBJEXT) \ + $(am__objects_1) +test_rpc_OBJECTS = $(am_test_rpc_OBJECTS) +test_rpc_LDADD = $(LDADD) +am_test_services_OBJECTS = test_services.$(OBJEXT) services.$(OBJEXT) \ + $(am__objects_1) +test_services_OBJECTS = $(am_test_services_OBJECTS) +test_services_LDADD = $(LDADD) +am_test_set_OBJECTS = test_set.$(OBJEXT) +test_set_OBJECTS = $(am_test_set_OBJECTS) +test_set_DEPENDENCIES = ../common/libdict.a +am_test_shadow_OBJECTS = test_shadow.$(OBJEXT) shadow.$(OBJEXT) \ + $(am__objects_1) +test_shadow_OBJECTS = $(am_test_shadow_OBJECTS) +test_shadow_LDADD = $(LDADD) +am_test_tio_OBJECTS = test_tio.$(OBJEXT) tio.$(OBJEXT) +test_tio_OBJECTS = $(am_test_tio_OBJECTS) +test_tio_LDADD = $(LDADD) +test_tio_LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(test_tio_LDFLAGS) \ + $(LDFLAGS) -o $@ +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir) +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ +SOURCES = $(test_aliases_SOURCES) $(test_cfg_SOURCES) \ + $(test_dict_SOURCES) $(test_ethers_SOURCES) \ + $(test_group_SOURCES) $(test_hosts_SOURCES) \ + $(test_myldap_SOURCES) $(test_netgroup_SOURCES) \ + $(test_networks_SOURCES) $(test_nslcd_group_SOURCES) \ + $(test_passwd_SOURCES) $(test_protocols_SOURCES) \ + $(test_rpc_SOURCES) $(test_services_SOURCES) \ + $(test_set_SOURCES) $(test_shadow_SOURCES) $(test_tio_SOURCES) +DIST_SOURCES = $(test_aliases_SOURCES) $(test_cfg_SOURCES) \ + $(test_dict_SOURCES) $(test_ethers_SOURCES) \ + $(test_group_SOURCES) $(test_hosts_SOURCES) \ + $(test_myldap_SOURCES) $(test_netgroup_SOURCES) \ + $(test_networks_SOURCES) $(test_nslcd_group_SOURCES) \ + $(test_passwd_SOURCES) $(test_protocols_SOURCES) \ + $(test_rpc_SOURCES) $(test_services_SOURCES) \ + $(test_set_SOURCES) $(test_shadow_SOURCES) $(test_tio_SOURCES) +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +AMTAR = @AMTAR@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AWK = @AWK@ +CC = @CC@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEPDIR = @DEPDIR@ +DOCBOOK2X_MAN = @DOCBOOK2X_MAN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +GREP = @GREP@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LDFLAGS = @LDFLAGS@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LTLIBOBJS = @LTLIBOBJS@ +MAKEINFO = @MAKEINFO@ +MKDIR_P = @MKDIR_P@ +NSLCD_PIDFILE = @NSLCD_PIDFILE@ +NSLCD_SOCKET = @NSLCD_SOCKET@ +NSS_LDAP_PATH_CONF = @NSS_LDAP_PATH_CONF@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PTHREAD_CC = @PTHREAD_CC@ +PTHREAD_CFLAGS = @PTHREAD_CFLAGS@ +PTHREAD_LIBS = @PTHREAD_LIBS@ +RANLIB = @RANLIB@ +RELEASE_MONTH = @RELEASE_MONTH@ +SET_MAKE = @SET_MAKE@ +SHELL = @SHELL@ +STRIP = @STRIP@ +VERSION = @VERSION@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_CC = @ac_ct_CC@ +acx_pthread_config = @acx_pthread_config@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +nslcd_LIBS = @nslcd_LIBS@ +nss_ldap_so_LIBS = @nss_ldap_so_LIBS@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target = @target@ +target_alias = @target_alias@ +target_cpu = @target_cpu@ +target_os = @target_os@ +target_vendor = @target_vendor@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ +EXTRA_DIST = nss-ldapd-test.conf test_myldap.sh test_nsscmds.sh usernames.txt +CLEANFILES = $(EXTRA_PROGRAMS) +AM_CPPFLAGS = -I$(top_srcdir) +AM_CFLAGS = $(PTHREAD_CFLAGS) -g + +# the following enables verbose protocol debugging information to be dumped +#AM_CPPFLAGS += -DDEBUG_PROT -DDEBUG_PROT_DUMP + +# the following enabled verbose tio stats logging +#AM_CPPFLAGS += -DDEBUG_TIO_STATS +test_dict_SOURCES = test_dict.c ../common/dict.h ../common/dict.c +#test_dict_LDADD = ../common/dict.o +test_set_SOURCES = test_set.c ../common/set.h +test_set_LDADD = ../common/libdict.a +test_tio_SOURCES = test_tio.c ../common/tio.h ../common/tio.c +test_tio_LDFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_LIBS) +test_cfg_SOURCES = test_cfg.c +test_cfg_LDADD = ../nslcd/log.o ../nslcd/attmap.o \ + ../nslcd/common.o ../nslcd/myldap.o \ + ../nslcd/alias.o ../nslcd/ether.o ../nslcd/group.o \ + ../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \ + ../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \ + ../nslcd/service.o ../nslcd/shadow.o \ + @nslcd_LIBS@ ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a + +test_myldap_SOURCES = test_myldap.c +test_myldap_LDADD = ../nslcd/log.o ../nslcd/common.o ../nslcd/cfg.o \ + ../nslcd/myldap.o @nslcd_LIBS@ ../common/libtio.a \ + ../common/libdict.a ../compat/libcompat.a + +common_SOURCES = ../nss/common.c ../nslcd.h ../nss/prototypes.h \ + ../common/tio.c ../common/tio.h + +test_aliases_SOURCES = test_aliases.c ../nss/aliases.c $(common_SOURCES) +test_ethers_SOURCES = test_ethers.c ../nss/ethers.c $(common_SOURCES) +test_group_SOURCES = test_group.c ../nss/group.c $(common_SOURCES) +test_hosts_SOURCES = test_hosts.c ../nss/hosts.c $(common_SOURCES) +test_netgroup_SOURCES = test_netgroup.c ../nss/netgroup.c $(common_SOURCES) +test_networks_SOURCES = test_networks.c ../nss/networks.c $(common_SOURCES) +test_passwd_SOURCES = test_passwd.c ../nss/passwd.c $(common_SOURCES) +test_protocols_SOURCES = test_protocols.c ../nss/protocols.c $(common_SOURCES) +test_rpc_SOURCES = test_rpc.c ../nss/rpc.c $(common_SOURCES) +test_services_SOURCES = test_services.c ../nss/services.c $(common_SOURCES) +test_shadow_SOURCES = test_shadow.c ../nss/shadow.c $(common_SOURCES) +test_nslcd_group_SOURCES = test_nslcd_group.c +test_nslcd_group_LDADD = ../nslcd/log.o ../nslcd/attmap.o ../common/dict.o \ + ../nslcd/common.o ../nslcd/myldap.o \ + ../nslcd/alias.o ../nslcd/ether.o \ + ../nslcd/host.o ../nslcd/netgroup.o ../nslcd/network.o \ + ../nslcd/passwd.o ../nslcd/protocol.o ../nslcd/rpc.o \ + ../nslcd/service.o ../nslcd/shadow.o \ + @nslcd_LIBS@ ../common/libtio.a ../common/libdict.a \ + ../compat/libcompat.a ../nslcd/cfg.o + +all: all-am + +.SUFFIXES: +.SUFFIXES: .c .o .obj +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ + && exit 0; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \ + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu tests/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) +test_aliases$(EXEEXT): $(test_aliases_OBJECTS) $(test_aliases_DEPENDENCIES) + @rm -f test_aliases$(EXEEXT) + $(LINK) $(test_aliases_OBJECTS) $(test_aliases_LDADD) $(LIBS) +test_cfg$(EXEEXT): $(test_cfg_OBJECTS) $(test_cfg_DEPENDENCIES) + @rm -f test_cfg$(EXEEXT) + $(LINK) $(test_cfg_OBJECTS) $(test_cfg_LDADD) $(LIBS) +test_dict$(EXEEXT): $(test_dict_OBJECTS) $(test_dict_DEPENDENCIES) + @rm -f test_dict$(EXEEXT) + $(LINK) $(test_dict_OBJECTS) $(test_dict_LDADD) $(LIBS) +test_ethers$(EXEEXT): $(test_ethers_OBJECTS) $(test_ethers_DEPENDENCIES) + @rm -f test_ethers$(EXEEXT) + $(LINK) $(test_ethers_OBJECTS) $(test_ethers_LDADD) $(LIBS) +test_group$(EXEEXT): $(test_group_OBJECTS) $(test_group_DEPENDENCIES) + @rm -f test_group$(EXEEXT) + $(LINK) $(test_group_OBJECTS) $(test_group_LDADD) $(LIBS) +test_hosts$(EXEEXT): $(test_hosts_OBJECTS) $(test_hosts_DEPENDENCIES) + @rm -f test_hosts$(EXEEXT) + $(LINK) $(test_hosts_OBJECTS) $(test_hosts_LDADD) $(LIBS) +test_myldap$(EXEEXT): $(test_myldap_OBJECTS) $(test_myldap_DEPENDENCIES) + @rm -f test_myldap$(EXEEXT) + $(LINK) $(test_myldap_OBJECTS) $(test_myldap_LDADD) $(LIBS) +test_netgroup$(EXEEXT): $(test_netgroup_OBJECTS) $(test_netgroup_DEPENDENCIES) + @rm -f test_netgroup$(EXEEXT) + $(LINK) $(test_netgroup_OBJECTS) $(test_netgroup_LDADD) $(LIBS) +test_networks$(EXEEXT): $(test_networks_OBJECTS) $(test_networks_DEPENDENCIES) + @rm -f test_networks$(EXEEXT) + $(LINK) $(test_networks_OBJECTS) $(test_networks_LDADD) $(LIBS) +test_nslcd_group$(EXEEXT): $(test_nslcd_group_OBJECTS) $(test_nslcd_group_DEPENDENCIES) + @rm -f test_nslcd_group$(EXEEXT) + $(LINK) $(test_nslcd_group_OBJECTS) $(test_nslcd_group_LDADD) $(LIBS) +test_passwd$(EXEEXT): $(test_passwd_OBJECTS) $(test_passwd_DEPENDENCIES) + @rm -f test_passwd$(EXEEXT) + $(LINK) $(test_passwd_OBJECTS) $(test_passwd_LDADD) $(LIBS) +test_protocols$(EXEEXT): $(test_protocols_OBJECTS) $(test_protocols_DEPENDENCIES) + @rm -f test_protocols$(EXEEXT) + $(LINK) $(test_protocols_OBJECTS) $(test_protocols_LDADD) $(LIBS) +test_rpc$(EXEEXT): $(test_rpc_OBJECTS) $(test_rpc_DEPENDENCIES) + @rm -f test_rpc$(EXEEXT) + $(LINK) $(test_rpc_OBJECTS) $(test_rpc_LDADD) $(LIBS) +test_services$(EXEEXT): $(test_services_OBJECTS) $(test_services_DEPENDENCIES) + @rm -f test_services$(EXEEXT) + $(LINK) $(test_services_OBJECTS) $(test_services_LDADD) $(LIBS) +test_set$(EXEEXT): $(test_set_OBJECTS) $(test_set_DEPENDENCIES) + @rm -f test_set$(EXEEXT) + $(LINK) $(test_set_OBJECTS) $(test_set_LDADD) $(LIBS) +test_shadow$(EXEEXT): $(test_shadow_OBJECTS) $(test_shadow_DEPENDENCIES) + @rm -f test_shadow$(EXEEXT) + $(LINK) $(test_shadow_OBJECTS) $(test_shadow_LDADD) $(LIBS) +test_tio$(EXEEXT): $(test_tio_OBJECTS) $(test_tio_DEPENDENCIES) + @rm -f test_tio$(EXEEXT) + $(test_tio_LINK) $(test_tio_OBJECTS) $(test_tio_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/aliases.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/common.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ethers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/group.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hosts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netgroup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/networks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/passwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/protocols.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/services.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/shadow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_aliases.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_cfg.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_dict.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_ethers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_group.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_hosts.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_myldap.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_netgroup.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_networks.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_nslcd_group.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_passwd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_protocols.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_rpc.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_services.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_set.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_shadow.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test_tio.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tio.Po@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< + +.c.obj: +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` + +aliases.o: ../nss/aliases.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT aliases.o -MD -MP -MF $(DEPDIR)/aliases.Tpo -c -o aliases.o `test -f '../nss/aliases.c' || echo '$(srcdir)/'`../nss/aliases.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/aliases.Tpo $(DEPDIR)/aliases.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/aliases.c' object='aliases.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o aliases.o `test -f '../nss/aliases.c' || echo '$(srcdir)/'`../nss/aliases.c + +aliases.obj: ../nss/aliases.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT aliases.obj -MD -MP -MF $(DEPDIR)/aliases.Tpo -c -o aliases.obj `if test -f '../nss/aliases.c'; then $(CYGPATH_W) '../nss/aliases.c'; else $(CYGPATH_W) '$(srcdir)/../nss/aliases.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/aliases.Tpo $(DEPDIR)/aliases.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/aliases.c' object='aliases.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o aliases.obj `if test -f '../nss/aliases.c'; then $(CYGPATH_W) '../nss/aliases.c'; else $(CYGPATH_W) '$(srcdir)/../nss/aliases.c'; fi` + +common.o: ../nss/common.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.o -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.o `test -f '../nss/common.c' || echo '$(srcdir)/'`../nss/common.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/common.c' object='common.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.o `test -f '../nss/common.c' || echo '$(srcdir)/'`../nss/common.c + +common.obj: ../nss/common.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT common.obj -MD -MP -MF $(DEPDIR)/common.Tpo -c -o common.obj `if test -f '../nss/common.c'; then $(CYGPATH_W) '../nss/common.c'; else $(CYGPATH_W) '$(srcdir)/../nss/common.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/common.Tpo $(DEPDIR)/common.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/common.c' object='common.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o common.obj `if test -f '../nss/common.c'; then $(CYGPATH_W) '../nss/common.c'; else $(CYGPATH_W) '$(srcdir)/../nss/common.c'; fi` + +tio.o: ../common/tio.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tio.o -MD -MP -MF $(DEPDIR)/tio.Tpo -c -o tio.o `test -f '../common/tio.c' || echo '$(srcdir)/'`../common/tio.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/tio.Tpo $(DEPDIR)/tio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../common/tio.c' object='tio.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tio.o `test -f '../common/tio.c' || echo '$(srcdir)/'`../common/tio.c + +tio.obj: ../common/tio.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tio.obj -MD -MP -MF $(DEPDIR)/tio.Tpo -c -o tio.obj `if test -f '../common/tio.c'; then $(CYGPATH_W) '../common/tio.c'; else $(CYGPATH_W) '$(srcdir)/../common/tio.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/tio.Tpo $(DEPDIR)/tio.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../common/tio.c' object='tio.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tio.obj `if test -f '../common/tio.c'; then $(CYGPATH_W) '../common/tio.c'; else $(CYGPATH_W) '$(srcdir)/../common/tio.c'; fi` + +dict.o: ../common/dict.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dict.o -MD -MP -MF $(DEPDIR)/dict.Tpo -c -o dict.o `test -f '../common/dict.c' || echo '$(srcdir)/'`../common/dict.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dict.Tpo $(DEPDIR)/dict.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../common/dict.c' object='dict.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dict.o `test -f '../common/dict.c' || echo '$(srcdir)/'`../common/dict.c + +dict.obj: ../common/dict.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT dict.obj -MD -MP -MF $(DEPDIR)/dict.Tpo -c -o dict.obj `if test -f '../common/dict.c'; then $(CYGPATH_W) '../common/dict.c'; else $(CYGPATH_W) '$(srcdir)/../common/dict.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/dict.Tpo $(DEPDIR)/dict.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../common/dict.c' object='dict.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o dict.obj `if test -f '../common/dict.c'; then $(CYGPATH_W) '../common/dict.c'; else $(CYGPATH_W) '$(srcdir)/../common/dict.c'; fi` + +ethers.o: ../nss/ethers.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ethers.o -MD -MP -MF $(DEPDIR)/ethers.Tpo -c -o ethers.o `test -f '../nss/ethers.c' || echo '$(srcdir)/'`../nss/ethers.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ethers.Tpo $(DEPDIR)/ethers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/ethers.c' object='ethers.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ethers.o `test -f '../nss/ethers.c' || echo '$(srcdir)/'`../nss/ethers.c + +ethers.obj: ../nss/ethers.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT ethers.obj -MD -MP -MF $(DEPDIR)/ethers.Tpo -c -o ethers.obj `if test -f '../nss/ethers.c'; then $(CYGPATH_W) '../nss/ethers.c'; else $(CYGPATH_W) '$(srcdir)/../nss/ethers.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/ethers.Tpo $(DEPDIR)/ethers.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/ethers.c' object='ethers.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o ethers.obj `if test -f '../nss/ethers.c'; then $(CYGPATH_W) '../nss/ethers.c'; else $(CYGPATH_W) '$(srcdir)/../nss/ethers.c'; fi` + +group.o: ../nss/group.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT group.o -MD -MP -MF $(DEPDIR)/group.Tpo -c -o group.o `test -f '../nss/group.c' || echo '$(srcdir)/'`../nss/group.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/group.Tpo $(DEPDIR)/group.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/group.c' object='group.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o group.o `test -f '../nss/group.c' || echo '$(srcdir)/'`../nss/group.c + +group.obj: ../nss/group.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT group.obj -MD -MP -MF $(DEPDIR)/group.Tpo -c -o group.obj `if test -f '../nss/group.c'; then $(CYGPATH_W) '../nss/group.c'; else $(CYGPATH_W) '$(srcdir)/../nss/group.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/group.Tpo $(DEPDIR)/group.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/group.c' object='group.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o group.obj `if test -f '../nss/group.c'; then $(CYGPATH_W) '../nss/group.c'; else $(CYGPATH_W) '$(srcdir)/../nss/group.c'; fi` + +hosts.o: ../nss/hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hosts.o -MD -MP -MF $(DEPDIR)/hosts.Tpo -c -o hosts.o `test -f '../nss/hosts.c' || echo '$(srcdir)/'`../nss/hosts.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hosts.Tpo $(DEPDIR)/hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/hosts.c' object='hosts.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hosts.o `test -f '../nss/hosts.c' || echo '$(srcdir)/'`../nss/hosts.c + +hosts.obj: ../nss/hosts.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT hosts.obj -MD -MP -MF $(DEPDIR)/hosts.Tpo -c -o hosts.obj `if test -f '../nss/hosts.c'; then $(CYGPATH_W) '../nss/hosts.c'; else $(CYGPATH_W) '$(srcdir)/../nss/hosts.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/hosts.Tpo $(DEPDIR)/hosts.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/hosts.c' object='hosts.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o hosts.obj `if test -f '../nss/hosts.c'; then $(CYGPATH_W) '../nss/hosts.c'; else $(CYGPATH_W) '$(srcdir)/../nss/hosts.c'; fi` + +netgroup.o: ../nss/netgroup.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netgroup.o -MD -MP -MF $(DEPDIR)/netgroup.Tpo -c -o netgroup.o `test -f '../nss/netgroup.c' || echo '$(srcdir)/'`../nss/netgroup.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/netgroup.Tpo $(DEPDIR)/netgroup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/netgroup.c' object='netgroup.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netgroup.o `test -f '../nss/netgroup.c' || echo '$(srcdir)/'`../nss/netgroup.c + +netgroup.obj: ../nss/netgroup.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT netgroup.obj -MD -MP -MF $(DEPDIR)/netgroup.Tpo -c -o netgroup.obj `if test -f '../nss/netgroup.c'; then $(CYGPATH_W) '../nss/netgroup.c'; else $(CYGPATH_W) '$(srcdir)/../nss/netgroup.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/netgroup.Tpo $(DEPDIR)/netgroup.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/netgroup.c' object='netgroup.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o netgroup.obj `if test -f '../nss/netgroup.c'; then $(CYGPATH_W) '../nss/netgroup.c'; else $(CYGPATH_W) '$(srcdir)/../nss/netgroup.c'; fi` + +networks.o: ../nss/networks.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT networks.o -MD -MP -MF $(DEPDIR)/networks.Tpo -c -o networks.o `test -f '../nss/networks.c' || echo '$(srcdir)/'`../nss/networks.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/networks.Tpo $(DEPDIR)/networks.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/networks.c' object='networks.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o networks.o `test -f '../nss/networks.c' || echo '$(srcdir)/'`../nss/networks.c + +networks.obj: ../nss/networks.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT networks.obj -MD -MP -MF $(DEPDIR)/networks.Tpo -c -o networks.obj `if test -f '../nss/networks.c'; then $(CYGPATH_W) '../nss/networks.c'; else $(CYGPATH_W) '$(srcdir)/../nss/networks.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/networks.Tpo $(DEPDIR)/networks.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/networks.c' object='networks.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o networks.obj `if test -f '../nss/networks.c'; then $(CYGPATH_W) '../nss/networks.c'; else $(CYGPATH_W) '$(srcdir)/../nss/networks.c'; fi` + +passwd.o: ../nss/passwd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT passwd.o -MD -MP -MF $(DEPDIR)/passwd.Tpo -c -o passwd.o `test -f '../nss/passwd.c' || echo '$(srcdir)/'`../nss/passwd.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/passwd.Tpo $(DEPDIR)/passwd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/passwd.c' object='passwd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o passwd.o `test -f '../nss/passwd.c' || echo '$(srcdir)/'`../nss/passwd.c + +passwd.obj: ../nss/passwd.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT passwd.obj -MD -MP -MF $(DEPDIR)/passwd.Tpo -c -o passwd.obj `if test -f '../nss/passwd.c'; then $(CYGPATH_W) '../nss/passwd.c'; else $(CYGPATH_W) '$(srcdir)/../nss/passwd.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/passwd.Tpo $(DEPDIR)/passwd.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/passwd.c' object='passwd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o passwd.obj `if test -f '../nss/passwd.c'; then $(CYGPATH_W) '../nss/passwd.c'; else $(CYGPATH_W) '$(srcdir)/../nss/passwd.c'; fi` + +protocols.o: ../nss/protocols.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT protocols.o -MD -MP -MF $(DEPDIR)/protocols.Tpo -c -o protocols.o `test -f '../nss/protocols.c' || echo '$(srcdir)/'`../nss/protocols.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/protocols.Tpo $(DEPDIR)/protocols.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/protocols.c' object='protocols.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o protocols.o `test -f '../nss/protocols.c' || echo '$(srcdir)/'`../nss/protocols.c + +protocols.obj: ../nss/protocols.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT protocols.obj -MD -MP -MF $(DEPDIR)/protocols.Tpo -c -o protocols.obj `if test -f '../nss/protocols.c'; then $(CYGPATH_W) '../nss/protocols.c'; else $(CYGPATH_W) '$(srcdir)/../nss/protocols.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/protocols.Tpo $(DEPDIR)/protocols.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/protocols.c' object='protocols.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o protocols.obj `if test -f '../nss/protocols.c'; then $(CYGPATH_W) '../nss/protocols.c'; else $(CYGPATH_W) '$(srcdir)/../nss/protocols.c'; fi` + +rpc.o: ../nss/rpc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rpc.o -MD -MP -MF $(DEPDIR)/rpc.Tpo -c -o rpc.o `test -f '../nss/rpc.c' || echo '$(srcdir)/'`../nss/rpc.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/rpc.Tpo $(DEPDIR)/rpc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/rpc.c' object='rpc.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rpc.o `test -f '../nss/rpc.c' || echo '$(srcdir)/'`../nss/rpc.c + +rpc.obj: ../nss/rpc.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT rpc.obj -MD -MP -MF $(DEPDIR)/rpc.Tpo -c -o rpc.obj `if test -f '../nss/rpc.c'; then $(CYGPATH_W) '../nss/rpc.c'; else $(CYGPATH_W) '$(srcdir)/../nss/rpc.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/rpc.Tpo $(DEPDIR)/rpc.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/rpc.c' object='rpc.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o rpc.obj `if test -f '../nss/rpc.c'; then $(CYGPATH_W) '../nss/rpc.c'; else $(CYGPATH_W) '$(srcdir)/../nss/rpc.c'; fi` + +services.o: ../nss/services.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT services.o -MD -MP -MF $(DEPDIR)/services.Tpo -c -o services.o `test -f '../nss/services.c' || echo '$(srcdir)/'`../nss/services.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/services.Tpo $(DEPDIR)/services.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/services.c' object='services.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o services.o `test -f '../nss/services.c' || echo '$(srcdir)/'`../nss/services.c + +services.obj: ../nss/services.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT services.obj -MD -MP -MF $(DEPDIR)/services.Tpo -c -o services.obj `if test -f '../nss/services.c'; then $(CYGPATH_W) '../nss/services.c'; else $(CYGPATH_W) '$(srcdir)/../nss/services.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/services.Tpo $(DEPDIR)/services.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/services.c' object='services.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o services.obj `if test -f '../nss/services.c'; then $(CYGPATH_W) '../nss/services.c'; else $(CYGPATH_W) '$(srcdir)/../nss/services.c'; fi` + +shadow.o: ../nss/shadow.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shadow.o -MD -MP -MF $(DEPDIR)/shadow.Tpo -c -o shadow.o `test -f '../nss/shadow.c' || echo '$(srcdir)/'`../nss/shadow.c +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/shadow.Tpo $(DEPDIR)/shadow.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/shadow.c' object='shadow.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shadow.o `test -f '../nss/shadow.c' || echo '$(srcdir)/'`../nss/shadow.c + +shadow.obj: ../nss/shadow.c +@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT shadow.obj -MD -MP -MF $(DEPDIR)/shadow.Tpo -c -o shadow.obj `if test -f '../nss/shadow.c'; then $(CYGPATH_W) '../nss/shadow.c'; else $(CYGPATH_W) '$(srcdir)/../nss/shadow.c'; fi` +@am__fastdepCC_TRUE@ mv -f $(DEPDIR)/shadow.Tpo $(DEPDIR)/shadow.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='../nss/shadow.c' object='shadow.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o shadow.obj `if test -f '../nss/shadow.c'; then $(CYGPATH_W) '../nss/shadow.c'; else $(CYGPATH_W) '$(srcdir)/../nss/shadow.c'; fi` + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + mkid -fID $$unique +tags: TAGS + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique; \ + fi +ctags: CTAGS +CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in files) print i; }; }'`; \ + test -z "$(CTAGS_ARGS)$$tags$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +check-TESTS: $(TESTS) + @failed=0; all=0; xfail=0; xpass=0; skip=0; ws='[ ]'; \ + srcdir=$(srcdir); export srcdir; \ + list=' $(TESTS) '; \ + if test -n "$$list"; then \ + for tst in $$list; do \ + if test -f ./$$tst; then dir=./; \ + elif test -f $$tst; then dir=; \ + else dir="$(srcdir)/"; fi; \ + if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xpass=`expr $$xpass + 1`; \ + failed=`expr $$failed + 1`; \ + echo "XPASS: $$tst"; \ + ;; \ + *) \ + echo "PASS: $$tst"; \ + ;; \ + esac; \ + elif test $$? -ne 77; then \ + all=`expr $$all + 1`; \ + case " $(XFAIL_TESTS) " in \ + *$$ws$$tst$$ws*) \ + xfail=`expr $$xfail + 1`; \ + echo "XFAIL: $$tst"; \ + ;; \ + *) \ + failed=`expr $$failed + 1`; \ + echo "FAIL: $$tst"; \ + ;; \ + esac; \ + else \ + skip=`expr $$skip + 1`; \ + echo "SKIP: $$tst"; \ + fi; \ + done; \ + if test "$$failed" -eq 0; then \ + if test "$$xfail" -eq 0; then \ + banner="All $$all tests passed"; \ + else \ + banner="All $$all tests behaved as expected ($$xfail expected failures)"; \ + fi; \ + else \ + if test "$$xpass" -eq 0; then \ + banner="$$failed of $$all tests failed"; \ + else \ + banner="$$failed of $$all tests did not behave as expected ($$xpass unexpected passes)"; \ + fi; \ + fi; \ + dashes="$$banner"; \ + skipped=""; \ + if test "$$skip" -ne 0; then \ + skipped="($$skip tests were not run)"; \ + test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$skipped"; \ + fi; \ + report=""; \ + if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \ + report="Please report to $(PACKAGE_BUGREPORT)"; \ + test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \ + dashes="$$report"; \ + fi; \ + dashes=`echo "$$dashes" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + test -z "$$skipped" || echo "$$skipped"; \ + test -z "$$report" || echo "$$report"; \ + echo "$$dashes"; \ + test "$$failed" -eq 0; \ + else :; fi + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) + $(MAKE) $(AM_MAKEFLAGS) check-TESTS +check: check-am +all-am: Makefile +installdirs: +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am + +distclean: distclean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +info: info-am + +info-am: + +install-data-am: + +install-dvi: install-dvi-am + +install-exec-am: + +install-html: install-html-am + +install-info: install-info-am + +install-man: + +install-pdf: install-pdf-am + +install-ps: install-ps-am + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: + +.MAKE: install-am install-strip + +.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ + clean-checkPROGRAMS clean-generic ctags distclean \ + distclean-compile distclean-generic distclean-tags distdir dvi \ + dvi-am html html-am info info-am install install-am \ + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/nss-ldapd-test.conf b/contrib/slapd-modules/nssov/nss-ldapd/tests/nss-ldapd-test.conf new file mode 100644 index 0000000000..dfe5efd5e0 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/nss-ldapd-test.conf @@ -0,0 +1,28 @@ +# nss-ldapd-test.conf +# nss-ldapd configuration file for test environment. +# See nss-ldapd.conf(5) for details. + +# The location at which the LDAP server(s) should be reachable. +uri ldap://127.0.0.1/ + +# The search base that will be used for all queries. +base dc=test,dc=tld + +# The LDAP protocol version to use. +#ldap_version 3 + +# The DN to bind with for normal lookups. +#binddn cn=annonymous,dc=example,dc=net +#bindpw *removed* + +# The search scope. +#scope sub + +# The number of answers to request in a single search. +pagesize 100 + +# The timeout for network operations. +timelimit 2 +bind_timelimit 4 +reconnect_sleeptime 4 +reconnect_maxsleeptime 10 diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_aliases.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_aliases.c new file mode 100644 index 0000000000..b821422e8d --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_aliases.c @@ -0,0 +1,94 @@ +/* + test_aliases.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" +#include "compat/attrs.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printalias(struct aliasent *alias) +{ + int i; + printf("struct alias {\n" + " alias_name=\"%s\",\n" + " alias_members_len=%d,\n", + alias->alias_name,(int)alias->alias_members_len); + for (i=0;i<(int)alias->alias_members_len;i++) + printf(" alias_members[%d]=\"%s\",\n", + i,alias->alias_members[i]); + printf(" alias_local=%d\n" + "}\n",(int)alias->alias_local); +} + +/* the main program... */ +int main(int UNUSED(argc),char UNUSED(*argv[])) +{ + struct aliasent aliasresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getaliasbyname() */ + printf("\nTEST getaliasbyname()\n"); + res=_nss_ldap_getaliasbyname_r("wij@arthurenhella.demon.nl",&aliasresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printalias(&aliasresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}aliasent() */ + printf("\nTEST {set,get,end}aliasent()\n"); + res=_nss_ldap_setaliasent(); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getaliasent_r(&aliasresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printalias(&aliasresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endaliasent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_cfg.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_cfg.c new file mode 100644 index 0000000000..76688ee8fe --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_cfg.c @@ -0,0 +1,245 @@ +/* + test_cfg.c - simple test for the cfg module + This file is part of the nss-ldapd library. + + Copyright (C) 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +/* we include cfg.c because we want to test the static methods */ +#include "nslcd/cfg.c" + +#ifndef __ASSERT_FUNCTION +#define __ASSERT_FUNCTION "" +#endif /* not __ASSERT_FUNCTION */ + +#define assertstreq(str1,str2) \ + (assertstreq_impl(str1,str2,"strcmp(" __STRING(str1) "," __STRING(str2) ")==0", \ + __FILE__, __LINE__, __ASSERT_FUNCTION)) + +/* for Solaris: */ +#define __assert_fail(assertion,file,line,function) __assert(assertion,file,line) + +/* method for determening string equalness */ +static void assertstreq_impl(const char *str1,const char *str2, + const char *assertion,const char *file, + int line,const char *function) +{ + if (strcmp(str1,str2)!=0) + __assert_fail(assertion,file,line,function); +} + +static void test_xstrdup(void) +{ + static const char *foo="testString123"; + char *bar; + bar=xstrdup(foo); + /* we should have a new value */ + assert(bar!=NULL); + /* the contents should be the same */ + assertstreq(foo,bar); + /* but the pointer should be different */ + assert(foo!=bar); + /* free memory */ + free(bar); +} + +static void test_add_uris(void) +{ + static struct ldap_config cfg; + int i; + /* set up config */ + cfg_defaults(&cfg); + assert(cfg.ldc_uris[0].uri==NULL); + /* add a uri */ + add_uri(__FILE__,__LINE__,&cfg,"ldap://localhost"); + assert(cfg.ldc_uris[0].uri!=NULL); + assert(cfg.ldc_uris[1].uri==NULL); + /* add some more uris */ + for (i=1;i +#include +#include +#include + +#include "common/dict.h" +#include "compat/attrs.h" + +/* Simple test that adds a few key/value pairs to the dict and the does + most operations. */ +static void test_simple(void) +{ + DICT *dict; + const char *key; + void *val; + static char *value1="value1"; + static char *value2="value2"; + static char *replace2="replace2"; + /* initialize */ + dict=dict_new(); + /* store some entries */ + dict_put(dict,"key1",value1); + dict_put(dict,"key2",value2); + dict_put(dict,"key3",dict); + dict_put(dict,"KEY2",replace2); + /* check dictionary contents */ + val=dict_get(dict,"KeY1"); + assert(val==value1); + val=dict_get(dict,"kEy2"); + assert(val==replace2); + val=dict_get(dict,"KeY3"); + assert(val==dict); + val=dict_get(dict,"key4"); + assert(val==NULL); + /* remove a key */ + dict_put(dict,"kEy3",NULL); + val=dict_get(dict,"keY3"); + assert(val==NULL); + /* loop over dictionary contents */ + dict_loop_first(dict); + while (dict_loop_next(dict,&key,&val)!=NULL) + { + assert(((val==value1)||(val==replace2))); + } + /* free dictionary */ + dict_free(dict); +} + +/* Test to insert a large number of elements in the dict. */ +static void test_lotsofelements(void) +{ + DICT *dict; + char buf[80]; + int i,r; + const char *key; + void *val; + /* initialize */ + dict=dict_new(); + /* insert a number of entries */ + for (i=0;i<1024;i++) + { + r=1+(int)(10000.0*(rand()/(RAND_MAX+1.0))); + sprintf(buf,"test%04d",r); + dict_put(dict,buf,&buf); + } + /* remove a number of entries */ + for (i=0;i<100;i++) + { + r=1+(int)(10000.0*(rand()/(RAND_MAX+1.0))); + sprintf(buf,"test%04d",r); + dict_put(dict,buf,NULL); + } + /* add some more entries */ + for (i=0;i<1024;i++) + { + r=1+(int)(10000.0*(rand()/(RAND_MAX+1.0))); + sprintf(buf,"test%04d",r); + dict_put(dict,buf,&buf); + } + /* loop over dictionary contents */ + dict_loop_first(dict); + while (dict_loop_next(dict,&key,&val)!=NULL) + { + assert(val==buf); + } + /* free dictionary */ + dict_free(dict); +} + +/* Test to insert a large number of elements in the dict. */ +static void test_readelements(const char *fname) +{ + DICT *dict; + char buf[80]; + FILE *fp; + const char *key; + void *val; + /* initialize */ + dict=dict_new(); + /* read file and insert all entries */ + fp=fopen(fname,"r"); + assert(fp!=NULL); + while (fgets(buf,sizeof(buf),fp)!=NULL) + { + /* strip newline */ + buf[strlen(buf)-1]='\0'; + dict_put(dict,buf,&buf); + } + fclose(fp); + /* loop over dictionary contents */ + dict_loop_first(dict); + while (dict_loop_next(dict,&key,&val)!=NULL) + { + assert(val==buf); + } + /* free dictionary */ + dict_free(dict); +} + +static void test_countelements(int num) +{ + DICT *dict; + char buf[80]; + int i,j,r; + const char *key; + void *val; + /* initialize */ + dict=dict_new(); + /* insert a number of entries */ + for (i=0;i +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printether(struct etherent *ether) +{ + printf("struct etherent {\n" + " e_name=\"%s\",\n" + " e_addr=%s\n" + "}\n", + ether->e_name,ether_ntoa(&(ether->e_addr))); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct etherent etherresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test ether_hostton() */ + printf("\nTEST ether_hostton()\n"); + res=_nss_ldap_gethostton_r("spiritus",ðerresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printether(ðerresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test ether_ntohost() */ + printf("\nTEST ether_ntohost()\n"); + res=_nss_ldap_getntohost_r(ether_aton("00:E0:4C:39:D3:6A"), + ðerresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printether(ðerresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}etherent() */ + printf("\nTEST {set,get,end}etherent()\n"); + res=_nss_ldap_setetherent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getetherent_r(ðerresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printether(ðerresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endetherent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_group.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_group.c new file mode 100644 index 0000000000..7770118fb2 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_group.c @@ -0,0 +1,119 @@ +/* + test_group.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printgroup(struct group *group) +{ + int i; + printf("struct group {\n" + " gr_name=\"%s\",\n" + " gr_passwd=\"%s\",\n" + " gr_gid=%d,\n", + group->gr_name,group->gr_passwd,(int)group->gr_gid); + for (i=0;group->gr_mem[i]!=NULL;i++) + printf(" gr_mem[%d]=\"%s\",\n", + i,group->gr_mem[i]); + printf(" gr_mem[%d]=NULL\n" + "}\n",i); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct group groupresult; + char buffer[32*1024]; + enum nss_status res; + int errnocp=0; + long int start=0,size=40; + gid_t *gidlist=(gid_t *)buffer; + + /* test getgrnam() */ + printf("\nTEST getgrnam()\n"); + res=_nss_ldap_getgrnam_r("largegroup",&groupresult,buffer,sizeof(buffer),&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printgroup(&groupresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getgrgid() */ + printf("\nTEST getgrgid()\n"); + res=_nss_ldap_getgrgid_r(100,&groupresult,buffer,sizeof(buffer),&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printgroup(&groupresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test initgroups() */ + printf("\nTEST initgroups()\n"); + res=_nss_ldap_initgroups_dyn("arthur",10,&start,&size,&gidlist,size,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + { + for (size=0;size +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printhost(struct hostent *host) +{ + int i,j; + char buffer[1024]; + printf("struct hostent {\n" + " h_name=\"%s\",\n", + host->h_name); + for (i=0;host->h_aliases[i]!=NULL;i++) + printf(" h_aliases[%d]=\"%s\",\n", + i,host->h_aliases[i]); + printf(" h_aliases[%d]=NULL,\n",i); + if (host->h_addrtype==AF_INET) + printf(" h_addrtype=AF_INET,\n"); + else if (host->h_addrtype==AF_INET6) + printf(" h_addrtype=AF_INET6,\n"); + else + printf(" h_addrtype=%d,\n",host->h_addrtype); + printf(" h_length=%d,\n",host->h_length); + for (i=0;host->h_addr_list[i]!=NULL;i++) + { + if (inet_ntop(host->h_addrtype,host->h_addr_list[i], + buffer,1024)!=NULL) + { + printf(" h_addr_list[%d]=%s,\n",i,buffer); + } + else + { + printf(" h_addr_list[%d]=",i); + for (j=0;jh_length;j++) + printf("%02x",(int)((const uint8_t*)host->h_addr_list[i])[j]); + printf(",\n"); + } + } + printf(" h_addr_list[%d]=NULL\n" + "}\n",i); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct hostent hostresult; + char buffer[1024]; + enum nss_status res; + int errnocp,h_errnocp; + char address[1024]; + + /* test gethostbyname2(AF_INET) */ + printf("\nTEST gethostbyname2(AF_INET)\n"); + res=_nss_ldap_gethostbyname2_r("oostc",AF_INET,&hostresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printhost(&hostresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } + + /* test gethostbyname2(AF_INET6) */ +/* this is currently unsupported + printf("\nTEST gethostbyname2(AF_INET6)\n"); + res=_nss_ldap_gethostbyname2_r("appelscha",AF_INET6,&hostresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printhost(&hostresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } +*/ + + /* test gethostbyaddr(AF_INET) */ + printf("\nTEST gethostbyaddr(AF_INET)\n"); + inet_pton(AF_INET,"192.43.210.81",address); + res=_nss_ldap_gethostbyaddr_r(address,sizeof(struct in_addr),AF_INET, + &hostresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printhost(&hostresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } + + /* test gethostbyaddr(AF_INET6) */ +/* this is currently unsupported + printf("\nTEST gethostbyaddr(AF_INET6)\n"); + inet_pton(AF_INET6,"2001:200:0:8002:203:47ff:fea5:3085",address); + res=_nss_ldap_gethostbyaddr_r(address,sizeof(struct in6_addr),AF_INET6, + &hostresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printhost(&hostresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } +*/ + + /* test {set,get,end}hostent() */ + printf("\nTEST {set,get,end}hostent()\n"); + res=_nss_ldap_sethostent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_gethostent_r(&hostresult,buffer,1024,&errnocp,&h_errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printhost(&hostresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + res=_nss_ldap_endhostent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.c new file mode 100644 index 0000000000..21fbae6bb5 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.c @@ -0,0 +1,425 @@ +/* + test_myldap.c - simple test for the myldap module + This file is part of the nss-ldapd library. + + Copyright (C) 2007 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nslcd/log.h" +#include "nslcd/cfg.h" +#include "nslcd/myldap.h" + +struct worker_args { + int id; +}; + +static const char *foo=""; + +/* this is a simple way to get this into an executable, + we should probably read a valid config instead */ +const char **base_get_var(int UNUSED(map)) {return NULL;} +int *scope_get_var(int UNUSED(map)) {return NULL;} +const char **filter_get_var(int UNUSED(map)) {return &foo;} +const char **attmap_get_var(int UNUSED(map),const char UNUSED(*name)) {return &foo;} + +/* the maxium number of results to print (all results are retrieved) */ +#define MAXRESULTS 10 + +/* This is a very basic search test, it performs a test to get certain + entries from the database. It currently just prints out the DNs for + the entries. */ +static void test_search(void) +{ + MYLDAP_SESSION *session; + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + const char *attrs[] = { "uid", "cn", "gid", NULL }; + int i; + int rc; + /* initialize session */ + printf("test_myldap: test_search(): getting session...\n"); + session=myldap_create_session(); + assert(session!=NULL); + /* perform search */ + printf("test_myldap: test_search(): doing search...\n"); + search=myldap_search(session,nslcd_cfg->ldc_base, + LDAP_SCOPE_SUBTREE, + "(objectclass=posixAccount)", + attrs); + assert(search!=NULL); + /* go over results */ + printf("test_myldap: test_search(): get results...\n"); + for (i=0;(entry=myldap_get_entry(search,&rc))!=NULL;i++) + { + if (ildc_base, + LDAP_SCOPE_SUBTREE, + "(objectclass=posixGroup)", + attrs); + assert(search!=NULL); + /* go over results */ + printf("test_myldap: test_search(): get results...\n"); + for (i=0;(entry=myldap_get_entry(search,&rc))!=NULL;i++) + { + if (ildc_base, + LDAP_SCOPE_SUBTREE, + "(&(|(objectClass=posixGroup)(objectClass=groupOfUniqueNames))(cn=testgroup2))", + attrs1); + assert(search1!=NULL); + /* get one entry */ + entry=myldap_get_entry(search1,&rc); + assert(entry!=NULL); + printf("test_myldap: test_get(): got DN %s\n",myldap_get_dn(entry)); + /* get some attribute values */ + (void)myldap_get_values(entry,"gidNumber"); + (void)myldap_get_values(entry,"userPassword"); + (void)myldap_get_values(entry,"memberUid"); + (void)myldap_get_values(entry,"uniqueMember"); + /* perform another search */ + printf("test_myldap: test_get(): doing get...\n"); + search2=myldap_search(session,"cn=Test User2,ou=people,dc=test,dc=tld", + LDAP_SCOPE_BASE, + "(objectclass=posixAccount)", + attrs2); + assert(search2!=NULL); + /* get one entry */ + entry=myldap_get_entry(search2,&rc); + assert(entry!=NULL); + printf("test_myldap: test_get(): got DN %s\n",myldap_get_dn(entry)); + /* test if searches are ok */ + assert(myldap_get_entry(search1,&rc)==NULL); + assert(myldap_get_entry(search2,&rc)==NULL); + /* clean up */ + myldap_session_close(session); +} + +/* This search prints a number of attributes from a search */ +static void test_get_values(void) +{ + MYLDAP_SESSION *session; + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + const char *attrs[] = { "uidNumber", "cn", "gidNumber", "uid", "objectClass", NULL }; + const char **vals; + const char *rdnval; + int i; + /* initialize session */ + printf("test_myldap: test_get_values(): getting session...\n"); + session=myldap_create_session(); + assert(session!=NULL); + /* perform search */ + search=myldap_search(session,nslcd_cfg->ldc_base, + LDAP_SCOPE_SUBTREE, + "(&(objectClass=posixAccount)(uid=*))", + attrs); + assert(search!=NULL); + /* go over results */ + for (i=0;(entry=myldap_get_entry(search,NULL))!=NULL;i++) + { + if (ildc_base, + LDAP_SCOPE_SUBTREE, + "(&(objectClass=posixAccount)(uid=*))", + attrs); + assert(search1!=NULL); + /* get a result from search1 */ + entry=myldap_get_entry(search1,NULL); + assert(entry!=NULL); + printf("test_myldap: test_two_searches(): [search1] DN %s\n",myldap_get_dn(entry)); + vals=myldap_get_values(entry,"cn"); + assert((vals!=NULL)&&(vals[0]!=NULL)); + printf("test_myldap: test_two_searches(): [search1] cn=%s\n",vals[0]); + /* start a second search */ + search2=myldap_search(session,nslcd_cfg->ldc_base, + LDAP_SCOPE_SUBTREE, + "(&(objectclass=posixGroup)(gidNumber=*))", + attrs); + assert(search2!=NULL); + /* get a result from search2 */ + entry=myldap_get_entry(search2,NULL); + assert(entry!=NULL); + printf("test_myldap: test_two_searches(): [search2] DN %s\n",myldap_get_dn(entry)); + vals=myldap_get_values(entry,"cn"); + assert((vals!=NULL)&&(vals[0]!=NULL)); + printf("test_myldap: test_two_searches(): [search2] cn=%s\n",vals[0]); + /* get another result from search1 */ + entry=myldap_get_entry(search1,NULL); + assert(entry!=NULL); + printf("test_myldap: test_two_searches(): [search1] DN %s\n",myldap_get_dn(entry)); + vals=myldap_get_values(entry,"cn"); + assert((vals!=NULL)&&(vals[0]!=NULL)); + printf("test_myldap: test_two_searches(): [search1] cn=%s\n",vals[0]); + /* stop search1 */ + myldap_search_close(search1); + /* get another result from search2 */ + entry=myldap_get_entry(search2,NULL); + assert(entry!=NULL); + printf("test_myldap: test_two_searches(): [search2] DN %s\n",myldap_get_dn(entry)); + vals=myldap_get_values(entry,"cn"); + assert((vals!=NULL)&&(vals[0]!=NULL)); + printf("test_myldap: test_two_searches(): [search2] cn=%s\n",vals[0]); + /* clean up */ + myldap_session_close(session); +} + +/* perform a simple search */ +static void *worker(void *arg) +{ + MYLDAP_SESSION *session; + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + const char *attrs[] = { "uid", "cn", "gid", NULL }; + struct worker_args *args=(struct worker_args *)arg; + int i; + int rc; + /* initialize session */ + session=myldap_create_session(); + assert(session!=NULL); + /* perform search */ + search=myldap_search(session,nslcd_cfg->ldc_base, + LDAP_SCOPE_SUBTREE, + "(objectclass=posixAccount)", + attrs); + assert(search!=NULL); + /* go over results */ + for (i=0;(entry=myldap_get_entry(search,&rc))!=NULL;i++) + { + if (iid,i,myldap_get_dn(entry)); + else if (i==MAXRESULTS) + printf("test_myldap: test_threads(): [worker %d] ...\n",args->id); + } + printf("test_myldap: test_threads(): [worker %d] DONE: %s\n",args->id,ldap_err2string(rc)); + assert(rc==LDAP_SUCCESS); + /* clean up */ + myldap_session_close(session); + return 0; +} + +/* thread ids of all running threads */ +#define NUM_THREADS 5 +pthread_t my_threads[NUM_THREADS]; + +static void test_threads(void) +{ + int i; + struct worker_args args[NUM_THREADS]; + /* start worker threads */ + for (i=0;ildc_uris[i].uri; + nslcd_cfg->ldc_uris[i].uri=NULL; + } + /* set new URIs */ + i=0; + nslcd_cfg->ldc_uris[i++].uri="ldapi://%2fdev%2fnull/"; + nslcd_cfg->ldc_uris[i++].uri="ldap://10.10.10.10/"; + nslcd_cfg->ldc_uris[i++].uri="ldapi://%2fdev%2fnonexistent/"; + nslcd_cfg->ldc_uris[i++].uri="ldap://nosuchhost/"; + nslcd_cfg->ldc_uris[i++].uri=NULL; + /* initialize session */ + printf("test_myldap: test_connections(): getting session...\n"); + session=myldap_create_session(); + assert(session!=NULL); + /* perform search */ + printf("test_myldap: test_connections(): doing search...\n"); + search=myldap_search(session,nslcd_cfg->ldc_base, + LDAP_SCOPE_SUBTREE, + "(objectclass=posixAccount)", + attrs); + assert(search==NULL); + /* clean up */ + myldap_session_close(session); + /* restore the old URIs */ + for (i=0;i<(NSS_LDAP_CONFIG_URI_MAX+1);i++) + nslcd_cfg->ldc_uris[i].uri=old_uris[i]; +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + char *srcdir; + char fname[100]; + struct sigaction act; + /* build the name of the file */ + srcdir=getenv("srcdir"); + if (srcdir==NULL) + srcdir="."; + snprintf(fname,sizeof(fname),"%s/nss-ldapd-test.conf",srcdir); + fname[sizeof(fname)-1]='\0'; + /* initialize configuration */ + cfg_init(fname); + /* partially initialize logging */ + log_setdefaultloglevel(LOG_DEBUG); + /* ignore SIGPIPE */ + memset(&act,0,sizeof(struct sigaction)); + act.sa_handler=SIG_IGN; + sigemptyset(&act.sa_mask); + act.sa_flags=SA_RESTART|SA_NOCLDSTOP; + assert(sigaction(SIGPIPE,&act,NULL)==0); + /* do tests */ + test_search(); + test_get(); + test_get_values(); + test_get_rdnvalues(); + test_two_searches(); + test_threads(); + test_connections(); + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.sh b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.sh new file mode 100755 index 0000000000..b7f89db2e0 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_myldap.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# test_myldap.sh - simple wrapper test script for test_myldap +# +# Copyright (C) 2007 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +# This script expects to be run in an environment where an LDAP server +# is available at the location specified in nss-ldapd-test.conf in +# this directory. + +set -e + +# get LDAP config +srcdir="${srcdir-"."}" +cfgfile="$srcdir/nss-ldapd-test.conf" +uri=`sed -n 's/^uri *//p' "$cfgfile" | head -n 1` +base="dc=test,dc=tld" + +# try to fetch the base DN (fail with exit 77 to indicate problem) +ldapsearch -b "$base" -s base -x -H "$uri" > /dev/null 2>&1 || { + echo "test_myldap.sh: LDAP server $uri not available for $base" + exit 77 +} +echo "test_myldap.sh: using LDAP server $uri" + +# just execute test_myldap +exec ./test_myldap diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_netgroup.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_netgroup.c new file mode 100644 index 0000000000..4b9558c4c9 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_netgroup.c @@ -0,0 +1,99 @@ +/* + test_netgroup.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printnetgroup(struct __netgrent *netgroup) +{ + printf("struct __netgrent {\n"); + if (netgroup->type==triple_val) + { + printf(" type=triple_val,\n"); + if (netgroup->val.triple.host==NULL) + printf(" val.triple.host=NULL,\n"); + else + printf(" val.triple.host=\"%s\",\n",netgroup->val.triple.host); + if (netgroup->val.triple.user==NULL) + printf(" val.triple.user=NULL,\n"); + else + printf(" val.triple.user=\"%s\",\n",netgroup->val.triple.user); + if (netgroup->val.triple.domain==NULL) + printf(" val.triple.domain=NULL,\n"); + else + printf(" val.triple.domain=\"%s\",\n",netgroup->val.triple.domain); + } + else + { + printf(" type=triple_val,\n" + " val.group=\"%s\",\n", + netgroup->val.group); + } + printf(" ...\n" + "}\n"); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct __netgrent netgroupresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test {set,get,end}netgrent() */ + printf("\nTEST {set,get,end}netgrent()\n"); + res=_nss_ldap_setnetgrent("westcomp",&netgroupresult); + printf("status=%s\n",nssstatus(res)); + while ((_nss_ldap_getnetgrent_r(&netgroupresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printnetgroup(&netgroupresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endnetgrent(&netgroupresult); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_networks.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_networks.c new file mode 100644 index 0000000000..eda1c81700 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_networks.c @@ -0,0 +1,113 @@ +/* + test_networks.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printnetwork(struct netent *network) +{ + int i; + printf("struct netent {\n" + " n_name=\"%s\",\n", + network->n_name); + for (i=0;network->n_aliases[i]!=NULL;i++) + printf(" n_aliases[%d]=\"%s\",\n", + i,network->n_aliases[i]); + printf(" n_aliases[%d]=NULL,\n",i); + if (network->n_addrtype==AF_INET) + printf(" n_addrtype=AF_INET,\n"); + else if (network->n_addrtype==AF_INET6) + printf(" n_addrtype=AF_INET6,\n"); + else + printf(" n_addrtype=%d,\n",network->n_addrtype); + printf(" n_net=%s\n" + "}\n",inet_ntoa(inet_makeaddr(network->n_net,0))); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct netent netresult; + char buffer[1024]; + enum nss_status res; + int errnocp,h_errnocp; + + /* test getnetbyname() */ + printf("\nTEST getnetbyname()\n"); + res=_nss_ldap_getnetbyname_r("west",&netresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printnetwork(&netresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } + + /* test getnetbyaddr() */ + printf("\nTEST getnetbyaddr()\n"); + res=_nss_ldap_getnetbyaddr_r(inet_network("192.43.210.0"),AF_INET,&netresult,buffer,1024,&errnocp,&h_errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printnetwork(&netresult); + else + { + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + } + + /* test {set,get,end}netent() */ + printf("\nTEST {set,get,end}netent()\n"); + res=_nss_ldap_setnetent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getnetent_r(&netresult,buffer,1024,&errnocp,&h_errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printnetwork(&netresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + printf("h_errno=%d:%s\n",(int)h_errnocp,hstrerror(h_errnocp)); + res=_nss_ldap_endnetent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nslcd_group.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nslcd_group.c new file mode 100644 index 0000000000..76ffb8bd3d --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nslcd_group.c @@ -0,0 +1,135 @@ +/* + test_nslcd_group.c - simple tests of developed lookup code + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include + +#include "common/tio.h" +#include "nslcd/myldap.h" + +/* include group code because we want to test static methods */ +#include "nslcd/group.c" + +static void test_isvalidgroupname(void) +{ + assert(isvalidgroupname("foo")); + assert(!isvalidgroupname("foo^")); + assert(!isvalidgroupname("-foo")); + assert(isvalidgroupname("foo-bar")); +} + +static void test_group_all(MYLDAP_SESSION *session,TFILE *fp) +{ + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + int rc; + /* build the list of attributes */ + group_init(); + /* do the LDAP search */ + search=myldap_search(session,group_base,group_scope,group_filter,group_attrs); + assert(search!=NULL); + /* go over results */ + while ((entry=myldap_get_entry(search,&rc))!=NULL) + { + if (write_group(fp,entry,NULL,NULL,1,session)) + return; + } +} + +static void test_group_byname(MYLDAP_SESSION *session,TFILE *fp,const char *name) +{ + MYLDAP_SEARCH *search; + MYLDAP_ENTRY *entry; + int rc; + char filter[1024]; + /* build the list of attributes */ + group_init(); + /* build the filter */ + mkfilter_group_byname(name,filter,sizeof(filter)); + /* do the LDAP search */ + search=myldap_search(session,group_base,group_scope,filter,group_attrs); + assert(search!=NULL); + /* go over results */ + while ((entry=myldap_get_entry(search,&rc))!=NULL) + { + if (write_group(fp,entry,NULL,NULL,1,session)) + return; + } +} + +static void initconfig(void) +{ + char *srcdir; + char fname[100]; + /* build the name of the file to read */ + srcdir=getenv("srcdir"); + if (srcdir==NULL) + strcpy(fname,"nss-ldapd-test.conf"); + else + snprintf(fname,sizeof(fname),"%s/nss-ldapd-test.conf",srcdir); + fname[sizeof(fname)-1]='\0'; + /* load config file */ + cfg_init(fname); + /* partially initialize logging */ + log_setdefaultloglevel(LOG_DEBUG); +} + +static TFILE *opendummyfile(void) +{ + int fd; + struct timeval timeout; + /* set the timeout */ + timeout.tv_sec=2; + timeout.tv_usec=0; + /* open the file for writing the result data */ + fd=open("/dev/null",O_RDWR,0); + assert(fd>=0); + return tio_fdopen(fd,&timeout,&timeout,1024,2*1024,1024,2*1024); +} + +/* the main program... */ +int main(int UNUSED(argc),char UNUSED(*argv[])) +{ + MYLDAP_SESSION *session; + TFILE *fp; + /* initialize configuration */ + initconfig(); + /* initialize session */ + session=myldap_create_session(); + assert(session!=NULL); + /* get a stream */ + fp=opendummyfile(); + assert(fp!=NULL); + /* perform tests */ + test_isvalidgroupname(); + test_group_byname(session,fp,"testgroup"); + test_group_byname(session,fp,"testgroup2"); + test_group_all(session,fp); + /* close session */ + myldap_session_close(session); + tio_close(fp); + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nsscmds.sh b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nsscmds.sh new file mode 100755 index 0000000000..d988e4a33d --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_nsscmds.sh @@ -0,0 +1,379 @@ +#!/bin/sh + +# test.sh - simple test script to check output of name lookup commands +# +# Copyright (C) 2007, 2008 Arthur de Jong +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301 USA + +# This script expects to be run in an environment where nss-ldapd +# is deployed with an LDAP server with the proper contents (nslcd running). +# FIXME: update the above description and provide actual LDIF file +# It's probably best to run this in an environment without nscd. + +# note that nscd should not be running (breaks services test) + +set -e + +# check if LDAP is configured correctly +cfgfile="/etc/nss-ldapd.conf" +if [ -r "$cfgfile" ] +then + : +else + echo "test_nsscmds.sh: $cfgfile: not found" + exit 77 +fi + +uri=`sed -n 's/^uri *//p' "$cfgfile" | head -n 1` +base="dc=test,dc=tld" + +# try to fetch the base DN (fail with exit 77 to indicate problem) +ldapsearch -b "$base" -s base -x -H "$uri" > /dev/null 2>&1 || { + echo "test_nsscmds.sh: LDAP server $uri not available for $base" + exit 77 +} + +# basic check to see if nslcd is running +if [ -S /var/run/nslcd/socket ] && \ + [ -f /var/run/nslcd/nslcd.pid ] && \ + kill -s 0 `cat /var/run/nslcd/nslcd.pid` > /dev/null 2>&1 +then + : +else + echo "test_nsscmds.sh: nslcd not running" + exit 77 +fi + +# TODO: check if nscd is running + +# TODO: check if /etc/nsswitch.conf is correct + +echo "test_nsscmds.sh: using LDAP server $uri" + +# the total number of errors +FAIL=0 + +check() { + # the command to execute + cmd="$1" + # save the expected output + expectfile=`mktemp -t expected.XXXXXX 2> /dev/null || tempfile -s .expected 2> /dev/null` + cat > "$expectfile" + # run the command + echo 'test_nsscmds.sh: checking "'"$cmd"'"' + actualfile=`mktemp -t actual.XXXXXX 2> /dev/null || tempfile -s .actual 2> /dev/null` + eval "$cmd" > "$actualfile" 2>&1 || true + # check for differences + diff -Nauwi "$expectfile" "$actualfile" || FAIL=`expr $FAIL + 1` + # remove temporary files + rm "$expectfile" "$actualfile" +} + +########################################################################### + +echo "test_nsscmds.sh: testing aliases..." + +# check all aliases +check "getent aliases|sort" << EOM +bar2: foobar@example.com +bar: foobar@example.com +foo: bar@example.com +EOM + +# get alias by name +check "getent aliases foo" << EOM +foo: bar@example.com +EOM + +# get alias by second name +check "getent aliases bar2" << EOM +bar2: foobar@example.com +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing ether..." + +# get an entry by hostname +check "getent ethers testhost" << EOM +0:18:8a:54:1a:8e testhost +EOM + +# get an entry by alias name +check "getent ethers testhostalias" << EOM +0:18:8a:54:1a:8e testhostalias +EOM + +# get an entry by ethernet address +check "getent ethers 0:18:8a:54:1a:8b" << EOM +0:18:8a:54:1a:8b testhost2 +EOM + +# get entry by ip address +# this does not currently work, but maybe it should +#check "getent ethers 10.0.0.1" << EOM +#0:18:8a:54:1a:8e testhost +#EOM + +# get all ethers (unsupported) +check "getent ethers" << EOM +Enumeration not supported on ethers +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing group..." + +check "getent group testgroup" << EOM +testgroup:*:6100:arthur,test +EOM + +# this does not work because users is in /etc/group but it would +# be nice if libc supported this +#check "getent group users" << EOM +#users:*:100:arthur,test +#EOM + +check "getent group 6100" << EOM +testgroup:*:6100:arthur,test +EOM + +check "groups arthur | sed 's/^.*://'" << EOM +users testgroup testgroup2 +EOM + +check "getent group | egrep '^(testgroup|users):'" << EOM +users:x:100: +testgroup:*:6100:arthur,test +users:*:100:arthur,test +EOM + +check "getent group | wc -l" << EOM +`grep -c : /etc/group | awk '{print $1 + 5}'` +EOM + +check "getent group | grep ^largegroup" << EOM +largegroup:*:1005:oebrani,hpaek,enastasi,sgurski,hsweezer,utrezize,ihashbarger,lkhubba,rlatessa,behrke,kbradbury,hmachesky,hhydrick,dciviello,wselim,ngata,gcubbison,testusr2,hgalavis,hhaffey,testusr3,yautin,wvalcin,jyeater,slaforge,vpender,lvittum,hpolk,rkoonz,ngullett,btempel,igurwell,rworkowski,phaye,lbuchtel,nfunchess,fcunard,cmanno,nfilipek,dfirpo,vdelnegro,hzagami,htomlinson,khathway,gzuhlke,wworf,tabdelal,mjuris,okveton,dbye,wbrettschneide,kklavetter,ndipanfilo,psowa,osaines,uschweyen,vwaltmann,nkraker,dgivliani,purquilla,otrevor,ghanauer,oclunes,gdreitzler,gdaub,nroepke,mciaccia,tpaa,gtinnel,tfalconeri,cjody,vmigliori,vleyton,alat,znightingale,showe,zwinterbottom,lgandee,vmedici,lseehafer,gpomerance,mbodley,bdevera,bmoldan,akraskouskas,pdossous,sdebry,gsusoev,gvollrath,nriofrio,mblanchet,lmauracher,dgosser,ameisinger,clouder,ykisak,emcquiddy,zgingrich,vchevalier,nrybij +EOM + +check "getent group largegroup" << EOM +largegroup:*:1005:oebrani,hpaek,enastasi,sgurski,hsweezer,utrezize,ihashbarger,lkhubba,rlatessa,behrke,kbradbury,hmachesky,hhydrick,dciviello,wselim,ngata,gcubbison,testusr2,hgalavis,hhaffey,testusr3,yautin,wvalcin,jyeater,slaforge,vpender,lvittum,hpolk,rkoonz,ngullett,btempel,igurwell,rworkowski,phaye,lbuchtel,nfunchess,fcunard,cmanno,nfilipek,dfirpo,vdelnegro,hzagami,htomlinson,khathway,gzuhlke,wworf,tabdelal,mjuris,okveton,dbye,wbrettschneide,kklavetter,ndipanfilo,psowa,osaines,uschweyen,vwaltmann,nkraker,dgivliani,purquilla,otrevor,ghanauer,oclunes,gdreitzler,gdaub,nroepke,mciaccia,tpaa,gtinnel,tfalconeri,cjody,vmigliori,vleyton,alat,znightingale,showe,zwinterbottom,lgandee,vmedici,lseehafer,gpomerance,mbodley,bdevera,bmoldan,akraskouskas,pdossous,sdebry,gsusoev,gvollrath,nriofrio,mblanchet,lmauracher,dgosser,ameisinger,clouder,ykisak,emcquiddy,zgingrich,vchevalier,nrybij +EOM + +check "getent group | grep ^hugegroup" << EOM +hugegroup:*:1006:amccroskey,erathert,rrasual,mlinak,psiroky,ichewning,dtuholski,yautin,denriquez,yolivier,tnitzel,kmuros,ppedraja,mrizer,jsweezy,nriofrio,joligee,klitehiser,emcquiddy,gallanson,dbertels,tcossa,hhagee,blovig,ebattee,khartness,nforti,kfend,sgunder,wesguerra,yduft,jzych,edrinkwater,esonia,pphuaphes,ualway,tmysinger,tnaillon,ygockel,sbettridge,clapenta,igizzi,svogler,pbrentano,emanikowski,uwalpole,kwinterling,ghumbles,lparrish,ewilles,oebrani,gdrilling,wtruman,ggillim,phyer,hholyfield,epoinelli,nagerton,wbrill,bswantak,bdadds,vstirman,hbukovsky,lgadomski,sskyers,ddeguire,ekalfas,tbagne,yeven,rdubs,wvalcin,mdoering,rfidel,hkippes,lmichaud,vburton,charriman,hkarney,mswogger,klundsten,nciucci,rpastorin,tcacal,rramirez,thelfritz,hschoepfer,sdebry,vbaldasaro,asivley,vpender,akravetz,llarmore,vmaynard,lmcgeary,rheinzmann,kthede,gcummer,opoch,akertzman,ngrowney,lsobrino,hveader,jspohn,cabare,hrenart,sbrabyn,ohatto,hbrandow,dhammontree,kwidrick,ascovel,jskafec,uslavinski,imcbay,wclokecloak,cflenner,hbastidos,lcaudell,gcarlini,opuglisi,nbugtong,hbetterman,lshilling,nfunchess,nlainhart,kconkey,ktuccio,mcontreras,dasiedu,cbotdorf,rchevrette,mgavet,hchaviano,zwinterbottom,fthein,zculp,bdominga,dlargo,hbickford,lrandall,ykimbel,lautovino,cfasone,hdoiel,ediga,hmatonak,fmilsaps,amckinney,mquigg,mvanpelt,daubert,dgiacomazzi,hhysong,svielle,zanderlik,mpizzaro,bromano,kmarzili,uweyand,smullowney,rbernhagen,ajaquess,ekeuper,lbove,greiff,uransford,ewicks,cpentreath,kepps,uhayakawa,tmccamish,rdubuisson,dtashjian,ibreitbart,ffigert,ycostaneda,kmedcaf,fgrashot,tredfearn,nedgin,mrydelek,tsowells,ilamberth,hhartranft,dsharr,oport,areid,bbeckfield,bluellen,fagro,ihegener,sackles,fparness,lvaleriano,faleo,fbielecki,jeuresti,lcavez,nerbach,tschnepel,zkutchera,limbrogno,nkubley,afredin,gwaud,bmoling,rschkade,kfaure,vtresch,ekurter,estockwin,rgoonez,erostad,nrysavy,hhaffey,apurdon,llasher,jholzmiller,ashuey,rbillingsly,osaber,asemons,edurick,tgindhart,svongal,mvedder,jvillaire,dholdaway,bbrenton,lpitek,jjumalon,kjoslyn,cparee,cklem,mcoch,kmcardle,dsteever,nlemma,rfauerbach,wnunziata,fsirianni,dciullo,udatu,cjody,mvas,hkinderknecht,cpencil,rmcstay,tboxx,brodgerson,mfeil,eberkman,gdeblasio,hspiry,ilevian,wdagrella,bharnois,sscheiern,vbigalow,nschmig,pwohlenhaus,uflander,ckodish,amcgraw,cswigert,mcampagnone,inarain,kmcguire,tharr,bdaughenbaugh,garchambeault,bmarszalek,pvirelli,snotari,nspolar,skanjirathinga,fsunderland,mmesidor,lmuehlberger,glafontaine,aferge,hcarrizal,pdurando,gdeyarmond,fmarchi,wstjean,obeaufait,nslaby,dlongbotham,tplatko,jcaroll,isplonskowski,zscammahorn,sstuemke,cnoriego,nsiemonsma,lseabold,cmafnas,dhendon,bfishbeck,gkerens,eklunder,fburrough,ebusk,tmarkus,clouder,cweiss,mpellew,ojerabek,veisenhardt,vwokwicz,tvrooman,rpitter,slerew,dwittlinger,habby,mpanahon,rguinane,zneeb,eyounglas,gcervantez,kbrugal,ycobetto,tkeala,pheathcock,cmellberg,hmiazga,bmicklos,bphou,ngullett,jwinterton,lcremer,jmartha,icoard,ahandy,eparham,gtinnel,wganther,umarbury,fhalon,bsibal,uschweyen,gearnshaw,cbleimehl,omasone,cdeckard,ctetteh,arosel,pmineo,gclapham,jamber,sbonnie,eaguire,jmarugg,ihalford,wdovey,sarndt,gbitar,ovibbert,ewismer,gmilian,rginer,gdaub,showe,hlynema,rtooker,svandewalle,fhain,jlunney,jreigh,kmandolfo,leberhardt,wkhazaleh,nasmar,egrago,ablackstock,lcocherell,pvierthaler,vrunyon,kpalka,ubenken,hmuscaro,jherkenratt,pminnis,bscadden,srubenfield,cnabzdyk,mpytko,gchounlapane,pwademan,nousdahl,pcornn,zmeeker,hpalmquist,jrees,mkofoed,mkibler,lbassin,fplayfair,hmogush,nvyhnal,ileaman,gschaumburg,thoch,wconces,hliverman,gmackinder,rbrisby,isowder,rkraszewski,hzagami,obihl,nhelfinstine,mbravata,thynson,vwaltmann,tlana,ggehrke,pwutzke,zbuscaglia,ewuitschick,hgalavis,ddigerolamo,wmendell,etunby,jkimpton,mheilbrun,laksamit,hvannette,jseen,sgurski,iroiger,lcanestrini,baigner,dminozzi,uazatyan,gjankowiak,bstrede,mstirn,hfludd,mdyce,tbattista,gfaire,gapkin,esproull,gcurnutt,tstalworth,ienglert,hbrehmer,csoomaroo,kaanerud,nlinarez,jeverton,uspittler,prowena,gsantella,oreiss,rcheshier,tpaa,kwirght,gparkersmith,jquicksall,xrahaim,vwisinger,aesbensen,eorsten,imensah,omalvaez,dnegri,wmailey,tyounglas,vtowell,pgrybel,lmauracher,lschollmeier,ithum,umosser,pbeckerdite,hsabol,dhindsman,ugerpheide,gconver,lhuggler,amanganelli,omatula,zhaulk,lkimel,mruppel,egospatrick,kseisler,ehindbaugh,mdecourcey,kbartolet,vcrofton,cdegravelle,ksiering,fvallian,kalguire,dblazejewski,vdesir,tairth,hcusta,mjeon,smccaie,hpolintan,ihimmelwright,fbeatrice,yvdberg,uednilao,vmedici,sskone,dbarriball,ndrumgole,ccyganiewicz,cdrumm,usevera,vsefcovic,mfitzherbert,fberyman,upater,vpiraino,pwashuk,kshippy,bcolorado,cbarlup,cmiramon,kdevincent,mcaram,cbourek,hkohlmeyer,lringuette,lgradilla,slaningham,ksparling,tcrissinger,senrico,dlanois,iyorks,gbolay,rpikes,hcafourek,shaith,fverfaille,btheim,iambrosino,ghann,fkeef,tsearle,tsepulueda,iherrarte,fvinal,sherzberg,iiffert,astrunk,ghelderman,moller,gmassi,oahyou,cjuntunen,mvanbergen,tkelly,eziebert,nhija,sjankauskas,pdech,mmangiamele,clewicki,meconomides,tmccaffity,carguellez,prepasky,amaslyn,kmallach,ejeppesen,hwoodert,dgivliani,nglathar,fwidhalm,kheadlon,ihernan,oshough,nevan,mpilon,mviverette,beon,alat,ktriblett,ivanschaack,vnazzal,lwedner,alienhard,slaudeman,cpalmios,gishii,kpuebla,ascheno,ocrabbs,dledenbach,ebeachem,ideveyra,sspagnuolo,fsymmonds,srees,isteinlicht,bveeneman,myokoyama,agordner,xlantey,broher,bpinedo,psharits,iweibe,nchrisman,htomlinson,cdickes,draymundo,jbielicki,ulanigan,ihanneman,ppeper,ljomes,khovanesian,ibeto,ilacourse,iseipel,iogasawara,jglotzbecker,mferandez,gpomerance,pdulac,mgayden,skoegler,kbattershell,uvanmatre,wvermeulen,ekenady,ikulbida,htsuha,lvanconant,njordon,oosterhouse,tmelland,lspielvogel,bmarlin,bouten,fgoben,bjolly,iyorgey,htilzer,dgosser,gcobane,vpeairs,dloubier,zfarler,fvascones,awhitt,cscullion,nkempon,rgriffies,wconstantino,opizzuti,scocuzza,pgreenier,ueriks,cwank,mdanos,kmisove,ndesautels,hlichota,cgalinol,rlambertus,zvagt,ohoffert,vchevalier,vwabasha,amayorga,mtintle,rbloomstrand,swoodie,gportolese,hriech,ckerska,gvollrath,bdevera,lmadruga,mbeagley,hdyner,fcha,rlatessa,lsivic,mdedon,mcashett,ubynum,lcoulon,cbrechbill,kgremminger,yfrymoyer,pahles,guresti,kmayoras,mbodley,phalkett,kolexa,fsapien,cghianni,oalthouse,mpark,mlenning,gfedewa,imicthell,farquette,nhayer,vglidden,tkhora,mneubacher,esthill,ecolden,nnamanworth,eklein,pgiegerich,smillian,nmccolm,ameisinger,rtole,jsegundo,jknight,behrke,tguinnip,wlynch,tmorr,omcdaid,dfollman,kmosko,mground,pfavolise,dfirpo,aponcedeleon,wenglander,pduitscher,emehta,lyoula,bmadamba,critchie,gloebs,jscheitlin,tsann,tmalecki,okave,dsherard,wdevenish,dmahapatra,redling,venfort,hstreitnatter,tfetherston,jsenavanh,mmerriwether,pbondroff,tabdelal,badair,bhelverson,jlebouf,tfalconeri,sgefroh,mredd,wselim,ikadar,nrybij,eathey,pschrayter,gmings,xeppley,hrapisura,tdonathan,bcoletta,mdickinson,vdolan,pbiggart,ibyles,kcomparoni,jmatty,psundeen,imarungo,cmcanulty,tmcmickle,obenallack,qhanly,saben,owhitelow,dtornow,btempel,agimm,cpluid,ktoni,rlosinger,fnottage,mfaeth,tmurata,fcunard,saycock,mmcchristian,mcasida,kmoesch,kottomaniello,bwynes,emargulis,kbarnthouse,psalesky,mlinardi,fberra,cgaudette,sestergard,afuchs,esheehan,dscheurer,sgropper,jbjorkman,dflore,vbonder,nnickel,klurie,hmateer,lseehafer,cpinela,maustine,zratti,ohove,okveton,mhollings,vrodick,nwescott,mtanzi,ktuner,yschmuff,akraskouskas,lschnorbus,dmcgillen,aziernicki,wleiva,nendicott,kcofrancesco,cmanno,deshmon,adenicola,hlauchaire,mlaverde,kpenale,dmarchizano,pviviani,vemily,agarbett,ohedlund,werrick,imillin,oconerly,wottesen,kmeester,nwiker,nranck,jroman,cspilis,mallmand,yhenriques,nphan,nbuford,nlohmiller,istallcup,hzinda,atollefsrud,spolmer,purquilla,bgavagan,nramones,lnormand,adishaw,jdodge,moser,urosentrance,oclunes,lpeagler,ubieniek,sgirsh,dzurek,hlemon,pwetherwax,wcreggett,kgarced,pthornberry,nmoren,gcukaj,lbuchtel,dcaltabiano,ibuzo,akomsthoeft,upellam,ptraweek,abortignon,ralspach,pcaposole,hcintron,cbartnick,vnery,lfarraj,pwhitmire,kpannunzio,vfeigel,lpintor,tlowers,fsplinter,rfassinger,ofelcher,csever,oolivarez,kbrevitz,ctuzzo,owhelchel,ptoenjes,mskeele,lschenkelberg,tsablea,hloftis,cbelardo,ycerasoli,gmoen,obercier,cfleurantin,hbraim,ihoa,ochasten,fsavela,zborgmeyer,sbemo,mcolehour,vtrumpp,lgandee,atonkin,rpinilla,hsweezer,hwestermark,lbanco,bwinterton,hcowles,ninnella,ehathcock,uholecek,alamour,bguthary,mdimaio,lsous,ecelestin,ademosthenes,ncermeno,vkrug,ngiesler,pdauterman,achhor,hpimpare,epeterson,lfichtner,tgelen,pdischinger,nlatchaw,psabado,ecordas,dpebbles,ckistenmacher,oscarpello,hschelb,nridinger,tvehrs,lpondexter,rgramby,ocalleo,imuehl,istarring,teliades,ctenny,kstachurski,ugreenberg,cpaccione,cgaler,mmattu,opeet,sstough,dlablue,mespinel,sbloise,ohearl,cbrom,krahman,ysnock,vlubic,rmandril,eserrett,gshrode,ksollitto,ilawbaugh,jappleyard,pbascom,rnordby +EOM + +check "getent group hugegroup" << EOM +hugegroup:*:1006:amccroskey,erathert,rrasual,mlinak,psiroky,ichewning,dtuholski,yautin,denriquez,yolivier,tnitzel,kmuros,ppedraja,mrizer,jsweezy,nriofrio,joligee,klitehiser,emcquiddy,gallanson,dbertels,tcossa,hhagee,blovig,ebattee,khartness,nforti,kfend,sgunder,wesguerra,yduft,jzych,edrinkwater,esonia,pphuaphes,ualway,tmysinger,tnaillon,ygockel,sbettridge,clapenta,igizzi,svogler,pbrentano,emanikowski,uwalpole,kwinterling,ghumbles,lparrish,ewilles,oebrani,gdrilling,wtruman,ggillim,phyer,hholyfield,epoinelli,nagerton,wbrill,bswantak,bdadds,vstirman,hbukovsky,lgadomski,sskyers,ddeguire,ekalfas,tbagne,yeven,rdubs,wvalcin,mdoering,rfidel,hkippes,lmichaud,vburton,charriman,hkarney,mswogger,klundsten,nciucci,rpastorin,tcacal,rramirez,thelfritz,hschoepfer,sdebry,vbaldasaro,asivley,vpender,akravetz,llarmore,vmaynard,lmcgeary,rheinzmann,kthede,gcummer,opoch,akertzman,ngrowney,lsobrino,hveader,jspohn,cabare,hrenart,sbrabyn,ohatto,hbrandow,dhammontree,kwidrick,ascovel,jskafec,uslavinski,imcbay,wclokecloak,cflenner,hbastidos,lcaudell,gcarlini,opuglisi,nbugtong,hbetterman,lshilling,nfunchess,nlainhart,kconkey,ktuccio,mcontreras,dasiedu,cbotdorf,rchevrette,mgavet,hchaviano,zwinterbottom,fthein,zculp,bdominga,dlargo,hbickford,lrandall,ykimbel,lautovino,cfasone,hdoiel,ediga,hmatonak,fmilsaps,amckinney,mquigg,mvanpelt,daubert,dgiacomazzi,hhysong,svielle,zanderlik,mpizzaro,bromano,kmarzili,uweyand,smullowney,rbernhagen,ajaquess,ekeuper,lbove,greiff,uransford,ewicks,cpentreath,kepps,uhayakawa,tmccamish,rdubuisson,dtashjian,ibreitbart,ffigert,ycostaneda,kmedcaf,fgrashot,tredfearn,nedgin,mrydelek,tsowells,ilamberth,hhartranft,dsharr,oport,areid,bbeckfield,bluellen,fagro,ihegener,sackles,fparness,lvaleriano,faleo,fbielecki,jeuresti,lcavez,nerbach,tschnepel,zkutchera,limbrogno,nkubley,afredin,gwaud,bmoling,rschkade,kfaure,vtresch,ekurter,estockwin,rgoonez,erostad,nrysavy,hhaffey,apurdon,llasher,jholzmiller,ashuey,rbillingsly,osaber,asemons,edurick,tgindhart,svongal,mvedder,jvillaire,dholdaway,bbrenton,lpitek,jjumalon,kjoslyn,cparee,cklem,mcoch,kmcardle,dsteever,nlemma,rfauerbach,wnunziata,fsirianni,dciullo,udatu,cjody,mvas,hkinderknecht,cpencil,rmcstay,tboxx,brodgerson,mfeil,eberkman,gdeblasio,hspiry,ilevian,wdagrella,bharnois,sscheiern,vbigalow,nschmig,pwohlenhaus,uflander,ckodish,amcgraw,cswigert,mcampagnone,inarain,kmcguire,tharr,bdaughenbaugh,garchambeault,bmarszalek,pvirelli,snotari,nspolar,skanjirathinga,fsunderland,mmesidor,lmuehlberger,glafontaine,aferge,hcarrizal,pdurando,gdeyarmond,fmarchi,wstjean,obeaufait,nslaby,dlongbotham,tplatko,jcaroll,isplonskowski,zscammahorn,sstuemke,cnoriego,nsiemonsma,lseabold,cmafnas,dhendon,bfishbeck,gkerens,eklunder,fburrough,ebusk,tmarkus,clouder,cweiss,mpellew,ojerabek,veisenhardt,vwokwicz,tvrooman,rpitter,slerew,dwittlinger,habby,mpanahon,rguinane,zneeb,eyounglas,gcervantez,kbrugal,ycobetto,tkeala,pheathcock,cmellberg,hmiazga,bmicklos,bphou,ngullett,jwinterton,lcremer,jmartha,icoard,ahandy,eparham,gtinnel,wganther,umarbury,fhalon,bsibal,uschweyen,gearnshaw,cbleimehl,omasone,cdeckard,ctetteh,arosel,pmineo,gclapham,jamber,sbonnie,eaguire,jmarugg,ihalford,wdovey,sarndt,gbitar,ovibbert,ewismer,gmilian,rginer,gdaub,showe,hlynema,rtooker,svandewalle,fhain,jlunney,jreigh,kmandolfo,leberhardt,wkhazaleh,nasmar,egrago,ablackstock,lcocherell,pvierthaler,vrunyon,kpalka,ubenken,hmuscaro,jherkenratt,pminnis,bscadden,srubenfield,cnabzdyk,mpytko,gchounlapane,pwademan,nousdahl,pcornn,zmeeker,hpalmquist,jrees,mkofoed,mkibler,lbassin,fplayfair,hmogush,nvyhnal,ileaman,gschaumburg,thoch,wconces,hliverman,gmackinder,rbrisby,isowder,rkraszewski,hzagami,obihl,nhelfinstine,mbravata,thynson,vwaltmann,tlana,ggehrke,pwutzke,zbuscaglia,ewuitschick,hgalavis,ddigerolamo,wmendell,etunby,jkimpton,mheilbrun,laksamit,hvannette,jseen,sgurski,iroiger,lcanestrini,baigner,dminozzi,uazatyan,gjankowiak,bstrede,mstirn,hfludd,mdyce,tbattista,gfaire,gapkin,esproull,gcurnutt,tstalworth,ienglert,hbrehmer,csoomaroo,kaanerud,nlinarez,jeverton,uspittler,prowena,gsantella,oreiss,rcheshier,tpaa,kwirght,gparkersmith,jquicksall,xrahaim,vwisinger,aesbensen,eorsten,imensah,omalvaez,dnegri,wmailey,tyounglas,vtowell,pgrybel,lmauracher,lschollmeier,ithum,umosser,pbeckerdite,hsabol,dhindsman,ugerpheide,gconver,lhuggler,amanganelli,omatula,zhaulk,lkimel,mruppel,egospatrick,kseisler,ehindbaugh,mdecourcey,kbartolet,vcrofton,cdegravelle,ksiering,fvallian,kalguire,dblazejewski,vdesir,tairth,hcusta,mjeon,smccaie,hpolintan,ihimmelwright,fbeatrice,yvdberg,uednilao,vmedici,sskone,dbarriball,ndrumgole,ccyganiewicz,cdrumm,usevera,vsefcovic,mfitzherbert,fberyman,upater,vpiraino,pwashuk,kshippy,bcolorado,cbarlup,cmiramon,kdevincent,mcaram,cbourek,hkohlmeyer,lringuette,lgradilla,slaningham,ksparling,tcrissinger,senrico,dlanois,iyorks,gbolay,rpikes,hcafourek,shaith,fverfaille,btheim,iambrosino,ghann,fkeef,tsearle,tsepulueda,iherrarte,fvinal,sherzberg,iiffert,astrunk,ghelderman,moller,gmassi,oahyou,cjuntunen,mvanbergen,tkelly,eziebert,nhija,sjankauskas,pdech,mmangiamele,clewicki,meconomides,tmccaffity,carguellez,prepasky,amaslyn,kmallach,ejeppesen,hwoodert,dgivliani,nglathar,fwidhalm,kheadlon,ihernan,oshough,nevan,mpilon,mviverette,beon,alat,ktriblett,ivanschaack,vnazzal,lwedner,alienhard,slaudeman,cpalmios,gishii,kpuebla,ascheno,ocrabbs,dledenbach,ebeachem,ideveyra,sspagnuolo,fsymmonds,srees,isteinlicht,bveeneman,myokoyama,agordner,xlantey,broher,bpinedo,psharits,iweibe,nchrisman,htomlinson,cdickes,draymundo,jbielicki,ulanigan,ihanneman,ppeper,ljomes,khovanesian,ibeto,ilacourse,iseipel,iogasawara,jglotzbecker,mferandez,gpomerance,pdulac,mgayden,skoegler,kbattershell,uvanmatre,wvermeulen,ekenady,ikulbida,htsuha,lvanconant,njordon,oosterhouse,tmelland,lspielvogel,bmarlin,bouten,fgoben,bjolly,iyorgey,htilzer,dgosser,gcobane,vpeairs,dloubier,zfarler,fvascones,awhitt,cscullion,nkempon,rgriffies,wconstantino,opizzuti,scocuzza,pgreenier,ueriks,cwank,mdanos,kmisove,ndesautels,hlichota,cgalinol,rlambertus,zvagt,ohoffert,vchevalier,vwabasha,amayorga,mtintle,rbloomstrand,swoodie,gportolese,hriech,ckerska,gvollrath,bdevera,lmadruga,mbeagley,hdyner,fcha,rlatessa,lsivic,mdedon,mcashett,ubynum,lcoulon,cbrechbill,kgremminger,yfrymoyer,pahles,guresti,kmayoras,mbodley,phalkett,kolexa,fsapien,cghianni,oalthouse,mpark,mlenning,gfedewa,imicthell,farquette,nhayer,vglidden,tkhora,mneubacher,esthill,ecolden,nnamanworth,eklein,pgiegerich,smillian,nmccolm,ameisinger,rtole,jsegundo,jknight,behrke,tguinnip,wlynch,tmorr,omcdaid,dfollman,kmosko,mground,pfavolise,dfirpo,aponcedeleon,wenglander,pduitscher,emehta,lyoula,bmadamba,critchie,gloebs,jscheitlin,tsann,tmalecki,okave,dsherard,wdevenish,dmahapatra,redling,venfort,hstreitnatter,tfetherston,jsenavanh,mmerriwether,pbondroff,tabdelal,badair,bhelverson,jlebouf,tfalconeri,sgefroh,mredd,wselim,ikadar,nrybij,eathey,pschrayter,gmings,xeppley,hrapisura,tdonathan,bcoletta,mdickinson,vdolan,pbiggart,ibyles,kcomparoni,jmatty,psundeen,imarungo,cmcanulty,tmcmickle,obenallack,qhanly,saben,owhitelow,dtornow,btempel,agimm,cpluid,ktoni,rlosinger,fnottage,mfaeth,tmurata,fcunard,saycock,mmcchristian,mcasida,kmoesch,kottomaniello,bwynes,emargulis,kbarnthouse,psalesky,mlinardi,fberra,cgaudette,sestergard,afuchs,esheehan,dscheurer,sgropper,jbjorkman,dflore,vbonder,nnickel,klurie,hmateer,lseehafer,cpinela,maustine,zratti,ohove,okveton,mhollings,vrodick,nwescott,mtanzi,ktuner,yschmuff,akraskouskas,lschnorbus,dmcgillen,aziernicki,wleiva,nendicott,kcofrancesco,cmanno,deshmon,adenicola,hlauchaire,mlaverde,kpenale,dmarchizano,pviviani,vemily,agarbett,ohedlund,werrick,imillin,oconerly,wottesen,kmeester,nwiker,nranck,jroman,cspilis,mallmand,yhenriques,nphan,nbuford,nlohmiller,istallcup,hzinda,atollefsrud,spolmer,purquilla,bgavagan,nramones,lnormand,adishaw,jdodge,moser,urosentrance,oclunes,lpeagler,ubieniek,sgirsh,dzurek,hlemon,pwetherwax,wcreggett,kgarced,pthornberry,nmoren,gcukaj,lbuchtel,dcaltabiano,ibuzo,akomsthoeft,upellam,ptraweek,abortignon,ralspach,pcaposole,hcintron,cbartnick,vnery,lfarraj,pwhitmire,kpannunzio,vfeigel,lpintor,tlowers,fsplinter,rfassinger,ofelcher,csever,oolivarez,kbrevitz,ctuzzo,owhelchel,ptoenjes,mskeele,lschenkelberg,tsablea,hloftis,cbelardo,ycerasoli,gmoen,obercier,cfleurantin,hbraim,ihoa,ochasten,fsavela,zborgmeyer,sbemo,mcolehour,vtrumpp,lgandee,atonkin,rpinilla,hsweezer,hwestermark,lbanco,bwinterton,hcowles,ninnella,ehathcock,uholecek,alamour,bguthary,mdimaio,lsous,ecelestin,ademosthenes,ncermeno,vkrug,ngiesler,pdauterman,achhor,hpimpare,epeterson,lfichtner,tgelen,pdischinger,nlatchaw,psabado,ecordas,dpebbles,ckistenmacher,oscarpello,hschelb,nridinger,tvehrs,lpondexter,rgramby,ocalleo,imuehl,istarring,teliades,ctenny,kstachurski,ugreenberg,cpaccione,cgaler,mmattu,opeet,sstough,dlablue,mespinel,sbloise,ohearl,cbrom,krahman,ysnock,vlubic,rmandril,eserrett,gshrode,ksollitto,ilawbaugh,jappleyard,pbascom,rnordby +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing hosts..." + +check "getent hosts testhost" << EOM +10.0.0.1 testhost testhostalias +EOM + +check "getent hosts testhostalias" << EOM +10.0.0.1 testhost testhostalias +EOM + +check "getent hosts 10.0.0.1" << EOM +10.0.0.1 testhost testhostalias +EOM + +check "getent hosts | grep testhost" << EOM +10.0.0.1 testhost testhostalias +EOM + +# dummy test for IPv6 envoronment +check "getent hosts ::1" << EOM +::1 ip6-localhost ip6-loopback +EOM + +# TODO: add more tests for IPv6 support + +########################################################################### + +echo "test_nsscmds.sh: testing netgroup..." + +# check netgroup lookup of test netgroup +check "getent netgroup tstnetgroup" << EOM +tstnetgroup (aap, , ) (noot, , ) +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing networks..." + +check "getent networks testnet" << EOM +testnet 10.0.0.0 +EOM + +check "getent networks 10.0.0.0" << EOM +testnet 10.0.0.0 +EOM + +check "getent networks | grep testnet" << EOM +testnet 10.0.0.0 +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing passwd..." + +check "getent passwd ecolden" << EOM +ecolden:x:5972:1000:Estelle Colden:/home/ecolden:/bin/bash +EOM + +check "getent passwd arthur" << EOM +arthur:x:1000:100:Arthur de Jong:/home/arthur:/bin/bash +EOM + +check "getent passwd 4089" << EOM +jguzzetta:x:4089:1000:Josephine Guzzetta:/home/jguzzetta:/bin/bash +EOM + +# count the number of passwd entries in the 4000-5999 range +check "getent passwd | grep -c ':x:[45][0-9][0-9][0-9]:'" << EOM +2000 +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing protocols..." + +check "getent protocols protfoo" << EOM +protfoo 140 protfooalias +EOM + +check "getent protocols protfooalias" << EOM +protfoo 140 protfooalias +EOM + +check "getent protocols 140" << EOM +protfoo 140 protfooalias +EOM + +check "getent protocols icmp" << EOM +icmp 1 ICMP +EOM + +check "getent protocols | grep protfoo" << EOM +protfoo 140 protfooalias +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing rpc..." + +check "getent rpc rpcfoo" << EOM +rpcfoo 160002 rpcfooalias +EOM + +check "getent rpc rpcfooalias" << EOM +rpcfoo 160002 rpcfooalias +EOM + +check "getent rpc 160002" << EOM +rpcfoo 160002 rpcfooalias +EOM + +check "getent rpc | grep rpcfoo" << EOM +rpcfoo 160002 rpcfooalias +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing services..." + +check "getent services foosrv" << EOM +foosrv 15349/tcp +EOM + +check "getent services foosrv/tcp" << EOM +foosrv 15349/tcp +EOM + +check "getent services foosrv/udp" << EOM +EOM + +check "getent services 15349/tcp" << EOM +foosrv 15349/tcp +EOM + +check "getent services 15349/udp" << EOM +EOM + +check "getent services barsrv" << EOM +barsrv 15350/tcp +EOM + +check "getent services barsrv/tcp" << EOM +barsrv 15350/tcp +EOM + +check "getent services barsrv/udp" << EOM +barsrv 15350/udp +EOM + +check "getent services | egrep '(foo|bar)srv' | sort" << EOM +barsrv 15350/tcp +barsrv 15350/udp +foosrv 15349/tcp +EOM + +check "getent services | wc -l" << EOM +`grep -c '^[^#].' /etc/services | awk '{print $1 + 3}'` +EOM + +########################################################################### + +echo "test_nsscmds.sh: testing shadow..." + +# NOTE: the output of this should depend on whether we are root or not + +check "getent shadow ecordas" << EOM +ecordas:*::::7:2::0 +EOM + +check "getent shadow arthur" << EOM +arthur:*::100:200:7:2::0 +EOM + +# check if the number of passwd entries matches the number of shadow entries +check "getent shadow | wc -l" << EOM +`getent passwd | wc -l` +EOM + +# check if the names of users match between passwd and shadow +getent passwd | sed 's/:.*//' | sort | \ + check "getent shadow | sed 's/:.*//' | sort" + +########################################################################### +# determine the result + +if [ $FAIL -eq 0 ] +then + echo "test_nsscmds.sh: all tests passed" + exit 0 +else + echo "test_nsscmds.sh: $FAIL TESTS FAILED" + exit 1 +fi diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_passwd.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_passwd.c new file mode 100644 index 0000000000..a221a94cbe --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_passwd.c @@ -0,0 +1,112 @@ +/* + test_passwd.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printpasswd(struct passwd *pw) +{ + printf("struct passwd {\n" + " pw_name=\"%s\",\n" + " pw_passwd=\"%s\",\n" + " pw_uid=%d,\n" + " pw_gid=%d,\n" + " pw_gecos=\"%s\",\n" + " pw_dir=\"%s\",\n" + " pw_shell=\"%s\"\n" + "}\n",pw->pw_name,pw->pw_passwd, + (int)(pw->pw_uid),(int)(pw->pw_gid), + pw->pw_gecos,pw->pw_dir,pw->pw_shell); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct passwd passwdresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getpwnam() */ + printf("\nTEST getpwnam()\n"); + res=_nss_ldap_getpwnam_r("arthur",&passwdresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printpasswd(&passwdresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getpwnam() with non-existing user */ + printf("\nTEST getpwnam() with non-existing user\n"); + res=_nss_ldap_getpwnam_r("nonexist",&passwdresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printpasswd(&passwdresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getpwuid() */ + printf("\nTEST getpwuid()\n"); + res=_nss_ldap_getpwuid_r(1004,&passwdresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printpasswd(&passwdresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}pwent() */ + printf("\nTEST {set,get,end}pwent()\n"); + res=_nss_ldap_setpwent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getpwent_r(&passwdresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printpasswd(&passwdresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endpwent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_protocols.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_protocols.c new file mode 100644 index 0000000000..4fdc92eb50 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_protocols.c @@ -0,0 +1,102 @@ +/* + test_protocols.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printproto(struct protoent *protocol) +{ + int i; + printf("struct protoent {\n" + " p_name=\"%s\",\n", + protocol->p_name); + for (i=0;protocol->p_aliases[i]!=NULL;i++) + printf(" p_aliases[%d]=\"%s\",\n", + i,protocol->p_aliases[i]); + printf(" p_aliases[%d]=NULL,\n" + " p_proto=%d\n" + "}\n",i,(int)(protocol->p_proto)); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct protoent protoresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getprotobyname() */ + printf("\nTEST getprotobyname()\n"); + res=_nss_ldap_getprotobyname_r("foo",&protoresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printproto(&protoresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getprotobynumber() */ + printf("\nTEST getprotobynumber()\n"); + res=_nss_ldap_getprotobynumber_r(10,&protoresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printproto(&protoresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}protoent() */ + printf("\nTEST {set,get,end}protoent()\n"); + res=_nss_ldap_setprotoent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getprotoent_r(&protoresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printproto(&protoresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endprotoent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_rpc.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_rpc.c new file mode 100644 index 0000000000..74900f1914 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_rpc.c @@ -0,0 +1,102 @@ +/* + test_rpc.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printrpc(struct rpcent *rpc) +{ + int i; + printf("struct rpcent {\n" + " r_name=\"%s\",\n", + rpc->r_name); + for (i=0;rpc->r_aliases[i]!=NULL;i++) + printf(" r_aliases[%d]=\"%s\",\n", + i,rpc->r_aliases[i]); + printf(" r_aliases[%d]=NULL,\n" + " r_number=%d\n" + "}\n",i,(int)(rpc->r_number)); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct rpcent rpcresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getrpcbyname() */ + printf("\nTEST getrpcbyname()\n"); + res=_nss_ldap_getrpcbyname_r("rpcfoo",&rpcresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printrpc(&rpcresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getrpcbynumber() */ + printf("\nTEST getrpcbynumber()\n"); + res=_nss_ldap_getrpcbynumber_r(7899,&rpcresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printrpc(&rpcresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}rpcent() */ + printf("\nTEST {set,get,end}rpcent()\n"); + res=_nss_ldap_setrpcent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getrpcent_r(&rpcresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printrpc(&rpcresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endrpcent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_services.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_services.c new file mode 100644 index 0000000000..8f8525a88a --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_services.c @@ -0,0 +1,104 @@ +/* + test_services.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printserv(struct servent *serv) +{ + int i; + printf("struct servent {\n" + " s_name=\"%s\",\n", + serv->s_name); + for (i=0;serv->s_aliases[i]!=NULL;i++) + printf(" s_aliases[%d]=\"%s\",\n", + i,serv->s_aliases[i]); + printf(" s_aliases[%d]=NULL,\n" + " s_port=%d,\n" + " s_proto=\"%s\"\n" + "}\n",i,(int)(ntohs(serv->s_port)), + serv->s_proto); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct servent servresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getservbyname() */ + printf("\nTEST getservbyname()\n"); + res=_nss_ldap_getservbyname_r("srvfoo","udp",&servresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printserv(&servresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test getservbyport() */ + printf("\nTEST getservbyport()\n"); + res=_nss_ldap_getservbyport_r(ntohs(9988),NULL,&servresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printserv(&servresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}servent() */ + printf("\nTEST {set,get,end}servent()\n"); + res=_nss_ldap_setservent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getservent_r(&servresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printserv(&servresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endservent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_set.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_set.c new file mode 100644 index 0000000000..ccd5891676 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_set.c @@ -0,0 +1,66 @@ +/* + test_set.c - simple test for the set module + This file is part of the nss-ldapd library. + + Copyright (C) 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include + +#include "common/set.h" +#include "compat/attrs.h" + +/* the main program... */ +int main(int UNUSED(argc),char UNUSED(*argv[])) +{ + SET *set; + const char *val; + + /* initialize */ + set=set_new(); + + /* store some entries */ + set_add(set,"key1"); + set_add(set,"key2"); + set_add(set,"key3"); + set_add(set,"KEY2"); + + /* check set contents */ + assert(set_contains(set,"KeY1")); + assert(set_contains(set,"kEy2")); + assert(set_contains(set,"KeY3")); + assert(!set_contains(set,"key4")); + + /* loop over set contents */ + set_loop_first(set); + while ((val=set_loop_next(set))!=NULL) + { + assert( (strcasecmp(val,"key1")==0) || + (strcasecmp(val,"key2")==0) || + (strcasecmp(val,"key3")==0) ); + } + + /* free set */ + set_free(set); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_shadow.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_shadow.c new file mode 100644 index 0000000000..e19184bcc7 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_shadow.c @@ -0,0 +1,97 @@ +/* + test_shadow.c - simple tests of developed nss code + + Copyright (C) 2006 West Consulting + Copyright (C) 2006 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include + +#include "nss/prototypes.h" + +static char *nssstatus(enum nss_status retv) +{ + switch(retv) + { + case NSS_STATUS_TRYAGAIN: return "NSS_STATUS_TRYAGAIN"; + case NSS_STATUS_UNAVAIL: return "NSS_STATUS_UNAVAIL"; + case NSS_STATUS_NOTFOUND: return "NSS_STATUS_NOTFOUND"; + case NSS_STATUS_SUCCESS: return "NSS_STATUS_SUCCESS"; + case NSS_STATUS_RETURN: return "NSS_STATUS_RETURN"; + default: return "NSS_STATUS_**ILLEGAL**"; + } +} + +static void printshadow(struct spwd *shadow) +{ + printf("struct spwd {\n" + " sp_namp=\"%s\",\n" + " sp_pwdp=\"%s\",\n" + " sp_lstchg=%ld,\n" + " sp_min=%ld,\n" + " sp_max=%ld,\n" + " sp_warn=%ld,\n" + " sp_inact=%ld,\n" + " sp_expire=%ld,\n" + " sp_flag=%lu\n" + "}\n", + shadow->sp_namp,shadow->sp_pwdp,shadow->sp_lstchg, + shadow->sp_min,shadow->sp_max,shadow->sp_warn, + shadow->sp_inact,shadow->sp_expire,shadow->sp_flag); +} + +/* the main program... */ +int main(int argc,char *argv[]) +{ + struct spwd shadowresult; + char buffer[1024]; + enum nss_status res; + int errnocp; + + /* test getspnam() */ + printf("\nTEST getspnam()\n"); + res=_nss_ldap_getspnam_r("arthur",&shadowresult,buffer,1024,&errnocp); + printf("status=%s\n",nssstatus(res)); + if (res==NSS_STATUS_SUCCESS) + printshadow(&shadowresult); + else + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + + /* test {set,get,end}spent() */ + printf("\nTEST {set,get,end}spent()\n"); + res=_nss_ldap_setspent(1); + printf("status=%s\n",nssstatus(res)); + while ((res=_nss_ldap_getspent_r(&shadowresult,buffer,1024,&errnocp))==NSS_STATUS_SUCCESS) + { + printf("status=%s\n",nssstatus(res)); + printshadow(&shadowresult); + } + printf("status=%s\n",nssstatus(res)); + printf("errno=%d:%s\n",(int)errnocp,strerror(errnocp)); + res=_nss_ldap_endspent(); + printf("status=%s\n",nssstatus(res)); + + return 0; +} diff --git a/contrib/slapd-modules/nssov/nss-ldapd/tests/test_tio.c b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_tio.c new file mode 100644 index 0000000000..82586e4196 --- /dev/null +++ b/contrib/slapd-modules/nssov/nss-ldapd/tests/test_tio.c @@ -0,0 +1,303 @@ +/* + test_tio.c - simple test for the tio module + This file is part of the nss-ldapd library. + + Copyright (C) 2007, 2008 Arthur de Jong + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA +*/ + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#ifdef HAVE_STDINT_H +#include +#endif /* HAVE_STDINT_H */ +#include +#include + +#include "common/tio.h" + +#define assertok(expr) \ + ((expr) \ + ? __ASSERT_VOID_CAST (0) \ + : __assertok_fail(__STRING(expr),__FILE__,__LINE__,__ASSERT_FUNCTION)) + +static void __assertok_fail(const char *expr,const char *file, + int line,const char *function) +{ + char msg[120]; + snprintf(msg,sizeof(msg),"%s (errno=\"%s\")",expr,strerror(errno)); + __assert_fail(msg,file,line,function); +} + +/* structure for passing arguments to helper (is a thread) */ +struct helper_args { + int fd; + size_t blocksize; + size_t blocks; + int timeout; +}; + +static void *help_tiowriter(void *arg) +{ + TFILE *fp; + struct timeval timeout; + size_t i,j,k; + uint8_t *buf; + struct helper_args *hargs=(struct helper_args *)arg; + /* allocate the buffer */ + buf=(uint8_t *)malloc(hargs->blocksize); + assert(buf!=NULL); + /* set the timeout */ + timeout.tv_sec=hargs->timeout; + timeout.tv_usec=0; + /* open the file */ + fp=tio_fdopen(hargs->fd,&timeout,&timeout,4*1024,8*1024,4*1024,8*1024); + assertok(fp!=NULL); + /* write the blocks */ + i=0; + for (k=0;kblocks;k++) + { + /* fill the buffer */ + for (j=0;jblocksize;j++) + buf[j]=i++; + assertok(tio_write(fp,buf,hargs->blocksize)==0); + } + /* close the file flushing the buffer */ + assertok(tio_close(fp)==0); + /* we're done */ + free(buf); + return NULL; +} + +static void *help_tioreader(void *arg) +{ + TFILE *fp; + struct timeval timeout; + size_t i,j,k; + uint8_t *buf; + struct helper_args *hargs=(struct helper_args *)arg; + /* allocate the buffer */ + buf=(uint8_t *)malloc(hargs->blocksize); + assert(buf!=NULL); + /* set the timeout */ + timeout.tv_sec=hargs->timeout; + timeout.tv_usec=0; + /* open the file */ + fp=tio_fdopen(hargs->fd,&timeout,&timeout,4*1024,8*1024,4*1024,8*1024); + assertok(fp!=NULL); + /* read the blocks */ + i=0; + for (k=0;kblocks;k++) + { + assertok(tio_read(fp,buf,hargs->blocksize)==0); + /* check the buffer */ + for (j=0;jblocksize;j++) + assert(buf[j]==(uint8_t)(i++)); + } + /* close the file */ + assertok(tio_close(fp)==0); + /* we're done */ + free(buf); + return NULL; +} + +static void *help_normwriter(void *arg) +{ + FILE *fp; + size_t i,j,k; + uint8_t *buf; + struct helper_args *hargs=(struct helper_args *)arg; + /* allocate the buffer */ + buf=(uint8_t *)malloc(hargs->blocksize); + assert(buf!=NULL); + /* open the file */ + fp=fdopen(hargs->fd,"wb"); + assertok(fp!=NULL); + /* write the blocks */ + i=0; + for (k=0;kblocks;k++) + { + /* fill the buffer */ + for (j=0;jblocksize;j++) + buf[j]=i++; + assertok(fwrite(buf,hargs->blocksize,1,fp)==1); + } + /* close the file flushing the buffer */ + assertok(fclose(fp)==0); + /* we're done */ + free(buf); + return NULL; +} + +static void *help_normreader(void *arg) +{ + FILE *fp; + size_t i,j,k; + struct helper_args *hargs=(struct helper_args *)arg; + /* open the file */ + fp=fdopen(hargs->fd,"rb"); + assertok(fp!=NULL); + /* read the blocks */ + i=0; + for (k=0;kblocks;k++) + { + /* check the buffer */ + for (j=0;jblocksize;j++) + assertok(fgetc(fp)==(uint8_t)(i++)); + } + /* close the file */ + assertok(fclose(fp)==0); + return NULL; +} + +/* +TODO: test timeout +TODO: test whether a simple request/response works +*/ + +static int test_blocks(size_t wbs, size_t wbl, size_t rbs, size_t rbl) +{ + int sp[2]; + pthread_t wthread, rthread; + struct helper_args wargs,rargs; + /* set up the socket pair */ + assertok(socketpair(AF_UNIX,SOCK_STREAM,0,sp)==0); + /* log */ + printf("test_tio: writing %d blocks of %d bytes (%d total)\n",wbl,wbs,wbl*wbs); + printf("test_tio: reading %d blocks of %d bytes (%d total)\n",rbl,rbs,rbl*rbs); + /* start the writer thread */ + wargs.fd=sp[0]; + wargs.blocksize=wbs; + wargs.blocks=wbl; + wargs.timeout=2; + assertok(pthread_create(&wthread,NULL,help_tiowriter,&wargs)==0); +/* sleep(1); */ + /* start the reader thread */ + rargs.fd=sp[1]; + rargs.blocksize=rbs; + rargs.blocks=rbl; + rargs.timeout=2; + assertok(pthread_create(&rthread,NULL,help_tioreader,&rargs)==0); + /* wait for all threads to die */ + assertok(pthread_join(wthread,NULL)==0); + assertok(pthread_join(rthread,NULL)==0); + /* we're done */ + return 0; +} + +static void test_reset(void) +{ + int sp[2]; + pthread_t wthread; + struct helper_args wargs; + TFILE *fp; + struct timeval timeout; + size_t i,j,k,save; + uint8_t buf[20]; + /* set up the socket pair */ + assertok(socketpair(AF_UNIX,SOCK_STREAM,0,sp)==0); + /* start the writer thread */ + wargs.fd=sp[0]; + wargs.blocksize=4*1024; + wargs.blocks=10; + wargs.timeout=2; + assertok(pthread_create(&wthread,NULL,help_normwriter,&wargs)==0); + /* set up read handle */ + timeout.tv_sec=2; + timeout.tv_usec=0; + fp=tio_fdopen(sp[1],&timeout,&timeout,2*1024,4*1024,2*1024,4*1024); + assertok(fp!=NULL); + /* perform 20 reads */ + i=0; + for (k=0;k<20;k++) + { + assertok(tio_read(fp,buf,sizeof(buf))==0); + /* check the buffer */ + for (j=0;j. + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +#ifndef SLAPD_OVER_NSSOV +#define SLAPD_OVER_NSSOV SLAPD_MOD_DYNAMIC +#endif + +#include "../slapd/config.h" /* not nss-ldapd config.h */ + +#include "lutil.h" + +#include +#include +#include +#include + +/* buffer sizes for I/O */ +#define READBUFFER_MINSIZE 32 +#define READBUFFER_MAXSIZE 64 +#define WRITEBUFFER_MINSIZE 64 +#define WRITEBUFFER_MAXSIZE 64*1024 + +/* Find the given attribute's value in the RDN of the DN */ +int nssov_find_rdnval(struct berval *dn, AttributeDescription *ad, struct berval *value) +{ + struct berval rdn; + char *next; + + BER_BVZERO(value); + dnRdn( dn, &rdn ); + do { + next = ber_bvchr( &rdn, '+' ); + if ( rdn.bv_val[ad->ad_cname.bv_len] == '=' && + !ber_bvcmp( &rdn, &ad->ad_cname )) { + if ( next ) + rdn.bv_len = next - rdn.bv_val; + value->bv_val = rdn.bv_val + ad->ad_cname.bv_len + 1; + value->bv_len = rdn.bv_len - ad->ad_cname.bv_len - 1; + break; + } + if ( !next ) + break; + next++; + rdn.bv_len -= next - rdn.bv_val; + rdn.bv_val = next; + } while (1); +} + +/* create a search filter using a name that requires escaping */ +int nssov_filter_byname(nssov_mapinfo *mi,int key,struct berval *name,struct berval *buf) +{ + char buf2[1024]; + struct berval bv2 = {sizeof(buf2),buf2}; + + /* escape attribute */ + if (nssov_escape(name,&bv2)) + return -1; + /* build filter */ + if (bv2.bv_len + mi->mi_filter.bv_len + mi->mi_attrs[key].an_desc->ad_cname.bv_len + 6 > + buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s))", + mi->mi_filter.bv_val, mi->mi_attrs[key].an_desc->ad_cname.bv_val, + bv2.bv_val ); + return 0; +} + +/* create a search filter using a string converted from an int */ +int nssov_filter_byid(nssov_mapinfo *mi,int key,struct berval *id,struct berval *buf) +{ + /* build filter */ + if (id->bv_len + mi->mi_filter.bv_len + mi->mi_attrs[key].an_desc->ad_cname.bv_len + 6 > + buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s))", + mi->mi_filter.bv_val, mi->mi_attrs[key].an_desc->ad_cname.bv_val, + id->bv_val ); + return 0; +} + +void get_userpassword(struct berval *attr,struct berval *pw) +{ + int i; + /* go over the entries and return the remainder of the value if it + starts with {crypt} or crypt$ */ + for (i=0;!BER_BVISNULL(&attr[i]);i++) + { + if (strncasecmp(attr[i].bv_val,"{crypt}",7)==0) { + pw->bv_val = attr[i].bv_val + 7; + pw->bv_len = attr[i].bv_len - 7; + return; + } + if (strncasecmp(attr[i].bv_val,"crypt$",6)==0) { + pw->bv_val = attr[i].bv_val + 6; + pw->bv_len = attr[i].bv_len - 6; + return; + } + } + /* just return the first value completely */ + *pw = *attr; + /* TODO: support more password formats e.g. SMD5 + (which is $1$ but in a different format) + (any code for this is more than welcome) */ +} + +/* this writes a single address to the stream */ +int write_address(TFILE *fp,struct berval *addr) +{ + int32_t tmpint32; + struct in_addr ipv4addr; + struct in6_addr ipv6addr; + /* try to parse the address as IPv4 first, fall back to IPv6 */ + if (inet_pton(AF_INET,addr->bv_val,&ipv4addr)>0) + { + /* write address type */ + WRITE_INT32(fp,AF_INET); + /* write the address length */ + WRITE_INT32(fp,sizeof(struct in_addr)); + /* write the address itself (in network byte order) */ + WRITE_TYPE(fp,ipv4addr,struct in_addr); + } + else if (inet_pton(AF_INET6,addr->bv_val,&ipv6addr)>0) + { + /* write address type */ + WRITE_INT32(fp,AF_INET6); + /* write the address length */ + WRITE_INT32(fp,sizeof(struct in6_addr)); + /* write the address itself (in network byte order) */ + WRITE_TYPE(fp,ipv6addr,struct in6_addr); + } + else + { + /* failure, log but write simple invalid address + (otherwise the address list is messed up) */ + /* TODO: have error message in correct format */ + Debug(LDAP_DEBUG_ANY,"nssov: unparseable address: %s",addr->bv_val,0,0); + /* write an illegal address type */ + WRITE_INT32(fp,-1); + /* write an empty address */ + WRITE_INT32(fp,0); + } + /* we're done */ + return 0; +} + +int read_address(TFILE *fp,char *addr,int *addrlen,int *af) +{ + int32_t tmpint32; + int len; + /* read address family */ + READ_INT32(fp,*af); + if ((*af!=AF_INET)&&(*af!=AF_INET6)) + { + Debug(LDAP_DEBUG_ANY,"nssov: incorrect address family specified: %d",*af,0,0); + return -1; + } + /* read address length */ + READ_INT32(fp,len); + if ((len>*addrlen)||(len<=0)) + { + Debug(LDAP_DEBUG_ANY,"nssov: address length incorrect: %d",len,0,0); + return -1; + } + *addrlen=len; + /* read address */ + READ(fp,addr,len); + /* we're done */ + return 0; +} + +int nssov_escape(struct berval *src,struct berval *dst) +{ + size_t pos=0; + int i; + /* go over all characters in source string */ + for (i=0;ibv_len;i++) + { + /* check if char will fit */ + if (pos>=(dst->bv_len-4)) + return -1; + /* do escaping for some characters */ + switch (src->bv_val[i]) + { + case '*': + strcpy(dst->bv_val+pos,"\\2a"); + pos+=3; + break; + case '(': + strcpy(dst->bv_val+pos,"\\28"); + pos+=3; + break; + case ')': + strcpy(dst->bv_val+pos,"\\29"); + pos+=3; + break; + case '\\': + strcpy(dst->bv_val+pos,"\\5c"); + pos+=3; + break; + default: + /* just copy character */ + dst->bv_val[pos++]=src->bv_val[i]; + break; + } + } + /* terminate destination string */ + dst->bv_val[pos]='\0'; + dst->bv_len = pos; + return 0; +} + +/* read the version information and action from the stream + this function returns the read action in location pointer to by action */ +static int read_header(TFILE *fp,int32_t *action) +{ + int32_t tmpint32; + /* read the protocol version */ + READ_TYPE(fp,tmpint32,int32_t); + if (tmpint32 != (int32_t)NSLCD_VERSION) + { + Debug( LDAP_DEBUG_TRACE,"nssov: wrong nslcd version id (%d)",(int)tmpint32,0,0); + return -1; + } + /* read the request type */ + READ(fp,action,sizeof(int32_t)); + return 0; +} + +/* read a request message, returns <0 in case of errors, + this function closes the socket */ +static void handleconnection(nssov_info *ni,int sock,Operation *op) +{ + TFILE *fp; + int32_t action; + struct timeval readtimeout,writetimeout; + uid_t uid; + gid_t gid; + char authid[sizeof("gidNumber=4294967295+uidNumber=424967295,cn=peercred,cn=external,cn=auth")]; + + /* log connection */ + if (lutil_getpeereid(sock,&uid,&gid)) + Debug( LDAP_DEBUG_TRACE,"nssov: connection from unknown client: %s",strerror(errno),0,0); + else + Debug( LDAP_DEBUG_TRACE,"nssov: connection from uid=%d gid=%d", + (int)uid,(int)gid,0); + + /* Should do authid mapping too */ + op->o_dn.bv_len = sprintf(authid,"gidNumber=%d+uidNumber=%d,cn=peercred,cn=external,cn=auth", + (int)uid, (int)gid ); + op->o_dn.bv_val = authid; + op->o_ndn = op->o_dn; + + /* set the timeouts */ + readtimeout.tv_sec=0; /* clients should send their request quickly */ + readtimeout.tv_usec=500000; + writetimeout.tv_sec=5; /* clients could be taking some time to process the results */ + writetimeout.tv_usec=0; + /* create a stream object */ + if ((fp=tio_fdopen(sock,&readtimeout,&writetimeout, + READBUFFER_MINSIZE,READBUFFER_MAXSIZE, + WRITEBUFFER_MINSIZE,WRITEBUFFER_MAXSIZE))==NULL) + { + Debug( LDAP_DEBUG_ANY,"nssov: cannot create stream for writing: %s",strerror(errno),0,0); + (void)close(sock); + return; + } + /* read request */ + if (read_header(fp,&action)) + { + (void)tio_close(fp); + return; + } + /* handle request */ + switch (action) + { + case NSLCD_ACTION_ALIAS_BYNAME: (void)nssov_alias_byname(ni,fp,op); break; + case NSLCD_ACTION_ALIAS_ALL: (void)nssov_alias_all(ni,fp,op); break; + case NSLCD_ACTION_ETHER_BYNAME: (void)nssov_ether_byname(ni,fp,op); break; + case NSLCD_ACTION_ETHER_BYETHER: (void)nssov_ether_byether(ni,fp,op); break; + case NSLCD_ACTION_ETHER_ALL: (void)nssov_ether_all(ni,fp,op); break; + case NSLCD_ACTION_GROUP_BYNAME: (void)nssov_group_byname(ni,fp,op); break; + case NSLCD_ACTION_GROUP_BYGID: (void)nssov_group_bygid(ni,fp,op); break; + case NSLCD_ACTION_GROUP_BYMEMBER: (void)nssov_group_bymember(ni,fp,op); break; + case NSLCD_ACTION_GROUP_ALL: (void)nssov_group_all(ni,fp,op); break; + case NSLCD_ACTION_HOST_BYNAME: (void)nssov_host_byname(ni,fp,op); break; + case NSLCD_ACTION_HOST_BYADDR: (void)nssov_host_byaddr(ni,fp,op); break; + case NSLCD_ACTION_HOST_ALL: (void)nssov_host_all(ni,fp,op); break; + case NSLCD_ACTION_NETGROUP_BYNAME: (void)nssov_netgroup_byname(ni,fp,op); break; + case NSLCD_ACTION_NETWORK_BYNAME: (void)nssov_network_byname(ni,fp,op); break; + case NSLCD_ACTION_NETWORK_BYADDR: (void)nssov_network_byaddr(ni,fp,op); break; + case NSLCD_ACTION_NETWORK_ALL: (void)nssov_network_all(ni,fp,op); break; + case NSLCD_ACTION_PASSWD_BYNAME: (void)nssov_passwd_byname(ni,fp,op); break; + case NSLCD_ACTION_PASSWD_BYUID: (void)nssov_passwd_byuid(ni,fp,op); break; + case NSLCD_ACTION_PASSWD_ALL: (void)nssov_passwd_all(ni,fp,op); break; + case NSLCD_ACTION_PROTOCOL_BYNAME: (void)nssov_protocol_byname(ni,fp,op); break; + case NSLCD_ACTION_PROTOCOL_BYNUMBER:(void)nssov_protocol_bynumber(ni,fp,op); break; + case NSLCD_ACTION_PROTOCOL_ALL: (void)nssov_protocol_all(ni,fp,op); break; + case NSLCD_ACTION_RPC_BYNAME: (void)nssov_rpc_byname(ni,fp,op); break; + case NSLCD_ACTION_RPC_BYNUMBER: (void)nssov_rpc_bynumber(ni,fp,op); break; + case NSLCD_ACTION_RPC_ALL: (void)nssov_rpc_all(ni,fp,op); break; + case NSLCD_ACTION_SERVICE_BYNAME: (void)nssov_service_byname(ni,fp,op); break; + case NSLCD_ACTION_SERVICE_BYNUMBER: (void)nssov_service_bynumber(ni,fp,op); break; + case NSLCD_ACTION_SERVICE_ALL: (void)nssov_service_all(ni,fp,op); break; + case NSLCD_ACTION_SHADOW_BYNAME: if (uid==0) (void)nssov_shadow_byname(ni,fp,op); break; + case NSLCD_ACTION_SHADOW_ALL: if (uid==0) (void)nssov_shadow_all(ni,fp,op); break; + default: + Debug( LDAP_DEBUG_ANY,"nssov: invalid request id: %d",(int)action,0,0); + break; + } + /* we're done with the request */ + (void)tio_close(fp); + return; +} + +/* accept a connection on the socket */ +static void *acceptconn(void *ctx, void *arg) +{ + nssov_info *ni = arg; + Connection conn = {0}; + OperationBuffer opbuf; + Operation *op; + int csock; + + if ( slapd_shutdown ) + return NULL; + + { + struct sockaddr_storage addr; + socklen_t alen; + int j; + + /* accept a new connection */ + alen=(socklen_t)sizeof(struct sockaddr_storage); + csock=accept(ni->ni_socket,(struct sockaddr *)&addr,&alen); + connection_client_enable(ni->ni_conn); + if (csock<0) + { + if ((errno==EINTR)||(errno==EAGAIN)||(errno==EWOULDBLOCK)) + { + Debug( LDAP_DEBUG_TRACE,"nssov: accept() failed (ignored): %s",strerror(errno),0,0); + return; + } + Debug( LDAP_DEBUG_ANY,"nssov: accept() failed: %s",strerror(errno),0,0); + return; + } + /* make sure O_NONBLOCK is not inherited */ + if ((j=fcntl(csock,F_GETFL,0))<0) + { + Debug( LDAP_DEBUG_ANY,"nssov: fcntl(F_GETFL) failed: %s",strerror(errno),0,0); + if (close(csock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return; + } + if (fcntl(csock,F_SETFL,j&~O_NONBLOCK)<0) + { + Debug( LDAP_DEBUG_ANY,"nssov: fcntl(F_SETFL,~O_NONBLOCK) failed: %s",strerror(errno),0,0); + if (close(csock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return; + } + } + connection_fake_init( &conn, &opbuf, ctx ); + op=&opbuf.ob_op; + op->o_bd = ni->ni_db; + op->o_tag = LDAP_REQ_SEARCH; + + /* handle the connection */ + handleconnection(ni,csock,op); +} + +static slap_verbmasks nss_svcs[] = { + { BER_BVC("alias"), NM_alias }, + { BER_BVC("ether"), NM_ether }, + { BER_BVC("group"), NM_group }, + { BER_BVC("host"), NM_host }, + { BER_BVC("netgroup"), NM_netgroup }, + { BER_BVC("network"), NM_network }, + { BER_BVC("passwd"), NM_passwd }, + { BER_BVC("protocol"), NM_protocol }, + { BER_BVC("rpc"), NM_rpc }, + { BER_BVC("service"), NM_service }, + { BER_BVC("shadow"), NM_shadow }, + { BER_BVNULL, 0 } +}; + +enum { + NSS_SSD=1, + NSS_MAP +}; + +static ConfigDriver nss_cf_gen; + +static ConfigTable nsscfg[] = { + { "nssov-ssd", "service> lookups of attr to attr' " + "EQUALITY caseIgnoreMatch " + "SYNTAX OMsDirectoryString )", NULL, NULL }, + { NULL, NULL, 0,0,0, ARG_IGNORED } +}; + +static ConfigOCs nssocs[] = { + { "( OLcfgCtOc:3.1 " + "NAME 'olcNssOvConfig' " + "DESC 'NSS lookup configuration' " + "SUP olcOverlayConfig " + "MAY ( olcNssSsd $ olcNssMap ) )", + Cft_Overlay, nsscfg }, + { NULL, 0, NULL } +}; + +static int +nss_cf_gen(ConfigArgs *c) +{ + slap_overinst *on = (slap_overinst *)c->bi; + nssov_info *ni = on->on_bi.bi_private; + nssov_mapinfo *mi; + int i, j, rc = 0; + + if ( c->op == SLAP_CONFIG_EMIT ) { + switch(c->type) { + case NSS_SSD: + rc = 1; + for (i=NM_alias;ini_maps[i]; + + /* ignore all-default services */ + if ( mi->mi_scope == LDAP_SCOPE_DEFAULT && + bvmatch( &mi->mi_filter, &mi->mi_filter0 ) && + BER_BVISNULL( &mi->mi_base )) + continue; + + if ( BER_BVISNULL( &mi->mi_base )) + base = ni->ni_db->be_nsuffix[0]; + else + base = mi->mi_base; + ldap_pvt_scope2bv(mi->mi_scope == LDAP_SCOPE_DEFAULT ? + LDAP_SCOPE_SUBTREE : mi->mi_scope, &scope); + ssd.bv_len = STRLENOF(" ldap:///???") + nss_svcs[i].word.bv_len + + base.bv_len + scope.bv_len + mi->mi_filter.bv_len; + ssd.bv_val = ch_malloc( ssd.bv_len + 1 ); + sprintf(ssd.bv_val, "%s ldap:///%s??%s?%s", nss_svcs[i].word.bv_val, + base.bv_val, scope.bv_val, mi->mi_filter.bv_val ); + ber_bvarray_add( &c->rvalue_vals, &ssd ); + rc = 0; + } + break; + case NSS_MAP: + rc = 1; + for (i=NM_alias;ini_maps[i]; + for (j=0;!BER_BVISNULL(&mi->mi_attrkeys[j]);j++) { + if ( ber_bvstrcasecmp(&mi->mi_attrkeys[j], + &mi->mi_attrs[j].an_name)) { + struct berval map; + + map.bv_len = nss_svcs[i].word.bv_len + + mi->mi_attrkeys[j].bv_len + + mi->mi_attrs->an_desc->ad_cname.bv_len + 2; + map.bv_val = ch_malloc(map.bv_len + 1); + sprintf(map.bv_val, "%s %s %s", nss_svcs[i].word.bv_val, + mi->mi_attrkeys[j].bv_val, mi->mi_attrs->an_desc->ad_cname.bv_val ); + ber_bvarray_add( &c->rvalue_vals, &map ); + rc = 0; + } + } + } + break; + } + return rc; + } else if ( c->op == LDAP_MOD_DELETE ) { + return 1; + } + switch( c->type ) { + case NSS_SSD: { + LDAPURLDesc *lud; + + i = verb_to_mask(c->argv[1], nss_svcs); + if ( i == NM_NONE ) + return 1; + + mi = &ni->ni_maps[i]; + rc = ldap_url_parse(c->argv[2], &lud); + if ( rc ) + return 1; + do { + struct berval base; + /* Must be LDAP scheme */ + if (strcasecmp(lud->lud_scheme,"ldap")) { + rc = 1; + break; + } + /* Host part, attrs, and extensions must be empty */ + if (( lud->lud_host && *lud->lud_host ) || + lud->lud_attrs || lud->lud_exts ) { + rc = 1; + break; + } + ber_str2bv( lud->lud_dn,0,0,&base); + rc = dnNormalize( 0,NULL,NULL,&base,&mi->mi_base,NULL); + if ( rc ) + break; + if ( lud->lud_filter ) { + /* steal this */ + ber_str2bv( lud->lud_filter,0,0,&mi->mi_filter); + lud->lud_filter = NULL; + } + mi->mi_scope = lud->lud_scope; + } while(0); + ldap_free_urldesc( lud ); + } + break; + case NSS_MAP: + i = verb_to_mask(c->argv[1], nss_svcs); + if ( i == NM_NONE ) + return 1; + rc = 1; + mi = &ni->ni_maps[i]; + for (j=0; !BER_BVISNULL(&mi->mi_attrkeys[j]); j++) { + if (!strcasecmp(c->argv[2],mi->mi_attrkeys[j].bv_val)) { + AttributeDescription *ad = NULL; + const char *text; + rc = slap_str2ad( c->argv[3], &ad, &text); + if ( rc == 0 ) { + mi->mi_attrs[j].an_desc = ad; + mi->mi_attrs[j].an_name = ad->ad_cname; + } + break; + } + } + break; + } + return rc; +} + +static int +nssov_db_init( + BackendDB *be, + ConfigReply *cr ) +{ + slap_overinst *on = (slap_overinst *)be->bd_info; + nssov_info *ni; + nssov_mapinfo *mi; + int i, j; + + ni = ch_malloc( sizeof(nssov_info) ); + on->on_bi.bi_private = ni; + + /* set up map keys */ + nssov_alias_init(ni); + nssov_ether_init(ni); + nssov_group_init(ni); + nssov_host_init(ni); + nssov_netgroup_init(ni); + nssov_network_init(ni); + nssov_passwd_init(ni); + nssov_protocol_init(ni); + nssov_rpc_init(ni); + nssov_service_init(ni); + nssov_shadow_init(ni); + + ni->ni_db = be->bd_self; + + return 0; +} + +static int +nssov_db_destroy( + BackendDB *be, + ConfigReply *cr ) +{ +} + +static int +nssov_db_open( + BackendDB *be, + ConfigReply *cr ) +{ + slap_overinst *on = (slap_overinst *)be->bd_info; + nssov_info *ni = on->on_bi.bi_private; + nssov_mapinfo *mi; + + int i, sock; + struct sockaddr_un addr; + + /* Set default bases */ + for (i=0; ini_maps[i].mi_base )) { + ber_dupbv( &ni->ni_maps[i].mi_base, &be->be_nsuffix[0] ); + } + if ( ni->ni_maps[i].mi_scope == LDAP_SCOPE_DEFAULT ) + ni->ni_maps[i].mi_scope = LDAP_SCOPE_SUBTREE; + } + /* validate attribute maps */ + mi = ni->ni_maps; + for ( i=0; imi_attrkeys[j]); j++) { + /* skip attrs we already validated */ + if ( mi->mi_attrs[j].an_desc ) continue; + if ( slap_bv2ad( &mi->mi_attrs[j].an_name, + &mi->mi_attrs[j].an_desc, &text )) { + Debug(LDAP_DEBUG_ANY,"nssov: invalid attr \"%s\": %s\n", + mi->mi_attrs[j].an_name.bv_val, text, 0 ); + return -1; + } + } + BER_BVZERO(&mi->mi_attrs[j].an_name); + mi->mi_attrs[j].an_desc = NULL; + } + + if ( slapMode & SLAP_SERVER_MODE ) { + /* create a socket */ + if ( (sock=socket(PF_UNIX,SOCK_STREAM,0))<0 ) + { + Debug(LDAP_DEBUG_ANY,"nssov: cannot create socket: %s",strerror(errno),0,0); + return -1; + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + Debug( LDAP_DEBUG_TRACE,"nssov: unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno),0,0); + } + /* create socket address structure */ + memset(&addr,0,sizeof(struct sockaddr_un)); + addr.sun_family=AF_UNIX; + strncpy(addr.sun_path,NSLCD_SOCKET,sizeof(addr.sun_path)); + addr.sun_path[sizeof(addr.sun_path)-1]='\0'; + /* bind to the named socket */ + if (bind(sock,(struct sockaddr *)&addr,sizeof(struct sockaddr_un))) + { + Debug( LDAP_DEBUG_ANY,"nssov: bind() to "NSLCD_SOCKET" failed: %s", + strerror(errno),0,0); + if (close(sock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return -1; + } + /* close the file descriptor on exit */ + if (fcntl(sock,F_SETFD,FD_CLOEXEC)<0) + { + Debug( LDAP_DEBUG_ANY,"nssov: fcntl(F_SETFL,O_NONBLOCK) failed: %s",strerror(errno),0,0); + if (close(sock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return -1; + } + /* set permissions of socket so anybody can do requests */ + /* Note: we use chmod() here instead of fchmod() because + fchmod does not work on sockets + http://www.opengroup.org/onlinepubs/009695399/functions/fchmod.html + http://lkml.org/lkml/2005/5/16/11 */ + if (chmod(NSLCD_SOCKET,(mode_t)0666)) + { + Debug( LDAP_DEBUG_ANY,"nssov: chmod(0666) failed: %s",strerror(errno),0,0); + if (close(sock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return -1; + } + /* start listening for connections */ + if (listen(sock,SOMAXCONN)<0) + { + Debug( LDAP_DEBUG_ANY,"nssov: listen() failed: %s",strerror(errno),0,0); + if (close(sock)) + Debug( LDAP_DEBUG_ANY,"nssov: problem closing socket: %s",strerror(errno),0,0); + return -1; + } + ni->ni_socket = sock; + ni->ni_conn = connection_client_setup( sock, acceptconn, ni ); + } + + return 0; +} + +static int +nssov_db_close( + BackendDB *be, + ConfigReply *cr ) +{ + slap_overinst *on = (slap_overinst *)be->bd_info; + nssov_info *ni = on->on_bi.bi_private; + + /* close socket if it's still in use */ + if (ni->ni_socket >= 0); + { + if (close(ni->ni_socket)) + Debug( LDAP_DEBUG_ANY,"problem closing server socket (ignored): %s",strerror(errno),0,0); + ni->ni_socket = -1; + } + /* remove existing named socket */ + if (unlink(NSLCD_SOCKET)<0) + { + Debug( LDAP_DEBUG_TRACE,"unlink() of "NSLCD_SOCKET" failed (ignored): %s", + strerror(errno),0,0); + } +} + +static slap_overinst nssov; + +int +nssov_initialize( void ) +{ + int rc; + + nssov.on_bi.bi_type = "nssov"; + nssov.on_bi.bi_db_init = nssov_db_init; + nssov.on_bi.bi_db_destroy = nssov_db_destroy; + nssov.on_bi.bi_db_open = nssov_db_open; + nssov.on_bi.bi_db_close = nssov_db_close; + + nssov.on_bi.bi_cf_ocs = nssocs; + + rc = config_register_schema( nsscfg, nssocs ); + if ( rc ) return rc; + + return overlay_register(&nssov); +} + +#if SLAPD_OVER_NSSOV == SLAPD_MOD_DYNAMIC +int +init_module( int argc, char *argv[] ) +{ + return nssov_initialize(); +} +#endif diff --git a/contrib/slapd-modules/nssov/nssov.h b/contrib/slapd-modules/nssov/nssov.h new file mode 100644 index 0000000000..41498bfff5 --- /dev/null +++ b/contrib/slapd-modules/nssov/nssov.h @@ -0,0 +1,284 @@ +/* nssov.h - NSS overlay header file */ +/* $OpenLDAP$ */ +/* This work is part of OpenLDAP Software . + * + * Copyright 2008 The OpenLDAP Foundation. + * Portions Copyright 2008 Howard Chu. + */ + +#ifndef NSSOV_H +#define NSSOV_H + +#ifndef NSLCD_SOCKET +#define NSLCD_SOCKET "/var/run/nslcd/socket" +#endif + +#include + +#include "nslcd.h" +#include "nslcd-common.h" +#include "common/tio.h" +#include "compat/attrs.h" + +#undef PACKAGE_BUGREPORT +#undef PACKAGE_NAME +#undef PACKAGE_STRING +#undef PACKAGE_TARNAME +#undef PACKAGE_VERSION + +#include "portable.h" +#include "slap.h" +#include + +/* selectors for different maps */ +enum nssov_map_selector +{ + NM_alias, + NM_ether, + NM_group, + NM_host, + NM_netgroup, + NM_network, + NM_passwd, + NM_protocol, + NM_rpc, + NM_service, + NM_shadow, + NM_NONE +}; + +typedef struct nssov_mapinfo { + struct berval mi_base; + int mi_scope; + struct berval mi_filter0; + struct berval mi_filter; + struct berval *mi_attrkeys; + AttributeName *mi_attrs; +} nssov_mapinfo; + +typedef struct nssov_info +{ + /* search timelimit */ + int ni_timelimit; + struct nssov_mapinfo ni_maps[NM_NONE]; + int ni_socket; + Connection *ni_conn; + BackendDB *ni_db; +} nssov_info; + +/* Read the default configuration file. */ +void nssov_cfg_init(nssov_info *ni,const char *fname); + +/* macros for basic read and write operations, the following + ERROR_OUT* marcos define the action taken on errors + the stream is not closed because the caller closes the + stream */ + +#define ERROR_OUT_WRITEERROR(fp) \ + Debug(LDAP_DEBUG_ANY,"nssov: error writing to client\n",0,0,0); \ + return -1; + +#define ERROR_OUT_READERROR(fp) \ + Debug(LDAP_DEBUG_ANY,"nssov: error reading from client\n",0,0,0); \ + return -1; + +#define ERROR_OUT_BUFERROR(fp) \ + Debug(LDAP_DEBUG_ANY,"nssov: client supplied argument too large\n",0,0,0); \ + return -1; + +#define WRITE_BERVAL(fp,bv) \ + DEBUG_PRINT("WRITE_STRING: var="__STRING(bv)" string=\"%s\"",(bv)->bv_val); \ + if ((bv)==NULL) \ + { \ + WRITE_INT32(fp,0); \ + } \ + else \ + { \ + WRITE_INT32(fp,(bv)->bv_len); \ + if (tmpint32>0) \ + { WRITE(fp,(bv)->bv_val,tmpint32); } \ + } + +#define WRITE_BVARRAY(fp,arr) \ + /* first determine length of array */ \ + for (tmp3int32=0;(arr)[tmp3int32].bv_val!=NULL;tmp3int32++) \ + /*nothing*/ ; \ + /* write number of strings */ \ + DEBUG_PRINT("WRITE_BVARRAY: var="__STRING(arr)" num=%d",(int)tmp3int32); \ + WRITE_TYPE(fp,tmp3int32,int32_t); \ + /* write strings */ \ + for (tmp2int32=0;tmp2int32ni_maps[NM_##db]; \ + int i; \ + for (i=0;!BER_BVISNULL(&db##_keys[i]);i++); \ + i++; \ + mi->mi_attrs = ch_malloc( i*sizeof(AttributeName)); \ + for (i=0;!BER_BVISNULL(&db##_keys[i]);i++) { \ + mi->mi_attrs[i].an_name = db##_keys[i]; \ + mi->mi_attrs[i].an_desc = NULL; \ + } \ + mi->mi_scope = LDAP_SCOPE_DEFAULT; \ + mi->mi_filter0 = db##_filter; \ + ber_dupbv( &mi->mi_filter, &mi->mi_filter0 ); \ + mi->mi_filter = db##_filter; \ + mi->mi_attrkeys = db##_keys; \ + BER_BVZERO(&mi->mi_base); \ + } + +/* param structure for search callback */ +#define NSSOV_CBPRIV(db,parms) \ + typedef struct nssov_##db##_cbp { \ + nssov_mapinfo *mi; \ + TFILE *fp; \ + Operation *op; \ + parms \ + } nssov_##db##_cbp + +/* callback for writing search results */ +#define NSSOV_CB(db) \ + static int nssov_##db##_cb(Operation *op, SlapReply *rs) \ + { \ + if ( rs->sr_type == REP_SEARCH ) { \ + nssov_##db##_cbp *cbp = op->o_callback->sc_private; \ + if (write_##db(cbp,rs->sr_entry)) return LDAP_OTHER; \ + } \ + return LDAP_SUCCESS; \ + } \ + +/* macro for generating service handling code */ +#define NSSOV_HANDLE(db,fn,readfn,logcall,action,mkfilter) \ + int nssov_##db##_##fn(nssov_info *ni,TFILE *fp,Operation *op) \ + { \ + /* define common variables */ \ + int32_t tmpint32; \ + int rc; \ + nssov_##db##_cbp cbp; \ + slap_callback cb = {0}; \ + SlapReply rs = {REP_RESULT}; \ + cbp.mi = &ni->ni_maps[NM_##db]; \ + cbp.fp = fp; \ + cbp.op = op; \ + /* read request parameters */ \ + readfn; \ + /* log call */ \ + logcall; \ + /* write the response header */ \ + WRITE_INT32(fp,NSLCD_VERSION); \ + WRITE_INT32(fp,action); \ + /* prepare the search filter */ \ + if (mkfilter) \ + { \ + Debug(LDAP_DEBUG_ANY,"nssov_" __STRING(db) "_" __STRING(fn) "(): filter buffer too small",0,0,0); \ + return -1; \ + } \ + cb.sc_private = &cbp; \ + op->o_callback = &cb; \ + cb.sc_response = nssov_##db##_cb; \ + slap_op_time( &op->o_time, &op->o_tincr ); \ + op->o_req_dn = cbp.mi->mi_base; \ + op->o_req_ndn = cbp.mi->mi_base; \ + op->ors_scope = cbp.mi->mi_scope; \ + op->ors_filterstr = filter; \ + op->ors_filter = str2filter_x( op, filter.bv_val ); \ + op->ors_attrs = cbp.mi->mi_attrs; \ + op->ors_tlimit = SLAP_NO_LIMIT; \ + op->ors_slimit = SLAP_NO_LIMIT; \ + /* do the internal search */ \ + op->o_bd->be_search( op, &rs ); \ + filter_free_x( op, op->ors_filter ); \ + return 0; \ + } + +#endif /* NSSOV_H */ diff --git a/contrib/slapd-modules/nssov/passwd.c b/contrib/slapd-modules/nssov/passwd.c new file mode 100644 index 0000000000..e986b961f7 --- /dev/null +++ b/contrib/slapd-modules/nssov/passwd.c @@ -0,0 +1,432 @@ +/* passwd.c - password lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.0 NAME 'posixAccount' SUP top AUXILIARY + * DESC 'Abstraction of an account with POSIX attributes' + * MUST ( cn $ uid $ uidNumber $ gidNumber $ homeDirectory ) + * MAY ( userPassword $ loginShell $ gecos $ description ) ) + */ + +/* the basic search filter for searches */ +static struct berval passwd_filter = BER_BVC("(objectClass=posixAccount)"); + +/* the attributes used in searches */ +static struct berval passwd_keys[] = { + BER_BVC("uid"), + BER_BVC("userPassword"), + BER_BVC("uidNumber"), + BER_BVC("gidNumber"), + BER_BVC("gecos"), + BER_BVC("cn"), + BER_BVC("homeDirectory"), + BER_BVC("loginShell"), + BER_BVC("objectClass"), + BER_BVNULL +}; + +#define UID_KEY 0 +#define PWD_KEY 1 +#define UIDN_KEY 2 +#define GIDN_KEY 3 +#define GEC_KEY 4 +#define CN_KEY 5 +#define DIR_KEY 6 +#define SHL_KEY 7 + +/* default values for attributes */ +static struct berval default_passwd_userPassword = BER_BVC("*"); /* unmatchable */ +static struct berval default_passwd_homeDirectory = BER_BVC(""); +static struct berval default_passwd_loginShell = BER_BVC(""); + +static struct berval shadow_passwd = BER_BVC("x"); + +NSSOV_INIT(passwd) + +/* + Checks to see if the specified name is a valid user name. + + This test is based on the definition from POSIX (IEEE Std 1003.1, 2004, 3.426 User Name + and 3.276 Portable Filename Character Set): + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_426 + http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap03.html#tag_03_276 + + The standard defines user names valid if they contain characters from + the set [A-Za-z0-9._-] where the hyphen should not be used as first + character. As an extension this test allows the dolar '$' sign as the last + character to support Samba special accounts. +*/ +int isvalidusername(struct berval *bv) +{ + int i; + char *name = bv->bv_val; + if ((name==NULL)||(name[0]=='\0')) + return 0; + /* check first character */ + if ( ! ( (name[0]>='A' && name[0] <= 'Z') || + (name[0]>='a' && name[0] <= 'z') || + (name[0]>='0' && name[0] <= '9') || + name[0]=='.' || name[0]=='_' ) ) + return 0; + /* check other characters */ + for (i=1;ibv_len;i++) + { + if ( name[i]=='$' ) + { + /* if the char is $ we require it to be the last char */ + if (name[i+1]!='\0') + return 0; + } + else if ( ! ( (name[i]>='A' && name[i] <= 'Z') || + (name[i]>='a' && name[i] <= 'z') || + (name[i]>='0' && name[i] <= '9') || + name[i]=='.' || name[i]=='_' || name[i]=='-') ) + return 0; + } + /* no test failed so it must be good */ + return -1; +} + +/* return 1 on success */ +int nssov_dn2uid(Operation *op,nssov_info *ni,struct berval *dn,struct berval *uid) +{ + nssov_mapinfo *mi = &ni->ni_maps[NM_passwd]; + AttributeDescription *ad = mi->mi_attrs[UID_KEY].an_desc; + Entry *e; + + /* check for empty string */ + if (!dn->bv_len) + return 0; + /* try to look up uid within DN string */ + if (!strncmp(dn->bv_val,ad->ad_cname.bv_val,ad->ad_cname.bv_len) && + dn->bv_val[ad->ad_cname.bv_len] == '=') + { + struct berval bv, rdn; + dnRdn(dn, &rdn); + /* check if it is valid */ + bv.bv_val = dn->bv_val + ad->ad_cname.bv_len + 1; + bv.bv_len = rdn.bv_len - ad->ad_cname.bv_len - 1; + if (!isvalidusername(&bv)) + return 0; + ber_dupbv_x( uid, &bv, op->o_tmpmemctx ); + return 1; + } + /* look up the uid from the entry itself */ + if (be_entry_get_rw( op, dn, NULL, ad, 0, &e) == LDAP_SUCCESS) + { + Attribute *a = attr_find(e->e_attrs, ad); + if (a) { + ber_dupbv_x(uid, &a->a_vals[0], op->o_tmpmemctx); + } + be_entry_release_r(op, e); + if (a) + return 1; + } + return 0; +} + +static int uid2dn_cb(Operation *op,SlapReply *rs) +{ + if ( rs->sr_type == REP_SEARCH ) + { + struct berval *bv = op->o_callback->sc_private; + if ( !BER_BVISNULL(bv)) { + op->o_tmpfree( bv->bv_val, op->o_tmpmemctx ); + BER_BVZERO(bv); + return LDAP_ALREADY_EXISTS; + } + ber_dupbv_x(bv, &rs->sr_entry->e_name, op->o_tmpmemctx); + } + return LDAP_SUCCESS; +} + +int nssov_uid2dn(Operation *op,nssov_info *ni,struct berval *uid,struct berval *dn) +{ + nssov_mapinfo *mi = &ni->ni_maps[NM_passwd]; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf),fbuf}; + slap_callback cb = {0}; + SlapReply rs = {REP_RESULT}; + Operation op2; + int rc; + + /* if it isn't a valid username, just bail out now */ + if (!isvalidusername(uid)) + return 0; + /* we have to look up the entry */ + nssov_filter_byid(mi,UIDN_KEY,uid,&filter); + BER_BVZERO(dn); + cb.sc_private = dn; + cb.sc_response = uid2dn_cb; + op2 = *op; + op2.o_callback = &cb; + op2.o_req_dn = mi->mi_base; + op2.o_req_ndn = mi->mi_base; + op2.ors_scope = mi->mi_scope; + op2.ors_filterstr = filter; + op2.ors_filter = str2filter_x( op, filter.bv_val ); + op2.ors_attrs = slap_anlist_no_attrs; + rc = op2.o_bd->be_search( &op2, &rs ); + filter_free_x( op, op2.ors_filter ); + return rc == LDAP_SUCCESS; +} + +/* the maximum number of uidNumber attributes per entry */ +#define MAXUIDS_PER_ENTRY 5 + +NSSOV_CBPRIV(passwd, + char buf[256]; + struct berval name; + struct berval id;); + +static struct berval shadowclass = BER_BVC("shadowAccount"); + +static int write_passwd(nssov_passwd_cbp *cbp,Entry *entry) +{ + int32_t tmpint32; + struct berval tmparr[2], tmpuid[2]; + const char **tmpvalues; + char *tmp; + struct berval *names; + struct berval *uids; + struct berval passwd = {0}; + gid_t gid; + struct berval gecos; + struct berval homedir; + struct berval shell; + Attribute *a; + int i,j; + int use_shadow = 0; + /* get the usernames for this entry */ + if (BER_BVISNULL(&cbp->name)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[UID_KEY].an_desc); + if (!a) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + names = a->a_vals; + } + else + { + names=tmparr; + names[0]=cbp->name; + BER_BVZERO(&names[1]); + } + /* get the password for this entry */ + a = attr_find(entry->e_attrs, slap_schema.si_ad_objectClass); + if ( a ) { + for ( i=0; ia_numvals; i++) { + if ( bvmatch( &shadowclass, &a->a_nvals[i] )) { + use_shadow = 1; + break; + } + } + } + if ( use_shadow ) + { + /* if the entry has a shadowAccount entry, point to that instead */ + passwd = shadow_passwd; + } + else + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[PWD_KEY].an_desc); + if (a) + get_userpassword(&a->a_vals[0], &passwd); + if (BER_BVISNULL(&passwd)) + passwd=default_passwd_userPassword; + } + /* get the uids for this entry */ + if (BER_BVISNULL(&cbp->id)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[UIDN_KEY].an_desc); + if ( !a ) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[UIDN_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + uids = a->a_vals; + } + else + { + uids = tmpuid; + uids[0] = cbp->id; + BER_BVZERO(&uids[1]); + } + /* get the gid for this entry */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[GIDN_KEY].an_desc); + if (!a) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[GIDN_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + else if (a->a_numvals != 1) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[GIDN_KEY].an_desc->ad_cname.bv_val,0); + } + gid=(gid_t)strtol(a->a_vals[0].bv_val,&tmp,0); + if ((a->a_vals[0].bv_val[0]=='\0')||(*tmp!='\0')) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s contains non-numeric %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[GIDN_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + /* get the gecos for this entry (fall back to cn) */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[GEC_KEY].an_desc); + if (!a) + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[CN_KEY].an_desc); + if (!a || !a->a_numvals) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s does not contain %s or %s value", + entry->e_name.bv_val, + cbp->mi->mi_attrs[GEC_KEY].an_desc->ad_cname.bv_val, + cbp->mi->mi_attrs[CN_KEY].an_desc->ad_cname.bv_val); + return 0; + } + else if (a->a_numvals > 1) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s contains multiple %s or %s values", + entry->e_name.bv_val, + cbp->mi->mi_attrs[GEC_KEY].an_desc->ad_cname.bv_val, + cbp->mi->mi_attrs[CN_KEY].an_desc->ad_cname.bv_val); + } + gecos=a->a_vals[0]; + /* get the home directory for this entry */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[DIR_KEY].an_desc); + if (!a) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[DIR_KEY].an_desc->ad_cname.bv_val,0); + homedir=default_passwd_homeDirectory; + } + else + { + if (a->a_numvals > 1) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[DIR_KEY].an_desc->ad_cname.bv_val,0); + } + homedir=a->a_vals[0]; + if (homedir.bv_val[0]=='\0') + homedir=default_passwd_homeDirectory; + } + /* get the shell for this entry */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[SHL_KEY].an_desc); + if (!a) + { + shell=default_passwd_loginShell; + } + else + { + if (a->a_numvals > 1) + { + Debug(LDAP_DEBUG_ANY,"passwd entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[SHL_KEY].an_desc->ad_cname.bv_val,0); + } + shell=a->a_vals[0]; + if (shell.bv_val[0]=='\0') + shell=default_passwd_loginShell; + } + /* write the entries */ + for (i=0;!BER_BVISNULL(&names[i]);i++) + { + if (!isvalidusername(&names[i])) + { + Debug(LDAP_DEBUG_ANY,"nssov: passwd entry %s contains invalid user name: \"%s\"", + entry->e_name.bv_val,names[i].bv_val,0); + } + else + { + for (j=0;!BER_BVISNULL(&uids[j]);j++) + { + char *tmp; + uid_t uid; + uid = strtol(uids[j].bv_val, &tmp, 0); + if ( *tmp ) { + Debug(LDAP_DEBUG_ANY,"nssov: passwd entry %s contains non-numeric %s value: \"%s\"", + entry->e_name.bv_val, cbp->mi->mi_attrs[UIDN_KEY].an_desc->ad_cname.bv_val, + names[i].bv_val); + continue; + } + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&names[i]); + WRITE_BERVAL(cbp->fp,&passwd); + WRITE_TYPE(cbp->fp,uid,uid_t); + WRITE_TYPE(cbp->fp,gid,gid_t); + WRITE_BERVAL(cbp->fp,&gecos); + WRITE_BERVAL(cbp->fp,&homedir); + WRITE_BERVAL(cbp->fp,&shell); + } + } + } + return 0; +} + +NSSOV_CB(passwd) + +NSSOV_HANDLE( + passwd,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf; + if (!isvalidusername(&cbp.name)) { + Debug(LDAP_DEBUG_ANY,"nssov_passwd_byname(%s): invalid user name",cbp.name.bv_val,0,0); + return -1; + } + BER_BVZERO(&cbp.id); , + Debug(LDAP_DEBUG_TRACE,"nssov_passwd_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_PASSWD_BYNAME, + nssov_filter_byname(cbp.mi,UID_KEY,&cbp.name,&filter) +) + +NSSOV_HANDLE( + passwd,byuid, + uid_t uid; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_TYPE(fp,uid,uid_t); + cbp.id.bv_val = cbp.buf; + cbp.id.bv_len = snprintf(cbp.buf,sizeof(cbp.buf),"%d",uid); + BER_BVZERO(&cbp.name);, + Debug(LDAP_DEBUG_TRACE,"nssov_passwd_byuid(%s)",cbp.id.bv_val,0,0);, + NSLCD_ACTION_PASSWD_BYUID, + nssov_filter_byid(cbp.mi,UIDN_KEY,&cbp.id,&filter) +) + +NSSOV_HANDLE( + passwd,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name); + BER_BVZERO(&cbp.id);, + Debug(LDAP_DEBUG_TRACE,"nssov_passwd_all()",0,0,0);, + NSLCD_ACTION_PASSWD_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/protocol.c b/contrib/slapd-modules/nssov/protocol.c new file mode 100644 index 0000000000..54a176bc2d --- /dev/null +++ b/contrib/slapd-modules/nssov/protocol.c @@ -0,0 +1,153 @@ +/* protocol.c - network protocol lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.4 NAME 'ipProtocol' SUP top STRUCTURAL + * DESC 'Abstraction of an IP protocol. Maps a protocol number + * to one or more names. The distinguished value of the cn + * attribute denotes the protocol's canonical name' + * MUST ( cn $ ipProtocolNumber ) + * MAY description ) + */ + +/* the basic search filter for searches */ +static struct berval protocol_filter = BER_BVC("(objectClass=ipProtocol)"); + +/* the attributes used in searches */ +static struct berval protocol_keys[] = { + BER_BVC("cn"), + BER_BVC("ipProtocolNumber"), + BER_BVNULL +}; + +NSSOV_INIT(protocol) + +NSSOV_CBPRIV(protocol, + char buf[256]; + struct berval name; + struct berval numb;); + +static int write_protocol(nssov_protocol_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int i,numname,dupname,proto; + struct berval name,*names; + Attribute *a; + char *tmp; + + /* get the most canonical name */ + nssov_find_rdnval( &entry->e_nname, cbp->mi->mi_attrs[0].an_desc, &name ); + /* get the other names for the protocol */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[0].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"protocol entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + names = a->a_vals; + numname = a->a_numvals; + /* if the name is not yet found, get the first entry from names */ + if (BER_BVISNULL(&name)) { + name=names[0]; + dupname = 0; + } else { + dupname = -1; + for (i=0; ia_nvals[i])) { + dupname = i; + break; + } + } + } + /* get the protocol number */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[1].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"protocol entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } else if ( a->a_numvals > 1 ) { + Debug(LDAP_DEBUG_ANY,"protocol entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + } + proto=(int)strtol(a->a_vals[0].bv_val,&tmp,0); + if (*tmp) + { + Debug(LDAP_DEBUG_ANY,"protocol entry %s contains non-numeric %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + /* write the entry */ + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&name); + if ( dupname >= 0 ) { + WRITE_INT32(cbp->fp,numname-1); + } else { + WRITE_INT32(cbp->fp,numname); + } + for (i=0;ifp,&names[i]); + } + WRITE_INT32(cbp->fp,proto); + return 0; +} + +NSSOV_CB(protocol) + +NSSOV_HANDLE( + protocol,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.numb); + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_protocol_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_PROTOCOL_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + protocol,bynumber, + int protocol; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_INT32(fp,protocol); + cbp.numb.bv_val = cbp.buf; + cbp.numb.bv_len = snprintf(cbp.buf,sizeof(cbp.buf),"%d",protocol); + BER_BVZERO(&cbp.name);, + Debug(LDAP_DEBUG_TRACE,"nssov_protocol_bynumber(%s)",cbp.numb.bv_val,0,0);, + NSLCD_ACTION_PROTOCOL_BYNUMBER, + nssov_filter_byid(cbp.mi,1,&cbp.numb,&filter) +) + +NSSOV_HANDLE( + protocol,all, + struct berval filter; + /* no parameters to read */, + Debug(LDAP_DEBUG_TRACE,"nssov_protocol_all()",0,0,0);, + NSLCD_ACTION_PROTOCOL_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/rpc.c b/contrib/slapd-modules/nssov/rpc.c new file mode 100644 index 0000000000..b9e8ca8875 --- /dev/null +++ b/contrib/slapd-modules/nssov/rpc.c @@ -0,0 +1,156 @@ +/* rpc.c - rpc lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.5 NAME 'oncRpc' SUP top STRUCTURAL + * DESC 'Abstraction of an Open Network Computing (ONC) + * [RFC1057] Remote Procedure Call (RPC) binding. + * This class maps an ONC RPC number to a name. + * The distinguished value of the cn attribute denotes + * the RPC service's canonical name' + * MUST ( cn $ oncRpcNumber ) + * MAY description ) + */ + +/* the basic search filter for searches */ +static struct berval rpc_filter = BER_BVC("(objectClass=oncRpc)"); + +/* the attributes to request with searches */ +static struct berval rpc_keys[] = { + BER_BVC("cn"), + BER_BVC("oncRpcNumber"), + BER_BVNULL +}; + +NSSOV_INIT(rpc) + +NSSOV_CBPRIV(rpc, + char buf[256]; + struct berval name; + struct berval numb;); + +/* write a single rpc entry to the stream */ +static int write_rpc(nssov_rpc_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + int i,numname,dupname,number; + struct berval name,*names; + Attribute *a; + char *tmp; + + /* get the most canonical name */ + nssov_find_rdnval( &entry->e_nname, cbp->mi->mi_attrs[0].an_desc, &name ); + /* get the other names for the rpc */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[0].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"rpc entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + names = a->a_vals; + numname = a->a_numvals; + /* if the name is not yet found, get the first entry from names */ + if (BER_BVISNULL(&name)) { + name=names[0]; + dupname = 0; + } else { + dupname = -1; + for (i=0; ia_nvals[i])) { + dupname = i; + break; + } + } + } + /* get the rpc number */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[1].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"rpc entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } else if ( a->a_numvals > 1 ) { + Debug(LDAP_DEBUG_ANY,"rpc entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + } + number=(int)strtol(a->a_vals[0].bv_val,&tmp,0); + if (*tmp) + { + Debug(LDAP_DEBUG_ANY,"rpc entry %s contains non-numeric %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + /* write the entry */ + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&name); + if ( dupname >= 0 ) { + WRITE_INT32(cbp->fp,numname-1); + } else { + WRITE_INT32(cbp->fp,numname); + } + for (i=0;ifp,&names[i]); + } + WRITE_INT32(cbp->fp,number); + return 0; +} + +NSSOV_CB(rpc) + +NSSOV_HANDLE( + rpc,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + BER_BVZERO(&cbp.numb); + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf;, + Debug(LDAP_DEBUG_TRACE,"nssov_rpc_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_RPC_BYNAME, + nssov_filter_byname(cbp.mi,0,&cbp.name,&filter) +) + +NSSOV_HANDLE( + rpc,bynumber, + int number; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_INT32(fp,number); + cbp.numb.bv_val = cbp.buf; + cbp.numb.bv_len = snprintf(cbp.buf,sizeof(cbp.buf),"%d",number); + BER_BVZERO(&cbp.name);, + Debug(LDAP_DEBUG_TRACE,"nssov_rpc_bynumber(%d)",cbp.numb.bv_val,0,0);, + NSLCD_ACTION_RPC_BYNUMBER, + nssov_filter_byid(cbp.mi,1,&cbp.numb,&filter) +) + +NSSOV_HANDLE( + rpc,all, + struct berval filter; + /* no parameters to read */, + Debug(LDAP_DEBUG_TRACE,"nssov_rpc_all()",0,0,0);, + NSLCD_ACTION_RPC_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/service.c b/contrib/slapd-modules/nssov/service.c new file mode 100644 index 0000000000..ceaf901187 --- /dev/null +++ b/contrib/slapd-modules/nssov/service.c @@ -0,0 +1,248 @@ +/* service.c - service lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.3 NAME 'ipService' SUP top STRUCTURAL + * DESC 'Abstraction an Internet Protocol service. + * Maps an IP port and protocol (such as tcp or udp) + * to one or more names; the distinguished value of + * the cn attribute denotes the service's canonical + * name' + * MUST ( cn $ ipServicePort $ ipServiceProtocol ) + * MAY ( description ) ) + */ + +/* the basic search filter for searches */ +static struct berval service_filter = BER_BVC("(objectClass=ipService)"); + +/* the attributes to request with searches */ +static struct berval service_keys[] = { + BER_BVC("cn"), + BER_BVC("ipServicePort"), + BER_BVC("ipServiceProtocol"), + BER_BVNULL +}; + +static int mkfilter_service_byname(nssov_mapinfo *mi,struct berval *name, + struct berval *protocol,struct berval *buf) +{ + char buf2[1024],buf3[1024]; + struct berval bv2 = {sizeof(buf2),buf2}; + struct berval bv3 = {sizeof(buf3),buf3}; + + /* escape attributes */ + if (nssov_escape(name,&bv2)) + return -1; + if (!BER_BVISNULL(protocol)) { + if (nssov_escape(protocol,&bv3)) + return -1; + if (bv2.bv_len + mi->mi_filter.bv_len + mi->mi_attrs[0].an_desc->ad_cname.bv_len + + bv3.bv_len + mi->mi_attrs[2].an_desc->ad_cname.bv_len + 9 > buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s)(%s=%s))", + mi->mi_filter.bv_val, + mi->mi_attrs[0].an_desc->ad_cname.bv_val, bv2.bv_val, + mi->mi_attrs[2].an_desc->ad_cname.bv_val, bv3.bv_val ); + } else { + if (bv2.bv_len + mi->mi_filter.bv_len + mi->mi_attrs[0].an_desc->ad_cname.bv_len + 6 > + buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s))", + mi->mi_filter.bv_val, mi->mi_attrs[0].an_desc->ad_cname.bv_val, + bv2.bv_val ); + } + return 0; +} + +static int mkfilter_service_bynumber(nssov_mapinfo *mi,struct berval *numb, + struct berval *protocol,struct berval *buf) +{ + char buf2[1024]; + struct berval bv2 = {sizeof(buf2),buf2}; + + /* escape attribute */ + if (!BER_BVISNULL(protocol)) { + if (nssov_escape(protocol,&bv2)) + return -1; + if (numb->bv_len + mi->mi_filter.bv_len + mi->mi_attrs[1].an_desc->ad_cname.bv_len + + bv2.bv_len + mi->mi_attrs[2].an_desc->ad_cname.bv_len + 9 > buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s)(%s=%s))", + mi->mi_filter.bv_val, + mi->mi_attrs[1].an_desc->ad_cname.bv_val, numb->bv_val, + mi->mi_attrs[2].an_desc->ad_cname.bv_val, bv2.bv_val ); + } else { + if (numb->bv_len + mi->mi_filter.bv_len + mi->mi_attrs[1].an_desc->ad_cname.bv_len + 6 > + buf->bv_len ) + return -1; + buf->bv_len = snprintf(buf->bv_val, buf->bv_len, "(&%s(%s=%s))", + mi->mi_filter.bv_val, mi->mi_attrs[1].an_desc->ad_cname.bv_val, + numb->bv_val ); + } + return 0; +} + +NSSOV_INIT(service) + +NSSOV_CBPRIV(service, + char nbuf[256]; + char pbuf[256]; + struct berval name; + struct berval prot;); + +static int write_service(nssov_service_cbp *cbp,Entry *entry) +{ + int32_t tmpint32,tmp2int32,tmp3int32; + struct berval name,*names,*ports,*protos; + struct berval tmparr[2]; + Attribute *a; + char *tmp; + int port; + int i,numname,dupname,numprot; + + /* get the most canonical name */ + nssov_find_rdnval( &entry->e_nname, cbp->mi->mi_attrs[0].an_desc, &name ); + /* get the other names for the rpc */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[0].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"service entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[0].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + names = a->a_vals; + numname = a->a_numvals; + /* if the name is not yet found, get the first entry from names */ + if (BER_BVISNULL(&name)) { + name=names[0]; + dupname = 0; + } else { + dupname = -1; + for (i=0; ia_nvals[i])) { + dupname = i; + break; + } + } + } + /* get the service number */ + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[1].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"service entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } else if ( a->a_numvals > 1 ) { + Debug(LDAP_DEBUG_ANY,"service entry %s contains multiple %s values", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + } + port=(int)strtol(a->a_vals[0].bv_val,&tmp,0); + if (*tmp) + { + Debug(LDAP_DEBUG_ANY,"service entry %s contains non-numeric %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[1].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + /* get protocols */ + if (BER_BVISNULL(&cbp->prot)) + { + a = attr_find( entry->e_attrs, cbp->mi->mi_attrs[2].an_desc ); + if ( !a || !a->a_vals ) + { + Debug(LDAP_DEBUG_ANY,"service entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[2].an_desc->ad_cname.bv_val, 0 ); + return 0; + } + protos = a->a_vals; + numprot = a->a_numvals; + } + else + { + protos=tmparr; + protos[0]=cbp->prot; + BER_BVZERO(&protos[1]); + numprot = 1; + } + /* write the entries */ + for (i=0;ifp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&name); + if ( dupname >= 0 ) { + WRITE_INT32(cbp->fp,numname-1); + } else { + WRITE_INT32(cbp->fp,numname); + } + for (j=0;jfp,&names[j]); + } + WRITE_INT32(cbp->fp,port); + WRITE_BERVAL(cbp->fp,&protos[i]); + } + return 0; +} + +NSSOV_CB(service) + +NSSOV_HANDLE( + service,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.nbuf,sizeof(cbp.nbuf)); + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.nbuf; + READ_STRING_BUF2(fp,cbp.pbuf,sizeof(cbp.pbuf)); + cbp.prot.bv_len = tmpint32; + cbp.prot.bv_val = tmpint32 ? cbp.pbuf : NULL;, + Debug(LDAP_DEBUG_TRACE,"nssov_service_byname(%s,%s)",cbp.name.bv_val,cbp.prot.bv_val,0);, + NSLCD_ACTION_SERVICE_BYNAME, + mkfilter_service_byname(cbp.mi,&cbp.name,&cbp.prot,&filter) +) + +NSSOV_HANDLE( + service,bynumber, + int number; + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_INT32(fp,number); + cbp.name.bv_val = cbp.nbuf; + cbp.name.bv_len = snprintf(cbp.nbuf,sizeof(cbp.nbuf),"%d",number); + READ_STRING_BUF2(fp,cbp.pbuf,sizeof(cbp.pbuf)); + cbp.prot.bv_len = tmpint32; + cbp.prot.bv_val = tmpint32 ? cbp.pbuf : NULL;, + Debug(LDAP_DEBUG_TRACE,"nssov_service_bynumber(%s,%s)",cbp.name.bv_val,cbp.prot.bv_val,0);, + NSLCD_ACTION_SERVICE_BYNUMBER, + mkfilter_service_bynumber(cbp.mi,&cbp.name,&cbp.prot,&filter) +) + +NSSOV_HANDLE( + service,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.prot);, + Debug(LDAP_DEBUG_TRACE,"nssov_service_all()",0,0,0);, + NSLCD_ACTION_SERVICE_ALL, + (filter=cbp.mi->mi_filter,0) +) diff --git a/contrib/slapd-modules/nssov/shadow.c b/contrib/slapd-modules/nssov/shadow.c new file mode 100644 index 0000000000..49fd6fbd3f --- /dev/null +++ b/contrib/slapd-modules/nssov/shadow.c @@ -0,0 +1,255 @@ +/* shadow.c - shadow account lookup routines */ +/* $OpenLDAP$ */ +/* + * Copyright 2008 by Howard Chu, Symas Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted only as authorized by the OpenLDAP + * Public License. + * + * A copy of this license is available in the file LICENSE in the + * top-level directory of the distribution or, alternatively, at + * . + */ +/* + * This code references portions of the nss-ldapd package + * written by Arthur de Jong. The nss-ldapd code was forked + * from the nss-ldap library written by Luke Howard. + */ + +#include "nssov.h" + +/* ( nisSchema.2.1 NAME 'shadowAccount' SUP top AUXILIARY + * DESC 'Additional attributes for shadow passwords' + * MUST uid + * MAY ( userPassword $ shadowLastChange $ shadowMin + * shadowMax $ shadowWarning $ shadowInactive $ + * shadowExpire $ shadowFlag $ description ) ) + */ + +/* the basic search filter for searches */ +static struct berval shadow_filter = BER_BVC("(objectClass=shadowAccount)"); + +/* the attributes to request with searches */ +static struct berval shadow_keys[] = { + BER_BVC("uid"), + BER_BVC("userPassword"), + BER_BVC("shadowLastChange"), + BER_BVC("shadowMin"), + BER_BVC("shadowMax"), + BER_BVC("shadowWarning"), + BER_BVC("shadowInactive"), + BER_BVC("shadowExpire"), + BER_BVC("shadowFlag"), + BER_BVNULL +}; + +#define UID_KEY 0 +#define PWD_KEY 1 +#define CHG_KEY 2 +#define MIN_KEY 3 +#define MAX_KEY 4 +#define WRN_KEY 5 +#define INA_KEY 6 +#define EXP_KEY 7 +#define FLG_KEY 8 + +/* default values for attributes */ +static struct berval default_shadow_userPassword = BER_BVC("*"); /* unmatchable */ +static int default_nums[] = { 0,0, + -1, /* LastChange */ + -1, /* Min */ + -1, /* Max */ + -1, /* Warning */ + -1, /* Inactive */ + -1, /* Expire */ + 0 /* Flag */ +}; + +NSSOV_INIT(shadow) + +static long to_date(struct berval *date,AttributeDescription *attr) +{ + long value; + char *tmp; + /* do some special handling for date values on AD */ + if (strcasecmp(attr->ad_cname.bv_val,"pwdLastSet")==0) + { + char buffer[8]; + size_t l; + /* we expect an AD 64-bit datetime value; + we should do date=date/864000000000-134774 + but that causes problems on 32-bit platforms, + first we devide by 1000000000 by stripping the + last 9 digits from the string and going from there */ + l=date->bv_len-9; + if (l<1 || l>(sizeof(buffer)-1)) + return 0; /* error */ + strncpy(buffer,date->bv_val,l); + buffer[l]='\0'; + value=strtol(buffer,&tmp,0); + if ((buffer[0]=='\0')||(*tmp!='\0')) + { + Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value", + attr->ad_cname.bv_val,0,0); + return 0; + } + return value/864-134774; + /* note that AD does not have expiry dates but a lastchangeddate + and some value that needs to be added */ + } + value=strtol(date->bv_val,&tmp,0); + if ((date->bv_val[0]=='\0')||(*tmp!='\0')) + { + Debug(LDAP_DEBUG_ANY,"shadow entry contains non-numeric %s value", + attr->ad_cname.bv_val,0,0); + return 0; + } + return value; +} + +#ifndef UF_DONT_EXPIRE_PASSWD +#define UF_DONT_EXPIRE_PASSWD 0x10000 +#endif + +#define GET_OPTIONAL_LONG(var,key) \ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[key].an_desc); \ + if ( !a || BER_BVISNULL(&a->a_vals[0])) \ + var = default_nums[key]; \ + else \ + { \ + if (a->a_numvals > 1) \ + { \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values", \ + entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ + } \ + var=strtol(a->a_vals[0].bv_val,&tmp,0); \ + if ((a->a_vals[0].bv_val[0]=='\0')||(*tmp!='\0')) \ + { \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains non-numeric %s value", \ + entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ + return 0; \ + } \ + } + +#define GET_OPTIONAL_DATE(var,key) \ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[key].an_desc); \ + if ( !a || BER_BVISNULL(&a->a_vals[0])) \ + var = default_nums[key]; \ + else \ + { \ + if (a->a_numvals > 1) \ + { \ + Debug(LDAP_DEBUG_ANY,"shadow entry %s contains multiple %s values", \ + entry->e_name.bv_val, cbp->mi->mi_attrs[key].an_desc->ad_cname.bv_val,0); \ + } \ + var=to_date(&a->a_vals[0],cbp->mi->mi_attrs[key].an_desc); \ + } + +NSSOV_CBPRIV(shadow, + char buf[256]; + struct berval name;); + +static int write_shadow(nssov_shadow_cbp *cbp,Entry *entry) +{ + struct berval tmparr[2]; + struct berval *names; + Attribute *a; + char *tmp; + struct berval passwd = {0}; + long lastchangedate; + long mindays; + long maxdays; + long warndays; + long inactdays; + long expiredate; + unsigned long flag; + int i; + int32_t tmpint32; + /* get username */ + if (BER_BVISNULL(&cbp->name)) + { + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[UID_KEY].an_desc); + if (!a) + { + Debug(LDAP_DEBUG_ANY,"shadow entry %s does not contain %s value", + entry->e_name.bv_val, cbp->mi->mi_attrs[UID_KEY].an_desc->ad_cname.bv_val,0); + return 0; + } + names = a->a_vals; + } + else + { + names=tmparr; + names[0]=cbp->name; + BER_BVZERO(&names[1]); + } + /* get password */ + a = attr_find(entry->e_attrs, cbp->mi->mi_attrs[PWD_KEY].an_desc); + if ( a ) + get_userpassword(&a->a_vals[0], &passwd); + if (BER_BVISNULL(&passwd)) + passwd=default_shadow_userPassword; + /* get lastchange date */ + GET_OPTIONAL_DATE(lastchangedate,CHG_KEY); + /* get mindays */ + GET_OPTIONAL_LONG(mindays,MIN_KEY); + /* get maxdays */ + GET_OPTIONAL_LONG(maxdays,MAX_KEY); + /* get warndays */ + GET_OPTIONAL_LONG(warndays,WRN_KEY); + /* get inactdays */ + GET_OPTIONAL_LONG(inactdays,INA_KEY); + /* get expire date */ + GET_OPTIONAL_LONG(expiredate,EXP_KEY); + /* get flag */ + GET_OPTIONAL_LONG(flag,FLG_KEY); + /* if we're using AD handle the flag specially */ + if (strcasecmp(cbp->mi->mi_attrs[CHG_KEY].an_desc->ad_cname.bv_val,"pwdLastSet")==0) + { + if (flag&UF_DONT_EXPIRE_PASSWD) + maxdays=99999; + flag=0; + } + /* write the entries */ + for (i=0;!BER_BVISNULL(&names[i]);i++) + { + WRITE_INT32(cbp->fp,NSLCD_RESULT_SUCCESS); + WRITE_BERVAL(cbp->fp,&names[i]); + WRITE_BERVAL(cbp->fp,&passwd); + WRITE_INT32(cbp->fp,lastchangedate); + WRITE_INT32(cbp->fp,mindays); + WRITE_INT32(cbp->fp,maxdays); + WRITE_INT32(cbp->fp,warndays); + WRITE_INT32(cbp->fp,inactdays); + WRITE_INT32(cbp->fp,expiredate); + WRITE_INT32(cbp->fp,flag); + } + return 0; +} + +NSSOV_CB(shadow) + +NSSOV_HANDLE( + shadow,byname, + char fbuf[1024]; + struct berval filter = {sizeof(fbuf)}; + filter.bv_val = fbuf; + READ_STRING_BUF2(fp,cbp.buf,sizeof(cbp.buf));, + cbp.name.bv_len = tmpint32; + cbp.name.bv_val = cbp.buf; + Debug(LDAP_DEBUG_ANY,"nssov_shadow_byname(%s)",cbp.name.bv_val,0,0);, + NSLCD_ACTION_SHADOW_BYNAME, + nssov_filter_byname(cbp.mi,UID_KEY,&cbp.name,&filter) +) + +NSSOV_HANDLE( + shadow,all, + struct berval filter; + /* no parameters to read */ + BER_BVZERO(&cbp.name);, + Debug(LDAP_DEBUG_ANY,"nssov_shadow_all()",0,0,0);, + NSLCD_ACTION_SHADOW_ALL, + (filter=cbp.mi->mi_filter,0) +) -- 2.39.5