/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include <netdb.h>
#include <sys/systeminfo.h>
#include <nss.h>
#include "ns_internal.h"
#include "ldap_common.h"
/* host attributes filters */
/* probably some change in the ipHostNumber field */
#define _F_GETHOSTS6DOTTEDBYNAME \
"(&(objectClass=ipHost)(|(cn=%s)(cn=%s)))"
#define _F_GETHOSTS6DOTTEDBYNAME_SSD \
"(&(%%s)(|(cn=%s)(cn=%s)))"
static const char *ipnodes_attrs[] = {
(char *)NULL
};
extern int
/*
* _nss_ldap_hosts2str is the data marshaling method for the ipnodes getXbyY
* system call gethostbyname() and gethostbyaddr.
* This method is called after a successful search has been performed.
* This method will parse the search results into the file format.
* e.g.
*
* fe80::a00:20ff:fec4:f2b6 ipnodes_1
*
*/
static int
}
/*
* getbyname gets a struct hostent by hostname. This function constructs
* an ldap search filter using the name invocation parameter and the
* gethostbyname search filter defined. Once the filter is constructed,
* we search for a matching entry and marshal the data results into
* struct hostent for the frontend process. Host name searches will be
* on fully qualified host names (foo.bar.sun.com)
*/
static nss_status_t
{
int rc;
sizeof (hostname)) != 0)
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
/* get the domain we are in */
if (rc <= 0)
return ((nss_status_t)NSS_NOTFOUND);
/* Is this a request for a host.domain */
if (DOTTEDSUBDOMAIN(hostname)) {
/* separate host and domain. this function */
/* will munge hname, so use argp->keyname */
/* from here on for original string */
return ((nss_status_t)NSS_NOTFOUND);
}
/* if domain is a proper subset of realdomain */
/* ie. domain = "foo" and realdomain */
/* = "foor.bar.sun.com", we try to lookup both" */
/* host.domain and host */
/* yes, it is a proper domain */
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
} else {
/* it is not a proper domain, so only try to look up */
/* host.domain */
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
}
} else {
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
}
return ((nss_status_t)NSS_SUCCESS);
return ((nss_status_t)lstat);
}
/*
* getbyaddr gets a struct hostent by host address. This function
* constructs an ldap search filter using the host address invocation
* parameter and the gethostbyaddr search filter defined. Once the
* filter is constructed, we search for a matching entry and marshal
* the data results into struct hostent for the frontend process.
*/
static nss_status_t
{
int ret;
return (NSS_NOTFOUND);
if (IN6_IS_ADDR_V4MAPPED(&addr)) {
return (NSS_NOTFOUND);
}
} else {
INET6_ADDRSTRLEN) == NULL)
return (NSS_NOTFOUND);
}
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_NOTFOUND);
return ((nss_status_t)NSS_SUCCESS);
return ((nss_status_t)lstat);
}
0,
0,
0,
};
/*
* _nss_ldap_hosts_constr is where life begins. This function calls the generic
* ldap constructor function to define and build the abstract data types
* required to support ldap operations.
*/
/*ARGSUSED0*/
const char *dummy3)
{
}