/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
/*
*
* Copyright 2006, 2007 by the Massachusetts Institute of Technology.
* All Rights Reserved.
*
* Export of this software from the United States of America may
* require a specific license from the United States Government.
* It is the responsibility of any person or organization contemplating
* export to obtain such a license before exporting.
*
* WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
* distribute this software and its documentation for any purpose and
* without fee is hereby granted, provided that the above copyright
* notice appear in all copies and that both that copyright notice and
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
* permission. Furthermore if you modify this software you must label
* your software as modified software and not distribute it in such a
* fashion that it might be confused with the original M.I.T. software.
* M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
* cursor for sequential traversal of ccaches
*/
#include "cc-int.h"
#include <assert.h>
/* Prefix and residual parts of a full ccache name. */
struct cc_fullname {
char *pfx;
char *res;
};
struct _krb5_cccol_cursor {
int pos;
int cur_fullname;
};
/* typedef of krb5_cccol_cursor is in krb5.h */
static int cccol_cmpname(const char *, const char *, struct cc_fullname *);
static krb5_error_code
static krb5_error_code
{
krb5_cccol_cursor n = NULL;
int i;
n = malloc(sizeof(*n));
if (n == NULL)
return ENOMEM;
n->pos = CCCURSOR_CONTEXT;
n->typecursor = NULL;
for (i = 0; i < NFULLNAMES; i++) {
}
n->cur_fullname = 0;
if (ret)
goto errout;
do {
/* Find first backend with ptcursor functionality. */
goto errout;
if (ret)
goto errout;
if (ret) {
}
*cursor = n;
return ret;
}
{
char *name;
/* Solaris Kerberos */
case CCCURSOR_CONTEXT:
if (ret)
goto errout;
break;
}
/* fall through */
case CCCURSOR_ENV:
if (ret)
goto errout;
break;
}
/* fall through */
case CCCURSOR_OS:
if (ret)
goto errout;
break;
}
/* fall through */
case CCCURSOR_PERTYPE:
do {
if (ret)
goto errout;
break;
}
return ret;
}
{
krb5_cccol_cursor c = *cursor;
int i;
if (c == NULL)
return 0;
for (i = 0; i < NFULLNAMES; i++) {
}
if (c->typecursor != NULL)
free(c);
return 0;
}
{
krb5_cccol_cursor c = NULL;
*change_time = 0;
while (!ret) {
if (ccache) {
}
ret = 0;
}
else {
break;
}
}
return ret;
}
/*
* krb5_cccol_lock and krb5_cccol_unlock are defined in ccbase.c
*/
/*
* Determine if a ccache from a per-type cursor was already one of the
* higher-priority defaults.
*/
static int
{
int i;
return 0;
return 0;
for (i = 0; i < c->cur_fullname; i++) {
return 1;
}
}
return 0;
}
/*
* Compare {prefix, name} against a cc_fullname.
*/
static int
const char *name,
struct cc_fullname *fullname)
{
return 0;
return 0;
return 0;
return 1;
}
/*
* Resolve one of the high-precedence ccaches, and cache its full name
* {prefix, residual} for exclusion when doing per-type ccache
* iteration. Also check to see if we've already seen the ccache
* name we're given.
*/
static krb5_error_code
const char *name,
{
if (ret)
return ret;
return 0;
cursor->cur_fullname++;
return ret;
}
/*
* Find next ccache in current backend, iterating through backends if
* ccache list of the current backend is exhausted.
*/
static krb5_error_code
{
/* Are we out of backends? */
return 0;
/*
* Loop in case there are multiple backends with empty ccache
* lists.
*/
if (ret)
goto errout;
return 0;
if (ret)
goto errout;
do {
/* Find first backend with ptcursor functionality. */
if (ret)
goto errout;
return 0;
if (ret)
goto errout;
}
return ret;
}