code:
/*
 * Copyright (c) 1997-2000 Kungliga Tekniska H�gskolan
 * (Royal Institute of Technology, Stockholm, Sweden).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
/* $Id: admin.h 20237 2007-02-16 23:54:34Z lha $ */

#ifndef __KADM5_ADMIN_H__
#define __KADM5_ADMIN_H__

#define KADM5_API_VERSION_1 1
#define KADM5_API_VERSION_2 2

#ifndef USE_KADM5_API_VERSION
#define USE_KADM5_API_VERSION KADM5_API_VERSION_2
#endif

#if USE_KADM5_API_VERSION != KADM5_API_VERSION_2
#error No support for API versions other than 2
#endif

#define KADM5_STRUCT_VERSION 0

#include <krb5.h>

#define KRB5_KDB_DISALLOW_POSTDATED	0x00000001
#define KRB5_KDB_DISALLOW_FORWARDABLE	0x00000002
#define KRB5_KDB_DISALLOW_TGT_BASED	0x00000004
#define KRB5_KDB_DISALLOW_RENEWABLE	0x00000008
#define KRB5_KDB_DISALLOW_PROXIABLE	0x00000010
#define KRB5_KDB_DISALLOW_DUP_SKEY	0x00000020
#define KRB5_KDB_DISALLOW_ALL_TIX	0x00000040
#define KRB5_KDB_REQUIRES_PRE_AUTH	0x00000080
#define KRB5_KDB_REQUIRES_HW_AUTH	0x00000100
#define KRB5_KDB_REQUIRES_PWCHANGE	0x00000200
#define KRB5_KDB_DISALLOW_SVR		0x00001000
#define KRB5_KDB_PWCHANGE_SERVICE	0x00002000
#define KRB5_KDB_SUPPORT_DESMD5		0x00004000
#define KRB5_KDB_NEW_PRINC		0x00008000
#define KRB5_KDB_OK_AS_DELEGATE		0x00010000
#define KRB5_KDB_TRUSTED_FOR_DELEGATION	0x00020000
#define KRB5_KDB_ALLOW_KERBEROS4	0x00040000
#define KRB5_KDB_ALLOW_DIGEST		0x00080000

#define KADM5_PRINCIPAL		0x000001
#define KADM5_PRINC_EXPIRE_TIME	0x000002
#define KADM5_PW_EXPIRATION	0x000004
#define KADM5_LAST_PWD_CHANGE	0x000008
#define KADM5_ATTRIBUTES	0x000010
#define KADM5_MAX_LIFE		0x000020
#define KADM5_MOD_TIME		0x000040
#define KADM5_MOD_NAME		0x000080
#define KADM5_KVNO		0x000100
#define KADM5_MKVNO		0x000200
#define KADM5_AUX_ATTRIBUTES	0x000400
#define KADM5_POLICY		0x000800
#define KADM5_POLICY_CLR	0x001000
#define KADM5_MAX_RLIFE		0x002000
#define KADM5_LAST_SUCCESS	0x004000
#define KADM5_LAST_FAILED	0x008000
#define KADM5_FAIL_AUTH_COUNT	0x010000
#define KADM5_KEY_DATA		0x020000
#define KADM5_TL_DATA		0x040000

#define KADM5_PRINCIPAL_NORMAL_MASK (~(KADM5_KEY_DATA | KADM5_TL_DATA))

#define KADM5_PW_MAX_LIFE 	0x004000
#define KADM5_PW_MIN_LIFE	0x008000
#define KADM5_PW_MIN_LENGTH 	0x010000
#define KADM5_PW_MIN_CLASSES	0x020000
#define KADM5_PW_HISTORY_NUM	0x040000
#define KADM5_REF_COUNT		0x080000

#define KADM5_POLICY_NORMAL_MASK (~0)

#define KADM5_ADMIN_SERVICE	"kadmin/admin"
#define KADM5_HIST_PRINCIPAL	"kadmin/history"
#define KADM5_CHANGEPW_SERVICE	"kadmin/changepw"

typedef struct _krb5_key_data {
    int16_t key_data_ver;	/* Version */
    int16_t key_data_kvno;	/* Key Version */
    int16_t key_data_type[2];	/* Array of types */
    int16_t key_data_length[2];	/* Array of lengths */
    void*   key_data_contents[2];/* Array of pointers */
} krb5_key_data;

typedef struct _krb5_tl_data {
    struct _krb5_tl_data* tl_data_next;
    int16_t tl_data_type;
    int16_t tl_data_length;
    void*   tl_data_contents;
} krb5_tl_data;

#define KRB5_TL_LAST_PWD_CHANGE		0x0001
#define KRB5_TL_MOD_PRINC		0x0002
#define KRB5_TL_KADM_DATA		0x0003
#define KRB5_TL_KADM5_E_DATA		0x0004
#define KRB5_TL_RB1_CHALLENGE		0x0005
#define KRB5_TL_SECURID_STATE           0x0006
#define KRB5_TL_PASSWORD           	0x0007
#define KRB5_TL_EXTENSION           	0x0008
#define KRB5_TL_PKINIT_ACL           	0x0009
#define KRB5_TL_ALIASES           	0x000a

