/*
* 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
*/
/*
*/
#ifndef _LDAP_COMMON_H
#define _LDAP_COMMON_H
#ifdef __cplusplus
extern "C" {
#endif
#include <ctype.h>
#include <nss_dbdefs.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <signal.h>
#include <lber.h>
#include <ldap.h>
#include <pwd.h>
#include "ns_sldap.h"
/* Use '>=' to ensure there is at least one byte left for '\0' */ \
goto label; \
} \
/* Adjust pointer and available buffer length */ \
/*
* We need to use UID_NOBODY and GID_NOBODY as strings. Therefore we use
* snprintf to convert [U|G]ID_NOBODY into a string. The target buffer
* size was chosen as 21 to allow the largest 64-bit number to be stored
* as string in it. Right now uid_t and gid_t are 32-bit so we don't
* really need 21 characters but it does allow for future expansion
* without having to modify this code.
*/
/*
* Superset the nss_backend_t abstract data type. This ADT has
* been extended to include ldap associated data structures.
*/
typedef enum {
NSS_LDAP_DB_NONE = 0,
struct ldap_backend {
char *tablename;
void *enumcookie;
char *filter;
char *sortattr;
int setcalled;
const char **attrs;
void *netgroup_cookie;
void *services_cookie;
char *toglue;
char *buffer;
int buflen;
};
char *searchfilter, char *domain,
int (*init_filter_cb)(
const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata);
char *searchfilter, char *domain,
int (*init_filter_cb)(
const ns_ldap_search_desc_t *desc,
char **realfilter, const void *userdata),
const void *userdata);
extern const char *_strip_quotes(char *ipaddress);
extern char *_get_domain_name(char *cdn);
char **realfilter, const void *userdata);
int filter_name_size);
extern void _nss_services_cookie_free(void **cookieP);
#ifdef DEBUG
#endif /* DEBUG */
#ifdef __cplusplus
}
#endif
#endif /* _LDAP_COMMON_H */