/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
* 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 or empty, return an empty
* profile.
*/
/* 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;
}
{ \
size_t cll_counter = 0; \
cll_counter++; \
} \
(COUNT) = cll_counter; \
}
{
/* The fields we care about are read-only after creation, so
no locking is needed. */
return ENOMEM;
return err;
}
{
unsigned int n_entries;
int 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 */
ent_len = (unsigned int) (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.
*/
{
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;
}
{
unsigned char *bp;
int i;
fcount = 0;
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);
}
/*
* Solaris Kerberos
* profile_get_options_boolean() and profile_get_options_string() are Solaris
* specific.
*/
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);
}