/*
*/
#ifndef __KADM5_ADMIN_H__
#define __KADM5_ADMIN_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
* Openvision retains the copyright to derivative works of
* this source code. Do *NOT* create a derivative of this
* source code before consulting with your legal department.
* Do *NOT* integrate *ANY* of this source code into another
* product before consulting with your legal department.
*
* For further information, read the top-level Openvision
* copyright which is contained in the top-level MIT Kerberos
* copyright.
*
* WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
*
*/
/*
*
* Copyright 2001 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 1993 OpenVision Technologies, Inc., All Rights Reserved
*
* $Header$
*/
#include <k5-int.h>
#include <krb5.h>
#include <com_err.h>
#include <kadm5/kadm_err.h>
#include <kadm5/chpass_util_strings.h>
/*
* Solaris Kerberos:
* in AUTH_GSSAPI but Solaris doesn't support AUTH_GSSAPI. RPCSEC_GSS can only
* be used with host-based principals.
*
*/
typedef char *kadm5_policy_t;
typedef long kadm5_ret_t;
typedef int rpc_int32;
typedef unsigned int rpc_u_int32;
#define KADM5_PW_FIRST_PROMPT \
#define KADM5_PW_SECOND_PROMPT \
/*
* Successful return code
*/
#define KADM5_OK 0
/*
* Field masks
*/
/* kadm5_principal_ent_t */
/* version 2 masks */
#ifdef notyet /* Novell */
#endif
/* Solaris Kerberos: adding support for key history in LDAP KDB */
/* all but KEY_DATA and TL_DATA */
/* kadm5_policy_ent_t */
/* kadm5_config_params */
/* password change constants */
#define KRB5_KPASSWD_SUCCESS 0
/*
* permission bits
*/
/*
* API versioning constants
*/
#ifdef KRB5_DNS_LOOKUP
/*
* Name length constants for DNS lookups
*/
#endif /* KRB5_DNS_LOOKUP */
typedef struct _kadm5_principal_ent_t_v2 {
char *policy;
long aux_attributes;
/* version 2 fields */
typedef struct _kadm5_principal_ent_t_v1 {
char *policy;
long aux_attributes;
#if USE_KADM5_API_VERSION == 1
typedef struct _kadm5_principal_ent_t_v1
#else
typedef struct _kadm5_principal_ent_t_v2
#endif
typedef struct _kadm5_policy_ent_t {
char *policy;
long pw_min_life;
long pw_max_life;
long pw_min_length;
long pw_min_classes;
long pw_history_num;
long policy_refcnt;
/*
* New types to indicate which protocol to use when sending
* password change requests
*/
typedef enum {
/*
* Data structure returned by kadm5_get_config_params()
*/
typedef struct _kadm5_config_params {
long mask;
char * realm;
int kadmind_port;
int kpasswd_port;
char * admin_server;
char * kpasswd_server;
#endif
char * dbname;
char * admin_dbname;
char * admin_lockfile;
char * admin_keytab;
char * acl_file;
char * dict_file;
int mkey_from_kbd;
char * stash_file;
char * mkey_name;
char *kpasswd_server;
int iprop_ulogsize;
char *iprop_polltime;
/***********************************************************************
* This is the old krb5_realm_read_params, which I mutated into
* kadm5_get_config_params but which old code (kdb5_* and krb5kdc)
* still uses.
***********************************************************************/
/*
* Data structure returned by krb5_read_realm_params()
*/
typedef struct __krb5_realm_params {
char * realm_profile;
char * realm_dbname;
char * realm_mkey_name;
char * realm_stash_file;
char * realm_kdc_ports;
char * realm_kdc_tcp_ports;
char * realm_acl_file;
/*
* functions
*/
const char *realm, char **host_service_name);
const char *realm, char **host_service_name);
#if USE_KADM5_API_VERSION > 1
int use_kdc_config,
char *, size_t);
#endif
char *service_name,
#if USE_KADM5_API_VERSION == 1
char *realm,
#else
#endif
char **db_args,
void **server_handle);
char *pass,
char *service_name,
#if USE_KADM5_API_VERSION == 1
char *realm,
#else
#endif
char **db_args,
void **server_handle);
char *keytab,
char *service_name,
#if USE_KADM5_API_VERSION == 1
char *realm,
#else
#endif
char **db_args,
void **server_handle);
#if USE_KADM5_API_VERSION > 1
char *service_name,
char **db_args,
void **server_handle);
#endif
char *msg_ret,
unsigned int msg_len);
long mask,
int n_ks_tuple,
char *pass);
long mask);
#if USE_KADM5_API_VERSION == 1
#else
long mask);
#endif
char *pass);
int n_ks_tuple,
char *pass);
#if USE_KADM5_API_VERSION == 1
#else
/*
* Solaris Kerberos:
* this routine is only implemented in the client library.
*/
int *n_keys);
int *n_keys);
int n_ks_tuple,
int *n_keys);
#endif
int n_keys);
int n_ks_tuple,
int n_keys);
long mask);
/*
* kadm5_create_policy_internal is not part of the supported,
* exposed API. It is available only in the server library, and you
* shouldn't use it unless you know why it's there and how it's
* different from kadm5_create_policy.
*/
long mask);
/*
* kadm5_modify_policy_internal is not part of the supported,
* exposed API. It is available only in the server library, and you
* shouldn't use it unless you know why it's there and how it's
* different from kadm5_modify_policy.
*/
#if USE_KADM5_API_VERSION == 1
#else
#endif
long *privs);
char *new_pw,
char **ret_pw,
char *msg_ret,
unsigned int msg_len);
ent);
int *count);
int *count);
#if USE_KADM5_API_VERSION > 1
#endif
int count);
#if USE_KADM5_API_VERSION == 1
/*
* OVSEC_KADM_API_VERSION_1 should be, if possible, compile-time
* compatible with KADM5_API_VERSION_2. Basically, this means we have
* to continue to provide all the old ovsec_kadm function and symbol
* names.
*/
typedef char *ovsec_kadm_policy_t;
typedef long ovsec_kadm_ret_t;
#define OVSEC_KADM_PW_FIRST_PROMPT \
((char *) error_message(CHPASS_UTIL_NEW_PASSWORD_PROMPT))
#define OVSEC_KADM_PW_SECOND_PROMPT \
((char *) error_message(CHPASS_UTIL_NEW_PASSWORD_AGAIN_PROMPT))
/*
* Successful return code
*/
#define OVSEC_KADM_OK 0
/*
*/
/* principal */
/* policy */
/*
* permission bits
*/
/*
* API versioning constants
*/
typedef struct _ovsec_kadm_principal_ent_t {
char *policy;
long aux_attributes;
typedef struct _ovsec_kadm_policy_ent_t {
char *policy;
long pw_min_life;
long pw_max_life;
long pw_min_length;
long pw_min_classes;
long pw_history_num;
long policy_refcnt;
/*
* functions
*/
char *service_name, char *realm,
char **db_args,
void **server_handle);
char *pass,
char *service_name,
char *realm,
char ** db_args,
void **server_handle);
char *keytab,
char *service_name,
char *realm,
char **db_args,
void **server_handle);
long mask);
char *pass);
long mask);
/*
* ovsec_kadm_create_policy_internal is not part of the supported,
* exposed API. It is available only in the server library, and you
* shouldn't use it unless you know why it's there and how it's
* different from ovsec_kadm_create_policy.
*/
long mask);
/*
* ovsec_kadm_modify_policy_internal is not part of the supported,
* exposed API. It is available only in the server library, and you
* shouldn't use it unless you know why it's there and how it's
* different from ovsec_kadm_modify_policy.
*/
long *privs);
char *new_pw,
char **ret_pw,
char *msg_ret);
ent);
int *count);
int *count);
#endif /* USE_KADM5_API_VERSION == 1 */
char *new_password,
#ifdef __cplusplus
}
#endif
#endif /* __KADM5_ADMIN_H__ */