sid.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* 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.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Sid manipulation (stubs).
*/
#include <sys/sysmacros.h>
static avl_tree_t sid_tree;
static ksiddomain_t
*ksid_enterdomain(const char *dom)
{
return (res);
}
void
{
}
void
{
}
void
{
}
void
{
/*
* The kd reference can only be incremented from 0 when
* the sid_lock is held; so we lock and then check need to
* check for 0 again.
*/
}
}
}
void
{
}
void
{
int i;
}
}
static int
ksid_cmp(const void *a, const void *b)
{
const ksiddomain_t *ap = a;
const ksiddomain_t *bp = b;
int res;
if (res > 0)
return (1);
if (res != 0)
return (-1);
return (0);
}
/*
* Lookup the named domain in the AVL tree.
* If no entry is found, add the domain to the AVL tree.
* The domain is returned held and needs to be released
* when done.
*/
*ksid_lookupdomain(const char *dom)
{
if (!sid_inited) {
sid_inited = B_TRUE;
return (res);
}
} else {
}
return (res);
}
const char *
{
}
{
}
int
{
const char *sid_prefix;
return (-1);
return (0);
}
int
{
const char *sid_prefix;
return (-1);
return (0);
}
kcrsid_alloc(void)
{
return (kcr);
}
/*
* Returns a credsid_t with a refcount of 1.
*/
static credsid_t *
{
return (kcrsid_alloc());
return (org);
new = kcrsid_alloc();
/* Copy, then update reference counts */
return (new);
}
void
{
}
void
{
ksid_index_t i;
for (i = 0; i < KSID_COUNT; i++)
}
}
/*
* Copy the SID credential into a previously allocated piece of memory.
*/
void
{
int i;
return;
for (i = 0; i < KSID_COUNT; i++)
}
static int
{
int cnt = 0;
int i;
return (0);
for (i = 0; i < KSID_COUNT; i++)
cnt++;
return (cnt);
}
/*
* Argument needs to be a ksid_t with a properly held ks_domain reference.
*/
{
/*
* Unset the particular ksid; if there are no other SIDs or if this
* is the last SID, remove the auxilary data structure.
*/
if (ocnt == 0 ||
return (NULL);
}
}
else
return (nkcr);
}
/*
* Argument needs to be a ksidlist_t with properly held ks_domain references
* and a reference count taking the new reference into account.
*/
{
/*
* Unset the sidlist; if there are no further SIDs, remove the
* auxilary data structure.
*/
return (NULL);
}
}
return (nkcr);
}
{
int i;
int cnt;
if (ngrp == 0)
return (NULL);
cnt = 0;
for (i = 0; i < ngrp; i++) {
while (--i >= 0)
cnt = 0;
break;
}
cnt++;
} else {
}
}
if (cnt == 0) {
return (NULL);
}
return (list);
}