getuser.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
*/
/*
* Copyright 2003 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Routines to handle getuser* calls in nscd
*/
#include <assert.h>
#include <errno.h>
#include <memory.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <thread.h>
#include <unistd.h>
#include <ucred.h>
#include <nss_common.h>
#include <user_attr.h>
#include <getxby_door.h>
#include "server_door.h"
#include "nscd.h"
int callnumber);
static void getuser_invalidate_unlocked(void);
void
getuser_init(void)
{
}
static void
{
/* leave pending calls alone */
}
}
static void
{
/*
* be careful with ptr - it may be -1 or NULL.
*/
if (tmp != (char *)-1)
}
}
void
getuser_revalidate(void)
{
for (;;) {
int slp;
int interval;
int count;
if (slp < 60) {
slp = 60;
}
} else {
}
}
}
static void
{
int *table;
union {
} u;
int i;
if (!keep)
return;
for (i = 1; i <= keep; i++) {
char *tmp;
continue; /* unused slot in table */
}
for (i = 1; i <= keep; i++) {
char *tmp;
}
}
/*
* This routine marks all entries as invalid
*
*/
void
{
}
static void
{
}
void
{
int out_of_date;
char **bucket;
return;
}
/*EMPTY*/;
} else if (lastmod == 0) {
}
}
logit("getuser_lookup: looking for name %s\n",
}
for (;;) {
if (door_ucred(&uc) != 0) {
logit("getuser_lookup: Name too long, "
"but no user credential: %s\n",
} else {
logit("getuser_lookup: Name too long "
"from pid %d uid %d\n",
ucred_getruid(uc));
ucred_free(uc);
}
goto getout;
}
/* no threads available */
/* cannot process now */
sizeof (*out);
goto getout;
}
continue; /* go back and relookup hash bucket */
}
break;
}
/*
* check for no name_service mode
*/
/* time has expired */
int saved_errno;
int saved_hits = 0;
userstr_t *p;
/* no threads available */
/* cannot process now */
goto getout;
}
}
/*
* block any threads accessing this bucket if data is
* non-existent out of date
*/
} else {
/*
* if still not -1 bucket we are doing update...
* mark to prevent
* pileups of threads if the name service is hanging....
*/
/* cleared by deletion of old data */
}
/*
* Call non-caching version in libnsl.
*/
bufferspace, &errno);
saved_errno = errno;
if (p == NULL) { /* data not found */
logit("getuser_lookup: nscd COULDN'T FIND user_attr name %s\n",
}
sizeof (nsc_return_t);
goto getout;
} else {
logit("getuser_lookup: nscd FOUND user_attr name %s\n",
}
if (saved_hits)
}
} else { /* found entry in cache */
logit("getuser_lookup: found name %s in cache\n",
}
} else {
logit("getuser_lookup: %s marked as NOT FOUND in cache.\n",
}
}
/* cleared by deletion of old data */
}
}
}
/*ARGSUSED*/
static void
{
}
/*
* we can do this before reseting *old since we're holding the lock
*/
}
/* real data, not just update pending or invalidate */
new->nsc_status = 0;
} else {
}
}
}
/*ARGSUSED*/
static nsc_bucket_t *
{
char *dest;
int offset;
int strs;
/*
* find out the size of the data block we're going to need
*/
/*
* allocate it and copy it in
* code doesn't assume packing order in original buffer
*/
return (NULL);
}
sizeof (userstr_t);
return (retb);
}
void
getuser_reaper(void)
{
}