typedef struct _kadm5_principal_ent_t {
    krb5_principal principal;

    krb5_timestamp princ_expire_time;
    krb5_timestamp last_pwd_change;
    krb5_timestamp pw_expiration;
    krb5_deltat max_life;
    krb5_principal mod_name;
    krb5_timestamp mod_date;
    krb5_flags attributes;
    krb5_kvno kvno;
    krb5_kvno mkvno;

    char * policy;
    uint32_t aux_attributes;

    krb5_deltat max_renewable_life;
    krb5_timestamp last_success;
    krb5_timestamp last_failed;
    krb5_kvno fail_auth_count;
    int16_t n_key_data;
    int16_t n_tl_data;
    krb5_tl_data *tl_data;
    krb5_key_data *key_data;
} kadm5_principal_ent_rec, *kadm5_principal_ent_t;

typedef struct _kadm5_policy_ent_t {
    char *policy;

    uint32_t pw_min_life;
    uint32_t pw_max_life;
    uint32_t pw_min_length;
    uint32_t pw_min_classes;
    uint32_t pw_history_num;
    uint32_t policy_refcnt;
} kadm5_policy_ent_rec, *kadm5_policy_ent_t;

#define KADM5_CONFIG_REALM			(1 << 0)
#define KADM5_CONFIG_PROFILE			(1 << 1)
#define KADM5_CONFIG_KADMIND_PORT		(1 << 2)
#define KADM5_CONFIG_ADMIN_SERVER		(1 << 3)
#define KADM5_CONFIG_DBNAME			(1 << 4)
#define KADM5_CONFIG_ADBNAME			(1 << 5)
#define KADM5_CONFIG_ADB_LOCKFILE		(1 << 6)
#define KADM5_CONFIG_ACL_FILE			(1 << 7)
#define KADM5_CONFIG_DICT_FILE			(1 << 8)
#define KADM5_CONFIG_ADMIN_KEYTAB		(1 << 9)
#define KADM5_CONFIG_MKEY_FROM_KEYBOARD		(1 << 10)
#define KADM5_CONFIG_STASH_FILE			(1 << 11)
#define KADM5_CONFIG_MKEY_NAME			(1 << 12)
#define KADM5_CONFIG_ENCTYPE			(1 << 13)
#define KADM5_CONFIG_MAX_LIFE			(1 << 14)
#define KADM5_CONFIG_MAX_RLIFE			(1 << 15)
#define KADM5_CONFIG_EXPIRATION			(1 << 16)
#define KADM5_CONFIG_FLAGS			(1 << 17)
#define KADM5_CONFIG_ENCTYPES			(1 << 18)

#define KADM5_PRIV_GET		(1 << 0)
#define KADM5_PRIV_ADD 		(1 << 1)
#define KADM5_PRIV_MODIFY	(1 << 2)
#define KADM5_PRIV_DELETE	(1 << 3)
#define KADM5_PRIV_LIST		(1 << 4)
#define KADM5_PRIV_CPW		(1 << 5)
#define KADM5_PRIV_ALL		(KADM5_PRIV_GET | KADM5_PRIV_ADD | KADM5_PRIV_MODIFY | KADM5_PRIV_DELETE | KADM5_PRIV_LIST | KADM5_PRIV_CPW)

typedef struct {
    int XXX;
}krb5_key_salt_tuple;

typedef struct _kadm5_config_params {
    uint32_t mask;

    /* Client and server fields */
    char *realm;
    int kadmind_port;

    /* client fields */
    char *admin_server;

    /* server fields */
    char *dbname;
    char *acl_file;

    /* server library (database) fields */
    char *stash_file;
} kadm5_config_params;

typedef krb5_error_code kadm5_ret_t;

#include "kadm5-protos.h"

#if 0
/* unimplemented functions */
kadm5_ret_t
kadm5_decrypt_key(void *server_handle,
		  kadm5_principal_ent_t entry, int32_t
		  ktype, int32_t stype, int32_t
		  kvno, krb5_keyblock *keyblock,
		  krb5_keysalt *keysalt, int *kvnop);

kadm5_ret_t
kadm5_create_policy(void *server_handle,
		    kadm5_policy_ent_t policy, uint32_t mask);

kadm5_ret_t
kadm5_delete_policy(void *server_handle, char *policy);

kadm5_ret_t
kadm5_modify_policy(void *server_handle,
		    kadm5_policy_ent_t policy,
		    uint32_t mask);

kadm5_ret_t
kadm5_get_policy(void *server_handle, char *policy, kadm5_policy_ent_t ent);

kadm5_ret_t
kadm5_get_policies(void *server_handle, char *exp,
		   char ***pols, int *count);

