nscd_switch.c revision 2802e980ad535ca6f11fc79cad288dc02b15c231
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER START
843e19887f64dde75055cf8842fc4db2171eff45johnlev * The contents of this file are subject to the terms of the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Common Development and Distribution License (the "License").
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You may not use this file except in compliance with the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
843e19887f64dde75055cf8842fc4db2171eff45johnlev * See the License for the specific language governing permissions
843e19887f64dde75055cf8842fc4db2171eff45johnlev * and limitations under the License.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * When distributing Covered Code, include this CDDL HEADER in each
843e19887f64dde75055cf8842fc4db2171eff45johnlev * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * If applicable, add the following below this CDDL HEADER, with the
843e19887f64dde75055cf8842fc4db2171eff45johnlev * fields enclosed by brackets "[]" replaced with your own identifying
843e19887f64dde75055cf8842fc4db2171eff45johnlev * information: Portions Copyright [yyyy] [name of copyright owner]
843e19887f64dde75055cf8842fc4db2171eff45johnlev * CDDL HEADER END
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
843e19887f64dde75055cf8842fc4db2171eff45johnlev * Use is subject to license terms.
843e19887f64dde75055cf8842fc4db2171eff45johnlev#pragma ident "%Z%%M% %I% %E% SMI"
#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;
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
void *sym;
return (NSCD_SUCCESS);
if (dnsi < 0) {
return (NSCD_SUCCESS);
return (NSCD_SUCCESS);
return (NSCD_CFG_DLOPEN_ERROR);
return (NSCD_CFG_DLSYM_ERROR);
return (NSCD_SUCCESS);
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;
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)
_nscd_get_client_euid() != 0) {
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) {