/*
*
* Copyright 2006 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.
*
*
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include "k5-plugin.h"
#if USE_DLOPEN
#include <dlfcn.h>
#endif
#if USE_CFBUNDLE
#include <CoreFoundation/CoreFoundation.h>
#endif
#include <stdio.h>
#ifdef HAVE_SYS_STAT_H
#endif
#ifdef HAVE_SYS_PARAM_H
#endif
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdarg.h>
/*ARGSUSED*/
{
#ifdef DEBUG
#endif
}
struct plugin_file_handle {
#if USE_DLOPEN
void *dlhandle;
#endif
#if USE_CFBUNDLE
#endif
#if !defined (USE_DLOPEN) && !defined (USE_CFBUNDLE)
char dummy;
#endif
};
/*ARGSUSED2*/
long KRB5_CALLCONV
{
long err = 0;
int got_plugin = 0;
if (!err) {
}
}
if (!err) {
}
#if USE_DLOPEN
#ifdef RTLD_GROUP
#else
#endif
if (!err) {
const char *e = dlerror();
}
}
if (!err) {
got_plugin = 1;
}
}
#endif
#if USE_CFBUNDLE
if (!err) {
}
if (!err) {
kCFURLPOSIXPathStyle, true);
}
if (!err) {
}
if (!err) {
if (!CFBundleIsExecutableLoaded (pluginBundle)) {
}
}
if (!err) {
got_plugin = 1;
}
}
#endif
if (!err && !got_plugin) {
}
if (!err) {
*h = htmp;
}
return err;
}
/*ARGSUSED*/
static long
{
long err = 0;
#if USE_DLOPEN
/* XXX Do we need to add a leading "_" to the symbol name on any
modern platforms? */
const char *e = dlerror (); /* XXX copy and save away */
}
}
#endif
#if USE_CFBUNDLE
if (!err) {
}
if (!err) {
if (isfunc) {
} else {
}
}
}
#endif
}
if (!err) {
}
return err;
}
long KRB5_CALLCONV
{
}
long KRB5_CALLCONV
{
if (!err) {
/* Cast function pointers to avoid code duplication */
}
return err;
}
void KRB5_CALLCONV
{
#if USE_DLOPEN
#endif
#if USE_CFBUNDLE
/* Do not call CFBundleUnloadExecutable because it's not ref counted.
* CFRelease will unload the bundle if the internal refcount goes to zero. */
#endif
free (h);
}
/* autoconf docs suggest using this preference order */
#if HAVE_DIRENT_H || USE_DIRENT_H
#include <dirent.h>
#else
#if HAVE_SYS_NDIR_H
# include <ndir.h>
#endif
#endif
#ifdef HAVE_STRERROR_R
#else
#endif
static long
{
long err = 0;
return err;
}
static long
struct plugin_file_handle *p)
{
long err = 0;
} else {
}
return err;
}
static void
{
int i;
krb5int_close_plugin (harray[i]);
}
}
}
#if TARGET_OS_MAC
#else
#endif
static void
{
int i;
}
}
}
static long
{
long err = 0;
int i;
if (!err) {
}
if (!err) {
int j;
} else {
/*LINTED*/
}
}
}
}
if (!err) {
}
return err;
}
/* Takes a NULL-terminated list of directories. If filebases is NULL, filebases is ignored
* all plugins in the directories are loaded. If filebases is a NULL-terminated array of names,
* only plugins in the directories with those name (plus any platform extension) are loaded. */
long KRB5_CALLCONV
const char * const *filebases,
struct plugin_dir_handle *dirhandle,
{
long err = 0;
struct plugin_file_handle **h = NULL;
int count = 0;
int i;
if (!err) {
}
}
/* load plugins with names from filenames from each directory */
int j;
if (!err) {
} else {
/*LINTED*/
}
}
}
}
} else {
/* load all plugins in each directory */
#ifndef _WIN32
int len;
if (d == NULL) { break; }
continue;
}
/* Solaris Kerberos: Only open files with a .so extension */
continue;
if (!err) {
} else {
/*LINTED*/
}
}
if (!err) {
}
}
}
#else
/* Until a Windows implementation of this code is implemented */
#endif /* _WIN32 */
}
}
err = 0; /* ran out of plugins -- do nothing */
}
if (!err) {
h = NULL; /* dirhandle->files takes ownership */
}
if (h != NULL) { krb5int_plugin_file_handle_array_free (h); }
return err;
}
void KRB5_CALLCONV
{
int i;
}
}
}
void KRB5_CALLCONV
{
/* Nothing special to be done per pointer. */
}
long KRB5_CALLCONV
const char *symname,
void ***ptrs,
{
long err = 0;
void **p = NULL;
int count = 0;
/* XXX Do we need to add a leading "_" to the symbol name on any
modern platforms? */
if (!err) {
}
int i = 0;
count++;
} else {
p = newp;
}
}
}
}
if (!err) {
*ptrs = p;
p = NULL; /* ptrs takes ownership */
}
return err;
}
void KRB5_CALLCONV
{
/* Nothing special to be done per pointer. */
}
long KRB5_CALLCONV
const char *symname,
void (***ptrs)(void),
{
long err = 0;
void (**p)() = NULL;
int count = 0;
/* XXX Do we need to add a leading "_" to the symbol name on any
modern platforms? */
if (!err) {
}
int i = 0;
count++;
} else {
p = newp;
}
}
}
}
if (!err) {
*ptrs = p;
p = NULL; /* ptrs takes ownership */
}
return err;
}