void
kadm5_free_policy_ent(kadm5_policy_ent_t policy);

#endif

#endif /* __KADM5_ADMIN_H__ */


code:
/* This is a generated file */
#ifndef __kadm5_private_h__
#define __kadm5_private_h__

#include <stdarg.h>

kadm5_ret_t
_kadm5_acl_check_permission (
	kadm5_server_context */*context*/,
	unsigned /*op*/,
	krb5_const_principal /*princ*/);

kadm5_ret_t
_kadm5_acl_init (kadm5_server_context */*context*/);

kadm5_ret_t
_kadm5_bump_pw_expire (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/);

krb5_error_code
_kadm5_c_get_cred_cache (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*server_name*/,
	const char */*password*/,
	krb5_prompter_fct /*prompter*/,
	const char */*keytab*/,
	krb5_ccache /*ccache*/,
	krb5_ccache */*ret_cache*/);

kadm5_ret_t
_kadm5_c_init_context (
	kadm5_client_context **/*ctx*/,
	kadm5_config_params */*params*/,
	krb5_context /*context*/);

kadm5_ret_t
_kadm5_client_recv (
	kadm5_client_context */*context*/,
	krb5_data */*reply*/);

kadm5_ret_t
_kadm5_client_send (
	kadm5_client_context */*context*/,
	krb5_storage */*sp*/);

int
_kadm5_cmp_keys (
	Key */*keys1*/,
	int /*len1*/,
	Key */*keys2*/,
	int /*len2*/);

kadm5_ret_t
_kadm5_connect (void */*handle*/);

kadm5_ret_t
_kadm5_error_code (kadm5_ret_t /*code*/);

void
_kadm5_free_keys (
	krb5_context /*context*/,
	int /*len*/,
	Key */*keys*/);

void
_kadm5_init_keys (
	Key */*keys*/,
	int /*len*/);

kadm5_ret_t
_kadm5_marshal_params (
	krb5_context /*context*/,
	kadm5_config_params */*params*/,
	krb5_data */*out*/);

kadm5_ret_t
_kadm5_privs_to_string (
	uint32_t /*privs*/,
	char */*string*/,
	size_t /*len*/);

HDB *
_kadm5_s_get_db (void */*server_handle*/);

kadm5_ret_t
_kadm5_s_init_context (
	kadm5_server_context **/*ctx*/,
	kadm5_config_params */*params*/,
	krb5_context /*context*/);

kadm5_ret_t
_kadm5_set_keys (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/,
	const char */*password*/);

kadm5_ret_t
_kadm5_set_keys2 (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/,
	int16_t /*n_key_data*/,
	krb5_key_data */*key_data*/);

kadm5_ret_t
_kadm5_set_keys3 (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/,
	int /*n_keys*/,
	krb5_keyblock */*keyblocks*/);

kadm5_ret_t
_kadm5_set_keys_randomly (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/,
	krb5_keyblock **/*new_keys*/,
	int */*n_keys*/);

kadm5_ret_t
_kadm5_set_modifier (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/);

kadm5_ret_t
_kadm5_setup_entry (
	kadm5_server_context */*context*/,
	hdb_entry_ex */*ent*/,
	uint32_t /*mask*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*princ_mask*/,
	kadm5_principal_ent_t /*def*/,
	uint32_t /*def_mask*/);

kadm5_ret_t
_kadm5_string_to_privs (
	const char */*s*/,
	uint32_t* /*privs*/);

kadm5_ret_t
_kadm5_unmarshal_params (
	krb5_context /*context*/,
	krb5_data */*in*/,
	kadm5_config_params */*params*/);

kadm5_ret_t
kadm5_c_chpass_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	const char */*password*/);

kadm5_ret_t
kadm5_c_chpass_principal_with_key (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	int /*n_key_data*/,
	krb5_key_data */*key_data*/);

kadm5_ret_t
kadm5_c_create_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/,
	const char */*password*/);

kadm5_ret_t
kadm5_c_delete_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/);

kadm5_ret_t
kadm5_c_destroy (void */*server_handle*/);

kadm5_ret_t
kadm5_c_flush (void */*server_handle*/);

kadm5_ret_t
kadm5_c_get_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	kadm5_principal_ent_t /*out*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_c_get_principals (
	void */*server_handle*/,
	const char */*expression*/,
	char ***/*princs*/,
	int */*count*/);

kadm5_ret_t
kadm5_c_get_privs (
	void */*server_handle*/,
	uint32_t */*privs*/);

