/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Miscellaneous user interfaces to trusted label functions.
*
*/
#include <ctype.h>
#include <stdlib.h>
#include <strings.h>
#include "labeld.h"
#include "clnt.h"
#include <secdb.h>
#include <user_attr.h>
/*
* blinset - Check in a label set.
*
* Entry label = Sensitivity Label to check.
* id = Label set identifier of set to check.
*
* Exit None.
*
* Returns -1, If label set unavailable, or server failure.
* 0, If label not in label set.
* 1, If label is in the label set.
*
* Calls __call_labeld(BLINSET), BLTYPE, BSLLOW, BSLHIGH.
*
* Uses slow, shigh.
*/
int
{
/* initialize static labels. */
}
return (1);
}
/* process error */
return (-1);
}
} else {
/*
* Only System and User Accreditation Ranges presently
* implemented.
*/
return (-1);
}
}
/*
* bslvalid - Check Sensitivity Label for validity.
*
* Entry label = Sensitivity Label to check.
*
* Exit None.
*
* Returns -1, If unable to access label encodings file, or server failure.
* 0, If label not valid.
* 1, If label is valid.
*
* Calls __call_labeld(BSLVALID), BLTYPE, BSLLOW, BSLHIGH.
*
* Uses slow, shigh.
*
*/
int
{
/* initialize static labels. */
}
return (1);
}
/* process error */
return (-1);
}
}
/*
* bclearvalid - Check Clearance for validity.
*
* Entry clearance = Clearance to check.
*
* Exit None.
*
* Returns -1, If unable to access label encodings file, or server failure.
* 0, If label not valid.
* 1, If label is valid.
*
* Calls __call_labeld(BCLEARVALID), BLTYPE, BCLEARLOW, BCLEARHIGH.
*
* Uses clow, chigh.
*
*/
int
{
/* initialize static labels. */
BCLEARHIGH(&chigh);
}
return (1);
}
/* process error */
return (-1);
}
}
/*
* labelinfo - Get information about the label encodings file.
*
* Entry info = Address of label_info structure to update.
*
* Exit info = Updated.
*
* Returns -1, If unable to access label encodings file, or server failure.
* 1, If successful.
*
* Calls __call_labeld(LABELINFO).
*/
int
{
int rval;
/* process error */
return (-1);
}
return (rval);
}
/*
* labelvers - Get version string of the label encodings file.
*
* Entry version = Address of string pointer to return.
* len = Length of string if pre-allocated.
*
* Exit version = Updated.
*
* Returns -1, If unable to access label encodings file, or server failure.
* 0, If unable to allocate version string,
* or pre-allocated version string to short
* (and **version = '\0').
* length (including null) of version string, If successful.
*
* Calls __call_labeld(LABELVERS)
* malloc, strlen.
*/
{
/* release return buffer */
return (-1);
}
/* unpack length */
/* release return buffer */
return (0);
}
**version = '\0';
/* release return buffer */
return (0);
}
/* release return buffer */
return (ver_len);
} /* labelvers */
/*
* bltocolor - get ASCII color name of label.
*
* Entry label = Sensitivity Level of color to get.
* size = Size of the color_name array.
* color_name = Storage for ASCII color name string to be returned.
*
* Exit None.
*
* Returns NULL, If error (label encodings file not accessible,
* invalid label, no color for this label).
* Address of color_name parameter containing ASCII color name
* defined for the label.
*
* Calls __call_labeld(BLTOCOLOR), strlen.
*/
char *
{
char *colorp;
/* release return buffer */
return (NULL);
}
/* release return buffer */
return (colorp);
} /* bltocolor_r */
/*
* bltocolor - get ASCII color name of label.
*
* Entry label = Sensitivity Level of color to get.
*
* Exit None.
*
* Returns NULL, If error (label encodings file not accessible,
* invalid label, no color for this label).
* Address of statically allocated string containing ASCII
* color name defined for the classification contained
* in label.
*
* Uses color.
*
* Calls bltocolor_r.
*/
char *
{
} /* bltocolor */
blevel_t *
blabel_alloc(void)
{
return (m_label_alloc(MAC_LABEL));
}
void
{
}
blabel_size(void)
{
return (sizeof (blevel_t));
}
/*
* getuserrange - get label range for user
*
* Entry username of user
*
* Exit None.
*
* Returns NULL, If memory allocation failure or userdefs failure.
* otherwise returns the allocates m_range_t with the
* user's min and max labels set.
*/
{
/*
* Get some memory
*/
return (NULL);
}
return (NULL);
}
return (NULL);
}
/* If the user has an explicit min_label or clearance, use it. */
!= NULL) {
}
!= NULL) {
}
}
return (NULL);
}
}
return (range);
}