OSF DCE Application Development Guide--Introduction and Style Guide

OSF DCE Application Development Guide—Introduction and Style Guide
void server_get_identity(
unsigned_char_p_t prin_name, /* Server principal name. */
sec_login_handle_t *login_context, /* Returns server’s login context. */
unsigned_char_p_t keytab, /* Local key file. */
unsigned32 *status)
{
pthread_t keymgr;
sec_passwd_rec_t *keydata;
sec_login_auth_src_t auth_src;
boolean32 reset_pwd;
*status = error_status_ok;
/* Spin off thread to manage key for specified principal... */
if (pthread_create(&keymgr, /* Thread handle. */
pthread_attr_default, /* Specifies default thread */
/* attributes. */
(pthread_startroutine_t)managekey, /* Start rou- */
/* tine; see above. */
(void*)prin_name)) /* Argument to pass to start */
/* routine: server princi- */
/* pal name. */
{
dce_svc_printf(CANNOT_MANAGE_KEYS_MSG);
return;
}
/* Create a context and get the login context... */
sec_login_setup_identity(prin_name,
sec_login_no_flags,
login_context,
status);
/* Get secret key from the keytab file... */
sec_key_mgmt_get_key(rpc_c_authn_dce_secret,
keytab,
prin_name,
0,
(void**)&keydata,
status);
/* Validate the login context... */
sec_login_validate_identity(*login_context,
keydata,
&reset_pwd,
&auth_src,
status);
/* Finally, set the context... */
sec_login_set_context(*login_context, status);
}
3 12 Tandem Computers Incorporated 124246