kadm5_ret_t
kadm5_c_init_with_creds (
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_init_with_creds_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_init_with_password (
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_init_with_password_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_init_with_skey (
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_init_with_skey_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_c_modify_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_c_randkey_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	krb5_keyblock **/*new_keys*/,
	int */*n_keys*/);

kadm5_ret_t
kadm5_c_rename_principal (
	void */*server_handle*/,
	krb5_principal /*source*/,
	krb5_principal /*target*/);

kadm5_ret_t
kadm5_log_create (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/);

kadm5_ret_t
kadm5_log_delete (
	kadm5_server_context */*context*/,
	krb5_principal /*princ*/);

kadm5_ret_t
kadm5_log_end (kadm5_server_context */*context*/);

kadm5_ret_t
kadm5_log_foreach (
	kadm5_server_context */*context*/,
	void (*/*func*/)(kadm5_server_context *server_context, uint32_t ver, time_t timestamp, enum kadm_ops op, uint32_t len, krb5_storage *, void *),
	void */*ctx*/);

kadm5_ret_t
kadm5_log_get_version (
	kadm5_server_context */*context*/,
	uint32_t */*ver*/);

kadm5_ret_t
kadm5_log_get_version_fd (
	int /*fd*/,
	uint32_t */*ver*/);

krb5_storage *
kadm5_log_goto_end (int /*fd*/);

kadm5_ret_t
kadm5_log_init (kadm5_server_context */*context*/);

kadm5_ret_t
kadm5_log_modify (
	kadm5_server_context */*context*/,
	hdb_entry */*ent*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_log_nop (kadm5_server_context */*context*/);

kadm5_ret_t
kadm5_log_previous (
	krb5_context /*context*/,
	krb5_storage */*sp*/,
	uint32_t */*ver*/,
	time_t */*timestamp*/,
	enum kadm_ops */*op*/,
	uint32_t */*len*/);

kadm5_ret_t
kadm5_log_reinit (kadm5_server_context */*context*/);

kadm5_ret_t
kadm5_log_rename (
	kadm5_server_context */*context*/,
	krb5_principal /*source*/,
	hdb_entry */*ent*/);

kadm5_ret_t
kadm5_log_replay (
	kadm5_server_context */*context*/,
	enum kadm_ops /*op*/,
	uint32_t /*ver*/,
	uint32_t /*len*/,
	krb5_storage */*sp*/);

kadm5_ret_t
kadm5_log_set_version (
	kadm5_server_context */*context*/,
	uint32_t /*vno*/);

const char *
kadm5_log_signal_socket (krb5_context /*context*/);

kadm5_ret_t
kadm5_log_truncate (kadm5_server_context */*server_context*/);

kadm5_ret_t
kadm5_s_chpass_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	const char */*password*/);

kadm5_ret_t
kadm5_s_chpass_principal_cond (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	const char */*password*/);

kadm5_ret_t
kadm5_s_chpass_principal_with_key (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	int /*n_key_data*/,
	krb5_key_data */*key_data*/);

kadm5_ret_t
kadm5_s_create_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/,
	const char */*password*/);

kadm5_ret_t
kadm5_s_create_principal_with_key (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_s_delete_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/);

kadm5_ret_t
kadm5_s_destroy (void */*server_handle*/);

kadm5_ret_t
kadm5_s_flush (void */*server_handle*/);

kadm5_ret_t
kadm5_s_get_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	kadm5_principal_ent_t /*out*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_s_get_principals (
	void */*server_handle*/,
	const char */*expression*/,
	char ***/*princs*/,
	int */*count*/);

kadm5_ret_t
kadm5_s_get_privs (
	void */*server_handle*/,
	uint32_t */*privs*/);

kadm5_ret_t
kadm5_s_init_with_creds (
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_init_with_creds_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_init_with_password (
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_init_with_password_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_init_with_skey (
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_init_with_skey_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_s_modify_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_s_randkey_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	krb5_keyblock **/*new_keys*/,
	int */*n_keys*/);

kadm5_ret_t
kadm5_s_rename_principal (
	void */*server_handle*/,
	krb5_principal /*source*/,
	krb5_principal /*target*/);

#endif /* __kadm5_private_h__ */

repo_name: veiledmerc/mira

license: mit


code:
/* This is a generated file */
#ifndef __kadm5_protos_h__
#define __kadm5_protos_h__

#include <stdarg.h>

#ifdef __cplusplus
extern "C" {
#endif

kadm5_ret_t
kadm5_ad_init_with_password (
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_ad_init_with_password_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

krb5_error_code
kadm5_add_passwd_quality_verifier (
	krb5_context /*context*/,
	const char */*check_library*/);

const char *
kadm5_check_password_quality (
	krb5_context /*context*/,
	krb5_principal /*principal*/,
	krb5_data */*pwd_data*/);

kadm5_ret_t
kadm5_chpass_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	const char */*password*/);

kadm5_ret_t
kadm5_chpass_principal_with_key (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	int /*n_key_data*/,
	krb5_key_data */*key_data*/);

kadm5_ret_t
kadm5_create_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/,
	const char */*password*/);

kadm5_ret_t
kadm5_delete_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/);

kadm5_ret_t
kadm5_destroy (void */*server_handle*/);

kadm5_ret_t
kadm5_flush (void */*server_handle*/);

void
kadm5_free_key_data (
	void */*server_handle*/,
	int16_t */*n_key_data*/,
	krb5_key_data */*key_data*/);

void
kadm5_free_name_list (
	void */*server_handle*/,
	char **/*names*/,
	int */*count*/);

void
kadm5_free_principal_ent (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/);

kadm5_ret_t
kadm5_get_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	kadm5_principal_ent_t /*out*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_get_principals (
	void */*server_handle*/,
	const char */*expression*/,
	char ***/*princs*/,
	int */*count*/);

