Update to 0.8.12, part 2

Remove no-longer-needed backport for support of "DNS:DOMAIN" as a way of
specifying which domain to search for LDAP SRV records when attempting
to discover the server location using DNS.
This commit is contained in:
Nalin Dahyabhai 2013-01-17 18:00:44 -05:00
parent 652cc0ff5f
commit 782d1c4236
2 changed files with 0 additions and 58 deletions

View File

@ -1,56 +0,0 @@
diff -up ./man/nslcd.conf.5.xml.dnssrv ./man/nslcd.conf.5.xml
--- ./man/nslcd.conf.5.xml.dnssrv 2012-04-28 21:22:26.327729809 +0200
+++ ./man/nslcd.conf.5.xml 2012-04-28 21:22:26.330729794 +0200
@@ -127,9 +127,14 @@
<acronym>LDAP</acronym> over <acronym>TCP</acronym>,
<acronym>ICP</acronym> or <acronym>SSL</acronym> respectively (if
supported by the <acronym>LDAP</acronym> library).
+ </para>
+ <para>
Alternatively, the value <literal>DNS</literal> may be
used to try to lookup the server using <acronym>DNS</acronym>
<acronym>SRV</acronym> records.
+ By default the current domain is used but another domain can
+ be queried by using the
+ <literal>DNS:</literal><replaceable>DOMAIN</replaceable> syntax.
</para>
<para>
When using the ldapi scheme, %2f should be used to escape slashes
diff -up ./nslcd/cfg.c.dnssrv ./nslcd/cfg.c
--- ./nslcd/cfg.c.dnssrv 2012-04-28 21:22:26.326729814 +0200
+++ ./nslcd/cfg.c 2012-04-28 21:22:26.330729794 +0200
@@ -224,13 +224,13 @@ static char *cfg_getdomainname(const cha
/* add URIs by doing DNS queries for SRV records */
static void add_uris_from_dns(const char *filename,int lnr,
- struct ldap_config *cfg)
+ struct ldap_config *cfg,
+ char *domain)
{
int rc;
- char *domain;
char *hostlist=NULL,*nxt;
char buf[HOST_NAME_MAX+sizeof("ldap://")];
- domain=cfg_getdomainname(filename,lnr);
+ log_log(LOG_DEBUG,"query %s for SRV records",domain);
rc=ldap_domain2hostlist(domain,&hostlist);
if (rc!=LDAP_SUCCESS)
{
@@ -848,7 +848,16 @@ static void cfg_read(const char *filenam
if (strcasecmp(token,"dns")==0)
{
#ifdef HAVE_LDAP_DOMAIN2HOSTLIST
- add_uris_from_dns(filename,lnr,cfg);
+ add_uris_from_dns(filename,lnr,cfg,cfg_getdomainname(filename,lnr));
+#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 if (strncasecmp(token,"dns:",4)==0)
+ {
+#ifdef HAVE_LDAP_DOMAIN2HOSTLIST
+ add_uris_from_dns(filename,lnr,cfg,strdup(token+sizeof("dns")));
#else /* not HAVE_LDAP_DOMAIN2HOSTLIST */
log_log(LOG_ERR,"%s:%d: value %s not supported on platform",filename,lnr,token);
exit(EXIT_FAILURE);

View File

@ -25,7 +25,6 @@ Source2: nslcd.init
Source3: nslcd.tmpfiles Source3: nslcd.tmpfiles
Source4: nslcd.service Source4: nslcd.service
Patch1: nss-pam-ldapd-0.8.12-validname.patch Patch1: nss-pam-ldapd-0.8.12-validname.patch
Patch2: nss-pam-ldapd-0.7.x-dnssrv.patch
Patch3: nss-pam-ldapd-0.7.x-uid-overflow.patch Patch3: nss-pam-ldapd-0.7.x-uid-overflow.patch
Patch4: nss-pam-ldapd-0.7.x-epipe.patch Patch4: nss-pam-ldapd-0.7.x-epipe.patch
Patch5: nss-pam-ldapd-0.7.16-skipall.patch Patch5: nss-pam-ldapd-0.7.16-skipall.patch
@ -67,7 +66,6 @@ nsswitch module.
%prep %prep
%setup -q %setup -q
%patch1 -p0 -b .validname %patch1 -p0 -b .validname
%patch2 -p1 -b .dnssrv
%patch3 -p1 -b .overflow %patch3 -p1 -b .overflow
%patch4 -p1 -b .epipe %patch4 -p1 -b .epipe
%patch5 -p1 -b .skipall %patch5 -p1 -b .skipall