1*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 2*0Sstevel@tonic-gate 3*0Sstevel@tonic-gate /* 4*0Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 5*0Sstevel@tonic-gate * 6*0Sstevel@tonic-gate * Openvision retains the copyright to derivative works of 7*0Sstevel@tonic-gate * this source code. Do *NOT* create a derivative of this 8*0Sstevel@tonic-gate * source code before consulting with your legal department. 9*0Sstevel@tonic-gate * Do *NOT* integrate *ANY* of this source code into another 10*0Sstevel@tonic-gate * product before consulting with your legal department. 11*0Sstevel@tonic-gate * 12*0Sstevel@tonic-gate * For further information, read the top-level Openvision 13*0Sstevel@tonic-gate * copyright which is contained in the top-level MIT Kerberos 14*0Sstevel@tonic-gate * copyright. 15*0Sstevel@tonic-gate * 16*0Sstevel@tonic-gate * WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 17*0Sstevel@tonic-gate * 18*0Sstevel@tonic-gate */ 19*0Sstevel@tonic-gate 20*0Sstevel@tonic-gate 21*0Sstevel@tonic-gate /* 22*0Sstevel@tonic-gate * Copyright 1993 OpenVision Technologies, Inc., All Rights Reserved 23*0Sstevel@tonic-gate * 24*0Sstevel@tonic-gate * $Header: /cvs/krbdev/krb5/src/lib/kadm5/admin_internal.h,v 1.13.18.1 2000/05/19 22:24:14 raeburn Exp $ 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef __KADM5_ADMIN_INTERNAL_H__ 28*0Sstevel@tonic-gate #define __KADM5_ADMIN_INTERNAL_H__ 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #include <kadm5/admin.h> 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #ifdef DEBUG 33*0Sstevel@tonic-gate #define ADMIN_LOG(a, b, c) syslog(a, b, c); 34*0Sstevel@tonic-gate #define ADMIN_LOGO(a, b) syslog(a, b); 35*0Sstevel@tonic-gate #else 36*0Sstevel@tonic-gate #define ADMIN_LOG(a, b, c) 37*0Sstevel@tonic-gate #define ADMIN_LOGO(a, b) 38*0Sstevel@tonic-gate #endif 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #define KADM5_SERVER_HANDLE_MAGIC 0x12345800 41*0Sstevel@tonic-gate 42*0Sstevel@tonic-gate #define GENERIC_CHECK_HANDLE(handle, old_api_version, new_api_version) \ 43*0Sstevel@tonic-gate { \ 44*0Sstevel@tonic-gate kadm5_server_handle_t srvr = \ 45*0Sstevel@tonic-gate (kadm5_server_handle_t) handle; \ 46*0Sstevel@tonic-gate \ 47*0Sstevel@tonic-gate if (! srvr) \ 48*0Sstevel@tonic-gate return KADM5_BAD_SERVER_HANDLE; \ 49*0Sstevel@tonic-gate if (srvr->magic_number != KADM5_SERVER_HANDLE_MAGIC) \ 50*0Sstevel@tonic-gate return KADM5_BAD_SERVER_HANDLE; \ 51*0Sstevel@tonic-gate if ((srvr->struct_version & KADM5_MASK_BITS) != \ 52*0Sstevel@tonic-gate KADM5_STRUCT_VERSION_MASK) \ 53*0Sstevel@tonic-gate return KADM5_BAD_STRUCT_VERSION; \ 54*0Sstevel@tonic-gate if (srvr->struct_version < KADM5_STRUCT_VERSION_1) \ 55*0Sstevel@tonic-gate return KADM5_OLD_STRUCT_VERSION; \ 56*0Sstevel@tonic-gate if (srvr->struct_version > KADM5_STRUCT_VERSION_1) \ 57*0Sstevel@tonic-gate return KADM5_NEW_STRUCT_VERSION; \ 58*0Sstevel@tonic-gate if ((srvr->api_version & KADM5_MASK_BITS) != \ 59*0Sstevel@tonic-gate KADM5_API_VERSION_MASK) \ 60*0Sstevel@tonic-gate return KADM5_BAD_API_VERSION; \ 61*0Sstevel@tonic-gate if (srvr->api_version < KADM5_API_VERSION_1) \ 62*0Sstevel@tonic-gate return old_api_version; \ 63*0Sstevel@tonic-gate if (srvr->api_version > KADM5_API_VERSION_2) \ 64*0Sstevel@tonic-gate return new_api_version; \ 65*0Sstevel@tonic-gate } 66*0Sstevel@tonic-gate 67*0Sstevel@tonic-gate /* 68*0Sstevel@tonic-gate * _KADM5_CHECK_HANDLE calls the function _kadm5_check_handle and 69*0Sstevel@tonic-gate * returns any non-zero error code that function returns. 70*0Sstevel@tonic-gate * _kadm5_check_handle, in client_handle.c and server_handle.c, exists 71*0Sstevel@tonic-gate * in both the server- and client- side libraries. In each library, 72*0Sstevel@tonic-gate * it calls CHECK_HANDLE, which is defined by the appropriate 73*0Sstevel@tonic-gate * _internal.h header file to call GENERIC_CHECK_HANDLE as well as 74*0Sstevel@tonic-gate * CLIENT_CHECK_HANDLE and SERVER_CHECK_HANDLE. 75*0Sstevel@tonic-gate * 76*0Sstevel@tonic-gate * _KADM5_CHECK_HANDLE should be used by a function that needs to 77*0Sstevel@tonic-gate * check the handle but wants to be the same code in both the client 78*0Sstevel@tonic-gate * and server library; it makes a function call to the right handle 79*0Sstevel@tonic-gate * checker. Code that only exists in one library can call the 80*0Sstevel@tonic-gate * CHECK_HANDLE macro, which inlines the test instead of making 81*0Sstevel@tonic-gate * another function call. 82*0Sstevel@tonic-gate * 83*0Sstevel@tonic-gate * Got that? 84*0Sstevel@tonic-gate */ 85*0Sstevel@tonic-gate int _kadm5_check_handle(); 86*0Sstevel@tonic-gate 87*0Sstevel@tonic-gate #define _KADM5_CHECK_HANDLE(handle) \ 88*0Sstevel@tonic-gate { int code; if ((code = _kadm5_check_handle((void *)handle))) return code; } 89*0Sstevel@tonic-gate 90*0Sstevel@tonic-gate kadm5_ret_t _kadm5_chpass_principal_util(void *server_handle, 91*0Sstevel@tonic-gate void *lhandle, 92*0Sstevel@tonic-gate krb5_principal princ, 93*0Sstevel@tonic-gate char *new_pw, 94*0Sstevel@tonic-gate char **ret_pw, 95*0Sstevel@tonic-gate char *msg_ret, 96*0Sstevel@tonic-gate int msg_len); 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gate /* this is needed by the alt_prof code I stole. The functions 99*0Sstevel@tonic-gate maybe shouldn't be named krb5_*, but they are. */ 100*0Sstevel@tonic-gate 101*0Sstevel@tonic-gate krb5_error_code 102*0Sstevel@tonic-gate krb5_string_to_keysalts(char *string, const char *tupleseps, 103*0Sstevel@tonic-gate const char *ksaltseps, krb5_boolean dups, 104*0Sstevel@tonic-gate krb5_key_salt_tuple **ksaltp, krb5_int32 *nksaltp); 105*0Sstevel@tonic-gate 106*0Sstevel@tonic-gate krb5_error_code 107*0Sstevel@tonic-gate krb5_string_to_flags(char* string, const char* positive, const char* negative, 108*0Sstevel@tonic-gate krb5_flags *flagsp); 109*0Sstevel@tonic-gate 110*0Sstevel@tonic-gate #endif /* __KADM5_ADMIN_INTERNAL_H__ */ 111