kadm5_ret_t
kadm5_get_privs (
	void */*server_handle*/,
	uint32_t */*privs*/);

kadm5_ret_t
kadm5_init_with_creds (
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_init_with_creds_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	krb5_ccache /*ccache*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_init_with_password (
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_init_with_password_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*password*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_init_with_skey (
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_init_with_skey_ctx (
	krb5_context /*context*/,
	const char */*client_name*/,
	const char */*keytab*/,
	const char */*service_name*/,
	kadm5_config_params */*realm_params*/,
	unsigned long /*struct_version*/,
	unsigned long /*api_version*/,
	void **/*server_handle*/);

kadm5_ret_t
kadm5_modify_principal (
	void */*server_handle*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_randkey_principal (
	void */*server_handle*/,
	krb5_principal /*princ*/,
	krb5_keyblock **/*new_keys*/,
	int */*n_keys*/);

kadm5_ret_t
kadm5_rename_principal (
	void */*server_handle*/,
	krb5_principal /*source*/,
	krb5_principal /*target*/);

kadm5_ret_t
kadm5_ret_key_data (
	krb5_storage */*sp*/,
	krb5_key_data */*key*/);

kadm5_ret_t
kadm5_ret_principal_ent (
	krb5_storage */*sp*/,
	kadm5_principal_ent_t /*princ*/);

kadm5_ret_t
kadm5_ret_principal_ent_mask (
	krb5_storage */*sp*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t */*mask*/);

kadm5_ret_t
kadm5_ret_tl_data (
	krb5_storage */*sp*/,
	krb5_tl_data */*tl*/);

void
kadm5_setup_passwd_quality_check (
	krb5_context /*context*/,
	const char */*check_library*/,
	const char */*check_function*/);

kadm5_ret_t
kadm5_store_key_data (
	krb5_storage */*sp*/,
	krb5_key_data */*key*/);

kadm5_ret_t
kadm5_store_principal_ent (
	krb5_storage */*sp*/,
	kadm5_principal_ent_t /*princ*/);

kadm5_ret_t
kadm5_store_principal_ent_mask (
	krb5_storage */*sp*/,
	kadm5_principal_ent_t /*princ*/,
	uint32_t /*mask*/);

kadm5_ret_t
kadm5_store_tl_data (
	krb5_storage */*sp*/,
	krb5_tl_data */*tl*/);

#ifdef __cplusplus
}
#endif

#endif /* __kadm5_protos_h__ */


code:
/* Generated from /usr/src/kerberos5/lib/libkadm5clnt/../../../crypto/heimdal/lib/kadm5/kadm5_err.et */
/* $Id: kadm5_err.et 16683 2006-02-02 13:11:47Z lha $ */

#ifndef __kadm5_err_h__
#define __kadm5_err_h__

struct et_list;

void initialize_kadm5_error_table_r(struct et_list **);

void initialize_kadm5_error_table(void);
#define init_kadm5_err_tbl initialize_kadm5_error_table

