/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* prof_init.c --- routines that manipulate the user-visible profile_t
* object.
*/
#include "prof_int.h"
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <errno.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
# include <inttypes.h>
#endif
{
if (!profile)
return ENOMEM;
/* if the filenames list is not specified return an empty profile */
if ( files ) {
/* if this file is missing, skip to the next */
continue;
}
if (retval) {
return retval;
}
if (last)
else
}
/*
* If last is still null after the loop, then all the files were
* missing, so return the appropriate error.
*/
if (!last) {
return ENOENT;
}
}
*ret_profile = profile;
return 0;
}
{ \
int cll_counter = 0; \
cll_counter++; \
} \
(COUNT) = cll_counter; \
}
{
/* The fields we care about are read-only after creation, so
no locking is needed. */
return errno;
return err;
}
{
int n_entries, i;
unsigned int ent_len;
const char *s, *t;
/* count the distinct filename components */
if (*s == ':')
n_entries++;
}
/* the array is NULL terminated */
if (filenames == 0)
return ENOMEM;
/* measure, copy, and skip each one */
/* Solaris Kerberos */
ent_len = t-s;
if (filenames[i] == 0) {
/* if malloc fails, free the ones that worked */
return ENOMEM;
}
if (*t == 0) {
i++;
break;
}
}
/* cap the array */
filenames[i] = 0;
/* count back down and free the entries */
return retval;
}
{
return PROF_MAGIC_PROFILE;
if (!writable)
return EINVAL;
if (profile->first_file)
return 0;
}
{
return PROF_MAGIC_PROFILE;
if (!modified)
return EINVAL;
if (profile->first_file)
return 0;
}
{
return PROF_MAGIC_PROFILE;
if (profile->first_file)
return 0;
}
{
return PROF_MAGIC_PROFILE;
if (profile->first_file)
outfile);
return 0;
}
{
}
void KRB5_CALLCONV
{
}
void KRB5_CALLCONV
{
return;
}
}
void KRB5_CALLCONV
{
return;
}
}
/*
* Here begins the profile serialization functions.
*/
/*ARGSUSED*/
{
required += sizeof(prof_int32);
}
return 0;
}
{
*bufpp += sizeof(prof_int32);
*remainp -= sizeof(prof_int32);
}
{
unsigned char *bp;
required = 0;
if (profile) {
fcount = 0;
fcount++;
if (slen) {
}
}
retval = 0;
}
}
return(retval);
}
{
if (*remainp >= sizeof(prof_int32)) {
*bufpp += sizeof(prof_int32);
*remainp -= sizeof(prof_int32);
return 0;
}
else
return 1;
}
/*ARGSUSED*/
{
unsigned char *bp;
int i;
if (remain >= 12)
else
tmp = 0;
if (tmp != PROF_MAGIC_PROFILE) {
goto cleanup;
}
if (!flist)
goto cleanup;
for (i=0; i<fcount; i++) {
if (!flist[i])
goto cleanup;
}
}
(tmp != PROF_MAGIC_PROFILE)) {
goto cleanup;
}
profilep)))
goto cleanup;
if (flist) {
for (i=0; i<fcount; i++) {
if (flist[i])
}
}
return(retval);
}
char ** section;
{
char ** actual_section;
int i, max_i;
actual_section[i] = section[i];
(const char **)&value);
(retval != PROF_NO_SECTION)) {
return(retval);
}
/*
* Any string other than true will turn off the
*option
*/
else
}
}
} else {
}
return(retval);
}
char ** section;
{
char ** actual_section;
int i, max_i;
actual_section[i] = section[i];
(const char **)&value);
(retval != PROF_NO_SECTION)) {
return(retval);
}
} else
}
} else {
}
return(retval);
}