diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2007-07-24 06:40:19 +0000 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2007-07-24 06:40:19 +0000 |
commit | 58c040f93c5d4ed769149def21110f30473618a5 (patch) | |
tree | f71509f83c5dac5cf6dcd5c85369d7882015720c | |
parent | f7987dfc5745fb6255fdbd2f095f3f17d8a676d6 (diff) |
get rid of dnsconfig stuff since that probably didn't work anyway and it cleans up some stuff
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-ldapd@323 ef36b2f9-881f-0410-afb5-c4e39611909c
-rw-r--r-- | debian/copyright | 39 | ||||
-rw-r--r-- | nslcd/Makefile.am | 2 | ||||
-rw-r--r-- | nslcd/cfg.c | 12 | ||||
-rw-r--r-- | nslcd/cfg.h | 2 | ||||
-rw-r--r-- | nslcd/dnsconfig.c | 187 | ||||
-rw-r--r-- | nslcd/dnsconfig.h | 30 | ||||
-rw-r--r-- | nslcd/resolve.c | 352 | ||||
-rw-r--r-- | nslcd/resolve.h | 118 | ||||
-rw-r--r-- | nss-ldapd.conf.5 | 4 |
9 files changed, 0 insertions, 746 deletions
diff --git a/debian/copyright b/debian/copyright index 375ecdf..4825022 100644 --- a/debian/copyright +++ b/debian/copyright @@ -49,45 +49,6 @@ with or without modifications. The code is Copyright (C) 1996-2006 Free Software Foundation, Inc. (years aggregated). -The files nslcd/resolve.c and nslcd/resolve.h include the following copyright -statement: - - Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hvgskolan - (Royal Institute of Technology, Stockholm, Sweden). - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. All advertising materials mentioning features or use of this software - must display the following acknowledgement: - This product includes software developed by the Kungliga Tekniska - Hvgskolan and its contributors. - - 4. Neither the name of the Institute nor the names of its contributors - may be used to endorse or promote products derived from this software - without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - SUCH DAMAGE. - The file m4/acx_pthread.m4 contains the following copyright statement: Copyright (c) 2006 Steven G. Johnson <stevenj@alum.mit.edu> diff --git a/nslcd/Makefile.am b/nslcd/Makefile.am index a571986..0da800a 100644 --- a/nslcd/Makefile.am +++ b/nslcd/Makefile.am @@ -26,9 +26,7 @@ AM_CFLAGS = $(PTHREAD_CFLAGS) nslcd_SOURCES = nslcd.c ../nslcd.h ../nslcd-common.h \ log.c log.h \ common.c common.h \ - resolve.c resolve.h \ ldap-schema.c ldap-schema.h \ - dnsconfig.c dnsconfig.h \ ldap-nss.c ldap-nss.h \ pagectrl.c pagectrl.h \ util.c util.h \ diff --git a/nslcd/cfg.c b/nslcd/cfg.c index 5b7847b..6fae4b8 100644 --- a/nslcd/cfg.c +++ b/nslcd/cfg.c @@ -36,7 +36,6 @@ #include "ldap-nss.h" #include "util.h" #include "log.h" -#include "dnsconfig.h" struct ldap_config *nslcd_cfg=NULL; @@ -97,7 +96,6 @@ struct ldap_config *nslcd_cfg=NULL; #define NSS_LDAP_KEY_PAGED_RESULTS "nss_paged_results" #define NSS_LDAP_KEY_SCHEMA "nss_schema" -#define NSS_LDAP_KEY_SRV_DOMAIN "nss_srv_domain" #define NSS_LDAP_KEY_CONNECT_POLICY "nss_connect_policy" /* @@ -154,7 +152,6 @@ static enum nss_status _nss_ldap_init_config(struct ldap_config *result) result->ldc_idle_timelimit = 0; result->ldc_reconnect_pol = LP_RECONNECT_HARD_OPEN; result->ldc_sasl_secprops = NULL; - result->ldc_srv_domain = NULL; result->ldc_logdir = NULL; result->ldc_debug = 0; result->ldc_pagesize = LDAP_PAGESIZE; @@ -880,10 +877,6 @@ static enum nss_status _nss_ldap_readconfig(struct ldap_config ** presult, char result->ldc_flags &= ~(NSS_LDAP_FLAGS_CONNECT_POLICY_ONESHOT); } } - else if (!strcasecmp (k, NSS_LDAP_KEY_SRV_DOMAIN)) - { - t = &result->ldc_srv_domain; - } else { /* @@ -981,11 +974,6 @@ int cfg_init(void) configbufp=configbuf; configbuflen=sizeof(configbuf); retv=_nss_ldap_readconfig(&nslcd_cfg,&configbufp,&configbuflen); - if (retv==NSS_STATUS_NOTFOUND) - { - /* config was read but no host information specified; try DNS */ - retv=_nss_ldap_mergeconfigfromdns(nslcd_cfg,&configbufp,&configbuflen); - } if (retv!=NSS_STATUS_SUCCESS) { log_log(LOG_DEBUG,"cfg_init() failed to read config"); diff --git a/nslcd/cfg.h b/nslcd/cfg.h index 67a6f98..6075093 100644 --- a/nslcd/cfg.h +++ b/nslcd/cfg.h @@ -114,8 +114,6 @@ struct ldap_config int ldc_reconnect_maxconntries; /* sasl security */ char *ldc_sasl_secprops; - /* DNS SRV RR domain */ - char *ldc_srv_domain; /* directory for debug files */ char *ldc_logdir; /* LDAP debug level */ diff --git a/nslcd/dnsconfig.c b/nslcd/dnsconfig.c deleted file mode 100644 index 6850da5..0000000 --- a/nslcd/dnsconfig.c +++ /dev/null @@ -1,187 +0,0 @@ -/* - dnsconfig.c - lookup code for DNS SRV records - 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 -*/ - -/* - * Support DNS SRV records. I look up the SRV record for - * _ldap._tcp.gnu.org. - * and build the DN DC=gnu,DC=org. - * Thanks to Assar & co for resolve.[ch]. - */ - -#include "config.h" - -#include <stdio.h> -#include <string.h> -#include <stdlib.h> -#include <sys/param.h> -#include <netdb.h> -#include <netinet/in.h> -#include <arpa/nameser.h> -#include <resolv.h> -#include <string.h> -#ifdef HAVE_LBER_H -#include <lber.h> -#endif -#ifdef HAVE_LDAP_H -#include <ldap.h> -#endif - -#include "ldap-nss.h" -#include "util.h" -#include "resolve.h" -#include "dnsconfig.h" - -#define DC_ATTR "DC" -#define DC_ATTR_AVA DC_ATTR"=" -#define DC_ATTR_AVA_LEN (sizeof(DC_ATTR_AVA) - 1) - -/* map gnu.org into DC=gnu,DC=org */ -static enum nss_status -_nss_ldap_getdnsdn (char *src_domain, - char **rval, char **buffer, size_t * buflen) -{ - char *p; - int len = 0; -#ifdef HAVE_STRTOK_R - char *st = NULL; -#endif - char *bptr; - char *domain, *domain_copy; - - /* we need to take a copy of domain, because strtok() modifies - * it in place. Bad. - */ - domain_copy = strdup (src_domain); - if (domain_copy == NULL) - { - return NSS_STATUS_TRYAGAIN; - } - - domain = domain_copy; - - bptr = *rval = *buffer; - **rval = '\0'; - -#ifndef HAVE_STRTOK_R - while ((p = strtok (domain, "."))) -#else - while ((p = strtok_r (domain, ".", &st))) -#endif - { - len = strlen (p); - - if (*buflen < (size_t) (len + DC_ATTR_AVA_LEN + 1 /* D C = [,|\0] */ )) - { - free (domain_copy); - return NSS_STATUS_TRYAGAIN; - } - - if (domain == NULL) - { - strcpy (bptr, ","); - bptr++; - } - else - { - domain = NULL; - } - - strcpy (bptr, DC_ATTR_AVA); - bptr += DC_ATTR_AVA_LEN; - - strcpy (bptr, p); - bptr += len; /* don't include comma */ - *buffer += len + DC_ATTR_AVA_LEN + 1; - *buflen -= len + DC_ATTR_AVA_LEN + 1; - } - - if (bptr != NULL) - { - (*rval)[bptr - *rval] = '\0'; - } - - free (domain_copy); - - return NSS_STATUS_SUCCESS; -} - -enum nss_status -_nss_ldap_mergeconfigfromdns (struct ldap_config * result, - char **buffer, size_t *buflen) -{ - enum nss_status stat = NSS_STATUS_SUCCESS; - struct dns_reply *r; - struct resource_record *rr; - char domain[MAXHOSTNAMELEN + 1]; - char *pDomain; - char uribuf[1024]; - - if ((_res.options & RES_INIT) == 0 && res_init () == -1) - { - return NSS_STATUS_UNAVAIL; - } - - if (result->ldc_srv_domain != NULL) - pDomain = result->ldc_srv_domain; - else - { - snprintf (domain, sizeof (domain), "_ldap._tcp.%s.", _res.defdname); - pDomain = domain; - } - - r = dns_lookup (pDomain, "srv"); - if (r == NULL) - { - return NSS_STATUS_NOTFOUND; - } - - /* XXX sort by priority */ - for (rr = r->head; rr != NULL; rr = rr->next) - { - if (rr->type == T_SRV) - { - snprintf (uribuf, sizeof(uribuf), "ldap%s:%s:%d", - (rr->u.srv->port == LDAPS_PORT) ? "s" : "", - rr->u.srv->target, - rr->u.srv->port); - - stat = _nss_ldap_add_uri (result, uribuf, buffer, buflen); - if (stat != NSS_STATUS_SUCCESS) - { - break; - } - } - } - - dns_free_data (r); - stat = NSS_STATUS_SUCCESS; - - if (result->ldc_base == NULL) - { - stat = _nss_ldap_getdnsdn (_res.defdname, &result->ldc_base, - buffer, buflen); - } - - return stat; -} - diff --git a/nslcd/dnsconfig.h b/nslcd/dnsconfig.h deleted file mode 100644 index b173f34..0000000 --- a/nslcd/dnsconfig.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - dnsconfig.c - lookup code for DNS SRV records - 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_DNSCONFIG_H -#define _LDAP_NSS_LDAP_DNSCONFIG_H - -enum nss_status _nss_ldap_mergeconfigfromdns (struct ldap_config * result, - char **buffer, size_t *buflen); - -#endif /* _LDAP_NSS_LDAP_DNSCONFIG_H */ diff --git a/nslcd/resolve.c b/nslcd/resolve.c deleted file mode 100644 index 470d33d..0000000 --- a/nslcd/resolve.c +++ /dev/null @@ -1,352 +0,0 @@ -/* - * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hvgskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the Kungliga Tekniska - * Hvgskolan and its contributors. - * - * 4. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include "config.h" - -#include <stdio.h> -#include <stdlib.h> -#include <sys/types.h> -#include <netinet/in.h> -#include <arpa/nameser.h> -#include <string.h> -#ifdef HAVE_STRINGS_H -#include <strings.h> -#endif -#include <resolv.h> - -#include "resolve.h" - -#if defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) - -#define DECL(X) {#X, T_##X} - -static struct stot -{ - char *name; - int type; -} -stot[] = -{ - DECL (A), - DECL (NS), - DECL (CNAME), DECL (PTR), DECL (MX), DECL (TXT), DECL (AFSDB), DECL (SRV), - { - NULL, 0} -}; - -static int -string_to_type (const char *name) -{ - struct stot *p = stot; - for (p = stot; p->name; p++) - if (strcasecmp (name, p->name) == 0) - return p->type; - return -1; -} - -void -dns_free_data (struct dns_reply *r) -{ - struct resource_record *rr; - if (r->q.domain) - free (r->q.domain); - for (rr = r->head; rr;) - { - struct resource_record *tmp = rr; - if (rr->domain) - free (rr->domain); - if (rr->u.data) - free (rr->u.data); - rr = rr->next; - free (tmp); - } - free (r); -} - -static struct dns_reply * -parse_reply (unsigned char *data, int len) -{ - unsigned char *p; - char host[128]; - int status; - int query, response; - - struct dns_reply *r; - struct resource_record **rr; - - r = (struct dns_reply *) malloc (sizeof (struct dns_reply)); - memset (r, 0, sizeof (struct dns_reply)); - r->q.domain = NULL; - - p = data; - memcpy (&r->h, p, sizeof (HEADER)); - p += sizeof (HEADER); - for (query = 0; query < ntohs(r->h.qdcount); query++) - { - status = dn_expand (data, data + len, p, host, sizeof (host)); - if (status < 0) - { - dns_free_data (r); - return NULL; - } - p += status; - if (p + 4 > data + len) - { - dns_free_data (r); - return NULL; - } - if (r->q.domain == NULL) - { - r->q.domain = strdup (host); - r->q.type = (p[0] << 8 | p[1]); - r->q.class = (p[2] << 8 | p[3]); - } - p += 4; - } - rr = &r->head; - for (response = 0; (response < ntohs(r->h.ancount)) && (p < data + len); response++) - { - unsigned int type, class, ttl, size; - status = dn_expand (data, data + len, p, host, sizeof (host)); - if (status < 0) - { - dns_free_data (r); - return NULL; - } - p += status; - if (p + 10 > data + len) - { - dns_free_data (r); - return NULL; - } - type = (p[0] << 8) | p[1]; - p += 2; - class = (p[0] << 8) | p[1]; - p += 2; - ttl = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; - p += 4; - size = (p[0] << 8) | p[1]; - p += 2; - if (p + size > data + len) - { - dns_free_data (r); - return NULL; - } - *rr = (struct resource_record *) calloc (1, - sizeof (struct - resource_record)); - (*rr)->domain = strdup (host); - (*rr)->type = type; - (*rr)->class = class; - (*rr)->ttl = ttl; - (*rr)->size = size; - switch (type) - { - case T_NS: - case T_CNAME: - case T_PTR: - status = dn_expand (data, data + len, p, host, sizeof (host)); - if (status < 0) - { - dns_free_data (r); - return NULL; - } - (*rr)->u.txt = strdup (host); - break; - case T_MX: - case T_AFSDB: - { - if (p + 2 > data + len) - { - dns_free_data (r); - return NULL; - } - status = dn_expand (data, data + len, p + 2, host, sizeof (host)); - if (status < 0) - { - dns_free_data (r); - return NULL; - } - - (*rr)->u.mx = - (struct mx_record *) malloc (sizeof (struct mx_record) + - strlen (host)); - (*rr)->u.mx->preference = (p[0] << 8) | p[1]; - strcpy ((*rr)->u.mx->domain, host); - break; - } - case T_SRV: - { - if (p + 6 > data + len) - { - dns_free_data (r); - return NULL; - } - status = dn_expand (data, data + len, p + 6, host, sizeof (host)); - if (status < 0) - { - dns_free_data (r); - return NULL; - } - (*rr)->u.srv = - (struct srv_record *) malloc (sizeof (struct srv_record) + - strlen (host)); - (*rr)->u.srv->priority = (p[0] << 8) | p[1]; - (*rr)->u.srv->weight = (p[2] << 8) | p[3]; - (*rr)->u.srv->port = (p[4] << 8) | p[5]; - strcpy ((*rr)->u.srv->target, host); - break; - } - case T_TXT: - { - if (p + *p > data + len) - { - dns_free_data (r); - return NULL; - } - (*rr)->u.txt = (char *) malloc (size + 1); - strncpy ((*rr)->u.txt, (char *) p + 1, *p); - (*rr)->u.txt[*p] = 0; - break; - } - - default: - (*rr)->u.data = (unsigned char *) malloc (size); - memcpy ((*rr)->u.data, p, size); - } - p += size; - rr = &(*rr)->next; - } - *rr = NULL; - return r; -} - -struct dns_reply * -dns_lookup (const char *domain, const char *type_name) -{ - unsigned char *reply = NULL; - int len, rlen; - int type; - struct dns_reply *r = NULL; - - type = string_to_type (type_name); - rlen = 1024; - reply = malloc(rlen); - do - { - len = res_search (domain, C_IN, type, reply, rlen); - if ((len == -1) || (len < rlen)) - { - break; - } - reply = realloc (reply, len + 1024); - rlen = len + 1024; - } - while (1); - if (len >= 0) - r = parse_reply (reply, len); - free(reply); - return r; -} - -#else /* defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) */ - -struct dns_reply * -dns_lookup (const char *domain, const char *type_name) -{ - return NULL; -} - -void -dns_free_data (struct dns_reply *r) -{ -} - -#endif /* not ( defined(HAVE_RES_SEARCH) && defined(HAVE_DN_EXPAND) ) */ - -#ifdef TEST - -int -main (int argc, char **argv) -{ - struct dns_reply *r; - struct resource_record *rr; - r = dns_lookup (argv[1], argv[2]); - if (r == NULL) - { - printf ("No reply.\n"); - return 1; - } - for (rr = r->head; rr; rr = rr->next) - { - printf ("%s %s %d ", rr->domain, type_to_string (rr->type), rr->ttl); - switch (rr->type) - { - case T_NS: - printf ("%s\n", (char *) rr->data); - break; - case T_A: - printf ("%d.%d.%d.%d\n", - ((unsigned char *) rr->data)[0], - ((unsigned char *) rr->data)[1], - ((unsigned char *) rr->data)[2], - ((unsigned char *) rr->data)[3]); - break; - case T_MX: - case T_AFSDB: - { - struct mx_record *mx = (struct mx_record *) rr->data; - printf ("%d %s\n", mx->preference, mx->domain); - break; - } - case T_SRV: - { - struct srv_record *srv = (struct srv_record *) rr->data; - printf ("%d %d %d %s\n", srv->priority, srv->weight, - srv->port, srv->target); - break; - } - default: - printf ("\n"); - break; - } - } - - return 0; -} -#endif /* TEST */ diff --git a/nslcd/resolve.h b/nslcd/resolve.h deleted file mode 100644 index 62b2574..0000000 --- a/nslcd/resolve.h +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Hvgskolan - * (Royal Institute of Technology, Stockholm, Sweden). - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the Kungliga Tekniska - * Hvgskolan and its contributors. - * - * 4. Neither the name of the Institute nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* THIS IS NOT (yet) A PUBLIC INTERFACE */ - -#ifndef __RESOLVE_H__ -#define __RESOLVE_H__ - -/* when would this *not* be defined? */ -#define HAVE_ARPA_NAMESER_H - -/* We use these, but they are not always present in <arpa/nameser.h> */ - -#ifndef T_TXT -#define T_TXT 16 -#endif -#ifndef T_AFSDB -#define T_AFSDB 18 -#endif -#ifndef T_SRV -#define T_SRV 33 -#endif - -struct dns_query -{ - char *domain; - unsigned type; - unsigned class; -}; - -struct mx_record -{ - unsigned preference; - char domain[1]; -}; - -struct srv_record -{ - unsigned priority; - unsigned weight; - unsigned port; - char target[1]; -}; - -struct resource_record -{ - char *domain; - unsigned type; - unsigned class; - unsigned ttl; - unsigned size; - union - { - void *data; - struct mx_record *mx; - struct mx_record *afsdb; /* mx and afsdb are identical */ - struct srv_record *srv; - struct in_addr *a; - char *txt; - } - u; - struct resource_record *next; -}; - -#ifndef HAVE_ARPA_NAMESER_H /* XXX */ -typedef int HEADER; /* will never be used */ -#endif - -struct dns_reply -{ - HEADER h; - struct dns_query q; - struct resource_record *head; -}; - -#define dns_lookup _nss_ldap_dns_lookup -#define dns_free_data _nss_ldap_dns_free_data - -struct dns_reply *dns_lookup (const char *, const char *); - -void dns_free_data (struct dns_reply *r); - -#endif /* __RESOLVE_H__ */ diff --git a/nss-ldapd.conf.5 b/nss-ldapd.conf.5 index dd536b9..3fe18bb 100644 --- a/nss-ldapd.conf.5 +++ b/nss-ldapd.conf.5 @@ -466,10 +466,6 @@ implementation of .BR initgroups(3) to return NSS_STATUS_NOTFOUND if called with a listed users as its argument. -.TP -.B nss_srv_domain <domain> -This option determines the DNS domain used for performing SRV -lookups. .SH AUTHOR The .B nss_ldap |