typedef enum kadm5_error_number{
	KADM5_FAILURE = 43787520,
	KADM5_AUTH_GET = 43787521,
	KADM5_AUTH_ADD = 43787522,
	KADM5_AUTH_MODIFY = 43787523,
	KADM5_AUTH_DELETE = 43787524,
	KADM5_AUTH_INSUFFICIENT = 43787525,
	KADM5_BAD_DB = 43787526,
	KADM5_DUP = 43787527,
	KADM5_RPC_ERROR = 43787528,
	KADM5_NO_SRV = 43787529,
	KADM5_BAD_HIST_KEY = 43787530,
	KADM5_NOT_INIT = 43787531,
	KADM5_UNK_PRINC = 43787532,
	KADM5_UNK_POLICY = 43787533,
	KADM5_BAD_MASK = 43787534,
	KADM5_BAD_CLASS = 43787535,
	KADM5_BAD_LENGTH = 43787536,
	KADM5_BAD_POLICY = 43787537,
	KADM5_BAD_PRINCIPAL = 43787538,
	KADM5_BAD_AUX_ATTR = 43787539,
	KADM5_BAD_HISTORY = 43787540,
	KADM5_BAD_MIN_PASS_LIFE = 43787541,
	KADM5_PASS_Q_TOOSHORT = 43787542,
	KADM5_PASS_Q_CLASS = 43787543,
	KADM5_PASS_Q_DICT = 43787544,
	KADM5_PASS_REUSE = 43787545,
	KADM5_PASS_TOOSOON = 43787546,
	KADM5_POLICY_REF = 43787547,
	KADM5_INIT = 43787548,
	KADM5_BAD_PASSWORD = 43787549,
	KADM5_PROTECT_PRINCIPAL = 43787550,
	KADM5_BAD_SERVER_HANDLE = 43787551,
	KADM5_BAD_STRUCT_VERSION = 43787552,
	KADM5_OLD_STRUCT_VERSION = 43787553,
	KADM5_NEW_STRUCT_VERSION = 43787554,
	KADM5_BAD_API_VERSION = 43787555,
	KADM5_OLD_LIB_API_VERSION = 43787556,
	KADM5_OLD_SERVER_API_VERSION = 43787557,
	KADM5_NEW_LIB_API_VERSION = 43787558,
	KADM5_NEW_SERVER_API_VERSION = 43787559,
	KADM5_SECURE_PRINC_MISSING = 43787560,
	KADM5_NO_RENAME_SALT = 43787561,
	KADM5_BAD_CLIENT_PARAMS = 43787562,
	KADM5_BAD_SERVER_PARAMS = 43787563,
	KADM5_AUTH_LIST = 43787564,
	KADM5_AUTH_CHANGEPW = 43787565,
	KADM5_BAD_TL_TYPE = 43787566,
	KADM5_MISSING_CONF_PARAMS = 43787567,
	KADM5_BAD_SERVER_NAME = 43787568
} kadm5_error_number;

#define ERROR_TABLE_BASE_kadm5 43787520

#endif /* __kadm5_err_h__ */


code:
/*
 * Copyright (c) 1997-2000 Kungliga Tekniska H�gskolan
 * (Royal Institute of Technology, Stockholm, Sweden).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/* $Id: private.h 22211 2007-12-07 19:27:27Z lha $ */

#ifndef __kadm5_privatex_h__
#define __kadm5_privatex_h__

struct kadm_func {
    kadm5_ret_t (*chpass_principal) (void *, krb5_principal, const char*);
    kadm5_ret_t (*create_principal) (void*, kadm5_principal_ent_t,
				     uint32_t, const char*);
    kadm5_ret_t (*delete_principal) (void*, krb5_principal);
    kadm5_ret_t (*destroy) (void*);
    kadm5_ret_t (*flush) (void*);
    kadm5_ret_t (*get_principal) (void*, krb5_principal,
				  kadm5_principal_ent_t, uint32_t);
    kadm5_ret_t (*get_principals) (void*, const char*, char***, int*);
    kadm5_ret_t (*get_privs) (void*, uint32_t*);
    kadm5_ret_t (*modify_principal) (void*, kadm5_principal_ent_t, uint32_t);
    kadm5_ret_t (*randkey_principal) (void*, krb5_principal,
				      krb5_keyblock**, int*);
    kadm5_ret_t (*rename_principal) (void*, krb5_principal, krb5_principal);
    kadm5_ret_t (*chpass_principal_with_key) (void *, krb5_principal,
					      int, krb5_key_data *);
};

/* XXX should be integrated */
typedef struct kadm5_common_context {
    krb5_context context;
    krb5_boolean my_context;
    struct kadm_func funcs;
    void *data;
}kadm5_common_context;

typedef struct kadm5_log_peer {
    int fd;
    char *name;
    krb5_auth_context ac;
    struct kadm5_log_peer *next;
} kadm5_log_peer;

typedef struct kadm5_log_context {
    char *log_file;
    int log_fd;
    uint32_t version;
    struct sockaddr_un socket_name;
    int socket_fd;
} kadm5_log_context;

typedef struct kadm5_server_context {
    krb5_context context;
    krb5_boolean my_context;
    struct kadm_func funcs;
    /* */
    kadm5_config_params config;
    HDB *db;
    krb5_principal caller;
    unsigned acl_flags;
    kadm5_log_context log_context;
} kadm5_server_context;

typedef struct kadm5_client_context {
    krb5_context context;
    krb5_boolean my_context;
    struct kadm_func funcs;
    /* */
    krb5_auth_context ac;
    char *realm;
    char *admin_server;
    int kadmind_port;
    int sock;
    char *client_name;
    char *service_name;
    krb5_prompter_fct prompter;
    const char *keytab;
    krb5_ccache ccache;
    kadm5_config_params *realm_params;
}kadm5_client_context;

typedef struct kadm5_ad_context {
    krb5_context context;
    krb5_boolean my_context;
    struct kadm_func funcs;
    /* */
    kadm5_config_params config;
    krb5_principal caller;
    krb5_ccache ccache;
    char *client_name;
    char *realm;
    void *ldap_conn;
    char *base_dn;
} kadm5_ad_context;

enum kadm_ops {
    kadm_get,
    kadm_delete,
    kadm_create,
    kadm_rename,
    kadm_chpass,
    kadm_modify,
    kadm_randkey,
    kadm_get_privs,
    kadm_get_princs,
    kadm_chpass_with_key,
    kadm_nop
};

