idmap_cache.c revision 0b10de9fc92843e871f48de87f623808c5913a71
/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Windows to Solaris Identity Mapping kernel API
* This module provides the kernel cache.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
#include "idmap_prot.h"
#include "kidmap_priv.h"
/*
* External functions
*/
/*
* Internal definitions and functions
*/
#define CACHE_TRIGGER_SIZE 4096
typedef struct sid_prefix_node {
const char *sid_prefix;
typedef struct entry {
const char *sid_prefix;
int is_user;
} entry_t;
typedef int (*avl_comp_fn)(const void*, const void*);
struct sid_prefix_store {
};
static void
/*
*/
static char *
kidmap_strdup(const char *s)
{
return (ret);
}
static int
{
if (comp == 0)
if (comp < 0)
comp = -1;
else if (comp > 0)
comp = 1;
return ((int)comp);
}
static int
{
return (1);
return (-1);
return (0);
}
static int
const sid_prefix_node_t *entry2)
{
int comp;
if (comp < 0)
comp = -1;
else if (comp > 0)
comp = 1;
return (comp);
}
void
{
}
void
{
void *cookie;
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
}
void
{
void *cookie;
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
!= NULL) {
}
}
int
{
int status;
} else
return (status);
}
int
{
int status;
} else
return (status);
}
int
{
int status;
} else
return (status);
}
int
{
int status;
} else
return (status);
}
int
{
int status;
} else
return (status);
}
void
{
int purge_required = FALSE;
if (result) {
} else {
gethrestime_sec()))
}
if (purge_required)
}
void
{
int purge_required = FALSE;
if (result) {
} else {
gethrestime_sec()))
}
if (purge_required)
}
void
{
int purge_required = FALSE;
if (result) {
} else {
gethrestime_sec()))
}
if (purge_required)
}
void
{
int purge_required = FALSE;
if (result) {
} else {
gethrestime_sec()))
}
if (purge_required)
}
void
{
int purge_required = FALSE;
if (result) {
} else {
gethrestime_sec()))
}
if (purge_required)
}
static void
{
/* Old entry to remove */
/* We removed the first entery */
continue;
}
}
}
}
void
{
kidmap_sid_prefix_store = (struct sid_prefix_store *)
space_fetch("SUNW,idmap_sid_prefix");
if (kidmap_sid_prefix_store == NULL) {
sizeof (struct sid_prefix_store), KM_SLEEP);
sizeof (sid_prefix_node_t),
(void) space_store("SUNW,idmap_sid_prefix",
} else {
/*
* The AVL comparison function must be re-initialised on
* re-load because may not be loaded into the same
* address space.
*/
}
}
const char *
kidmap_find_sid_prefix(const char *sid_prefix) {
return (NULL);
if (result) {
return (result->sid_prefix);
}
/*
* Could not upgrade lock so release lock
* and acquire the write lock
*/
if (result) {
return (result->sid_prefix);
}
}
return (new->sid_prefix);
}