smb_wksids.c revision 6537f381d2d9e7b4e2f7b29c3e7a3f13be036f2e
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* This module provides the interface to builtin domain information.
* These are the predefined groups and aliases in the NT AUTHORITY or
* BUILTIN domains, and some other miscellaneous bits.
*/
#include <stdlib.h>
#include <string.h>
#include <synch.h>
/*
* This table should contain all of the NT builtin domain names.
*/
static char *domain[] = {
"LOCAL",
"BUILTIN",
"NT AUTHORITY",
"UNKNOWN"
};
static int wk_init = 0;
/*
* This table should contain all of the builtin domains, groups and
* aliases. The order is important because we do string compares on
* the SIDs. For each domain, ensure that the domain SID appears
* before any aliases in that domain.
*/
"Members can bypass file security to back up files", NULL },
};
/*
* smb_wka_lookup_sid
*
* Search the wka_tbl looking for a match on the specified SID. If the
* SID matches a builtin entry, the associated name is returned.
* Otherwise a null pointer is returned.
*/
char *
{
int i;
for (i = 0; i < SMB_WKA_NUM; ++i) {
if (sid_name_use)
}
}
return (NULL);
}
/*
* smb_wka_lookup_name
*
* Search the wka_tbl looking for a match on the specified name. If the
* name matches a builtin entry, the associated SID (which is in
* malloc'd memory) is returned. Otherwise a null pointer is returned.
*/
{
int i;
for (i = 0; i < SMB_WKA_NUM; ++i) {
if (sid_name_use)
}
}
return (NULL);
}
/*
* smb_wka_lookup
*
* Search the wka_tbl looking for a match on the specified name. If the
* name matches a builtin entry then pointer to that entry will be
* returned. Otherwise 0 is returned.
*/
smb_wka_lookup(char *name)
{
int i;
for (i = 0; i < SMB_WKA_NUM; ++i) {
return (entry);
}
}
return (NULL);
}
/*
* smb_wka_is_wellknown
*
* Search the wka_tbl looking for a match on the specified name. If the
* name matches a builtin entry returns 1. Otherwise returns 0.
*/
smb_wka_is_wellknown(char *name)
{
int i;
for (i = 0; i < SMB_WKA_NUM; ++i) {
return (B_TRUE);
}
return (B_FALSE);
}
/*
* smb_wka_lookup_domain
*
* Return the builtin domain name for the specified alias or group name.
*/
char *
smb_wka_lookup_domain(char *name)
{
int i;
for (i = 0; i < SMB_WKA_NUM; ++i) {
}
return (NULL);
}
/*
* smb_wka_init
*
* Generate binary SIDs from the string SIDs in the table
* and set the proper field.
*
* Caller MUST not store the binary SID pointer anywhere that
* could lead to freeing it.
*
* This function should only be called once.
*/
int
smb_wka_init(void)
{
int i;
if (wk_init) {
return (1);
}
for (i = 0; i < SMB_WKA_NUM; ++i) {
smb_wka_fini();
return (0);
}
}
wk_init = 1;
return (1);
}
void
smb_wka_fini(void)
{
int i;
if (wk_init == 0) {
return;
}
for (i = 0; i < SMB_WKA_NUM; ++i) {
if (wka_tbl[i].wka_binsid) {
}
}
wk_init = 0;
}