#define KADMIN_APPL_VERSION "KADM0.1"
#define KADMIN_OLD_APPL_VERSION "KADM0.0"

#include "kadm5-private.h"

#endif /* __kadm5_privatex_h__ */


code:
/*
 * Copyright (c) 1995 - 2001, 2003 Kungliga Tekniska H�gskolan
 * (Royal Institute of Technology, Stockholm, Sweden).
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * 3. Neither the name of the Institute nor the names of its contributors
 *    may be used to endorse or promote products derived from this software
 *    without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */

/* $Id: kafs.h 20652 2007-05-10 19:30:18Z lha $ */

#ifndef __KAFS_H
#define __KAFS_H

/* XXX must include krb5.h or krb.h */

/* sys/ioctl.h must be included manually before kafs.h */

/*
 */
#define AFSCALL_PIOCTL 20
#define AFSCALL_SETPAG 21

#ifndef _VICEIOCTL
#define _VICEIOCTL(id)  ((unsigned int ) _IOW('V', id, struct ViceIoctl))
#define _AFSCIOCTL(id)  ((unsigned int ) _IOW('C', id, struct ViceIoctl))
#endif /* _VICEIOCTL */

#define VIOCSETAL		_VICEIOCTL(1)
#define VIOCGETAL		_VICEIOCTL(2)
#define VIOCSETTOK		_VICEIOCTL(3)
#define VIOCGETVOLSTAT		_VICEIOCTL(4)
#define VIOCSETVOLSTAT		_VICEIOCTL(5)
#define VIOCFLUSH		_VICEIOCTL(6)
#define VIOCGETTOK		_VICEIOCTL(8)
#define VIOCUNLOG		_VICEIOCTL(9)
#define VIOCCKSERV		_VICEIOCTL(10)
#define VIOCCKBACK		_VICEIOCTL(11)
#define VIOCCKCONN		_VICEIOCTL(12)
#define VIOCWHEREIS		_VICEIOCTL(14)
#define VIOCACCESS		_VICEIOCTL(20)
#define VIOCUNPAG		_VICEIOCTL(21)
#define VIOCGETFID		_VICEIOCTL(22)
#define VIOCSETCACHESIZE	_VICEIOCTL(24)
#define VIOCFLUSHCB		_VICEIOCTL(25)
#define VIOCNEWCELL		_VICEIOCTL(26)
#define VIOCGETCELL		_VICEIOCTL(27)
#define VIOC_AFS_DELETE_MT_PT	_VICEIOCTL(28)
#define VIOC_AFS_STAT_MT_PT	_VICEIOCTL(29)
#define VIOC_FILE_CELL_NAME	_VICEIOCTL(30)
#define VIOC_GET_WS_CELL	_VICEIOCTL(31)
#define VIOC_AFS_MARINER_HOST	_VICEIOCTL(32)
#define VIOC_GET_PRIMARY_CELL	_VICEIOCTL(33)
#define VIOC_VENUSLOG		_VICEIOCTL(34)
#define VIOC_GETCELLSTATUS	_VICEIOCTL(35)
#define VIOC_SETCELLSTATUS	_VICEIOCTL(36)
#define VIOC_FLUSHVOLUME	_VICEIOCTL(37)
#define VIOC_AFS_SYSNAME	_VICEIOCTL(38)
#define VIOC_EXPORTAFS		_VICEIOCTL(39)
#define VIOCGETCACHEPARAMS	_VICEIOCTL(40)
#define VIOC_GCPAGS		_VICEIOCTL(48)

#define VIOCGETTOK2		_AFSCIOCTL(7)
#define VIOCSETTOK2		_AFSCIOCTL(8)

struct ViceIoctl {
  caddr_t in, out;
  short in_size;
  short out_size;
};

struct ClearToken {
  int32_t AuthHandle;
  char HandShakeKey[8];
  int32_t ViceId;
  int32_t BeginTimestamp;
  int32_t EndTimestamp;
};

/* Use k_hasafs() to probe if the machine supports AFS syscalls.
   The other functions will generate a SIGSYS if AFS is not supported */

int k_hasafs (void);
int k_hasafs_recheck (void);

int krb_afslog (const char *cell, const char *realm);
int krb_afslog_uid (const char *cell, const char *realm, uid_t uid);
int krb_afslog_home (const char *cell, const char *realm,
			 const char *homedir);
int krb_afslog_uid_home (const char *cell, const char *realm, uid_t uid,
			     const char *homedir);

int krb_realm_of_cell (const char *cell, char **realm);

/* compat */
#define k_afsklog krb_afslog
#define k_afsklog_uid krb_afslog_uid

int k_pioctl (char *a_path,
		  int o_opcode,
		  struct ViceIoctl *a_paramsP,
		  int a_followSymlinks);
