nscd_switch.c revision 36e852a172cba914383d7341c988128b2c667fbd
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License (the "License").
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You may not use this file except in compliance with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information: Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
#include <assert.h>
#include <unistd.h>
#include <string.h>
#include <pthread.h>
#include <dlfcn.h>
#include <nss_dbdefs.h>
#include <exec_attr.h>
#include "nscd_door.h"
#include "nscd_switch.h"
#include "nscd_log.h"
#include "nscd_frontend.h"
extern int _whoami;
typedef struct lb_key {
int srci;
int dbi;
int fnum;
int *lb_flagp;
} lb_key_t;
int rc;
return (rc);
static lb_key_t *
get_loopback_key(void) {
int rc;
if (rc == 0)
return (rc);
get_initf_key(void) {
void *pbuf;
return (pbuf);
clear_initf_key(void) {
static nscd_rc_t
int search_fnum,
nss_db_params_t *p;
char *dbn;
p = ¶ms->p;
(void) memset(p, 0, sizeof (*p));
(*initf)(p);
n = p->name;
for (j = 0; j < NSCD_NUM_DB; j++) {
if (*n != *dbn)
n = p->config_name;
for (j = 0; j < NSCD_NUM_DB; j++) {
if (*n == *dbn) {
n = p->name;
if (*n == *dbn) {
return (NSCD_CFG_UNSUPPORTED_SWITCH_DB);
return (rc);
p->flags);
int dbi,
int srci,
int op,
char *res_str;
int data_len = 0;
switch (res) {
case NSS_SUCCESS:
case NSS_NOTFOUND:
case NSS_UNAVAIL:
case NSS_TRYAGAIN:
case NSS_NISSERVDNS_TRYAGAIN:
int dbi,
void *arg)
int rc = 0;
if (rc != 0) {
return (rc);
int dbi,
int srci)
int rc = 0;
if (rc != 0) {
return (rc);
static nscd_rc_t
void *sym;
return (NSCD_SUCCESS);
return (NSCD_SUCCESS);
return (NSCD_SUCCESS);
return (NSCD_CFG_DLOPEN_ERROR);
return (NSCD_CFG_DLSYM_ERROR);
return (NSCD_SUCCESS);
static nscd_rc_t
static nscd_rc_t
static nscd_rc_t
func_p));
static nscd_rc_t
int si;
void **funcpp;
si = 0;
static nss_status_t
return (NSS_ERROR);
return (res);
void *search_args)
int n_src;
unsigned int status_vec = 0;
int check_loopback = 0;
int state_thr = 0;
goto error_exit;
search_args));
goto error_exit;
goto error_exit;
goto error_exit;
if (check_loopback) {
k = get_loopback_key();
if (k != NULL) {
k = NULL;
if (check_loopback) {
goto error_exit;
int smf_state;
int n_loop = 0;
if (n_src == 0)
(void **)&is_shadow_update_enabled) ==
NSCD_SUCCESS &&
goto free_nsw_state;
(check_ldap_priv &&
goto next_src;
goto free_nsw_state;
goto next_src;
goto free_nsw_state;
k = &key;
n_loop++;
goto error_exit;
return (NSS_SUCCESS);
return (res);
nss_getent_t *);
nss_getent_t *,
nss_getent_t *);
if (contextpp == 0)
void *args)
if (contextpp == 0) {
return (NSS_UNAVAIL);
return (status);
if (contextpp == 0)
nscd_nsw_state_t *s;
int n_src;
nscd_nsw_state_t *s;
int n_src, i;
NSCD_SUCCESS) {
NSCD_SUCCESS) {
if (be == 0) {
for (i = 0; i < s->max_src; i++) {
nscd_nsw_state_t *s;
int n_src;
return (NSS_UNAVAIL);
return (NSS_SUCCESS);
for (n = 0; n < n_src; n++)
if (be == 0) {
return (res);
n_src++;
if (be == 0) {
return (NSS_NOTFOUND);
return (NSS_SUCCESS);
* Start of nss_psearch/nss_psetent()/nss_pgetent()/nss_pendent()
int dbop;
int rc;
if (rc != 0) {
*seqnum_p = 0;
int rc;
if (rc != 0) {