int k_unlog (void);
int k_setpag (void);
int k_afs_cell_of_file (const char *path, char *cell, int len);

/* XXX */
#ifdef KFAILURE
#define KRB_H_INCLUDED
#endif

#ifdef KRB5_RECVAUTH_IGNORE_VERSION
#define KRB5_H_INCLUDED
#endif

void kafs_set_verbose (void (*kafs_verbose)(void *, const char *), void *);
int kafs_settoken_rxkad (const char *, struct ClearToken *,
			     void *ticket, size_t ticket_len);
#ifdef KRB_H_INCLUDED
int kafs_settoken (const char*, uid_t, CREDENTIALS*);
#endif
#ifdef KRB5_H_INCLUDED
int kafs_settoken5 (krb5_context, const char*, uid_t, krb5_creds*);
#endif

#ifdef KRB5_H_INCLUDED
krb5_error_code krb5_afslog_uid (krb5_context context,
				     krb5_ccache id,
				     const char *cell,
				     krb5_const_realm realm,
				     uid_t uid);
krb5_error_code krb5_afslog (krb5_context context,
				 krb5_ccache id,
				 const char *cell,
				 krb5_const_realm realm);
krb5_error_code krb5_afslog_uid_home (krb5_context context,
					  krb5_ccache id,
					  const char *cell,
					  krb5_const_realm realm,
					  uid_t uid,
					  const char *homedir);

krb5_error_code krb5_afslog_home (krb5_context context,
				      krb5_ccache id,
				      const char *cell,
				      krb5_const_realm realm,
				      const char *homedir);

krb5_error_code krb5_realm_of_cell (const char *cell, char **realm);

#endif

#define _PATH_VICE		"/usr/vice/etc/"
#define _PATH_THISCELL 		_PATH_VICE "ThisCell"
#define _PATH_CELLSERVDB 	_PATH_VICE "CellServDB"
#define _PATH_THESECELLS	_PATH_VICE "TheseCells"

#define _PATH_ARLA_VICE		"/usr/arla/etc/"
#define _PATH_ARLA_THISCELL	_PATH_ARLA_VICE "ThisCell"
#define _PATH_ARLA_CELLSERVDB 	_PATH_ARLA_VICE "CellServDB"
#define _PATH_ARLA_THESECELLS	_PATH_ARLA_VICE "TheseCells"

#define _PATH_OPENAFS_DEBIAN_VICE		"/etc/openafs/"
#define _PATH_OPENAFS_DEBIAN_THISCELL		_PATH_OPENAFS_DEBIAN_VICE "ThisCell"
#define _PATH_OPENAFS_DEBIAN_CELLSERVDB 	_PATH_OPENAFS_DEBIAN_VICE "CellServDB"
#define _PATH_OPENAFS_DEBIAN_THESECELLS		_PATH_OPENAFS_DEBIAN_VICE "TheseCells"

#define _PATH_OPENAFS_MACOSX_VICE		"/var/db/openafs/etc/"
#define _PATH_OPENAFS_MACOSX_THISCELL		_PATH_OPENAFS_MACOSX_VICE "ThisCell"
#define _PATH_OPENAFS_MACOSX_CELLSERVDB		_PATH_OPENAFS_MACOSX_VICE "CellServDB"
#define _PATH_OPENAFS_MACOSX_THESECELLS		_PATH_OPENAFS_MACOSX_VICE "TheseCells"

#define _PATH_ARLA_DEBIAN_VICE			"/etc/arla/"
#define _PATH_ARLA_DEBIAN_THISCELL		_PATH_ARLA_DEBIAN_VICE "ThisCell"
#define _PATH_ARLA_DEBIAN_CELLSERVDB		_PATH_ARLA_DEBIAN_VICE "CellServDB"
#define _PATH_ARLA_DEBIAN_THESECELLS		_PATH_ARLA_DEBIAN_VICE "TheseCells"

#define _PATH_ARLA_OPENBSD_VICE			"/etc/afs/"
#define _PATH_ARLA_OPENBSD_THISCELL		_PATH_ARLA_OPENBSD_VICE "ThisCell"
#define _PATH_ARLA_OPENBSD_CELLSERVDB		_PATH_ARLA_OPENBSD_VICE "CellServDB"
#define _PATH_ARLA_OPENBSD_THESECELLS		_PATH_ARLA_OPENBSD_VICE "TheseCells"

extern int _kafs_debug;

#endif /* __KAFS_H */


code:
/*-
 * Copyright (c) 2002 Maxime Henrion <mux@FreeBSD.org>
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $FreeBSD: release/9.0.0/include/kenv.h 152750 2005-11-24 07:20:26Z ru $
 */

#ifndef _KENV_H_
#define _KENV_H_

#include <sys/cdefs.h>
#include <sys/kenv.h>

__BEGIN_DECLS
int kenv(int, const char *, char *, int);
__END_DECLS

#endif /* !_KENV_H_ */