OSF DCE Application Development Guide--Introduction and Style Guide
OSF DCE Application Development Guide—Introduction and Style Guide
/******
*
* server_get_local_principal_id -- Get (from the local cell registry) the
* UUID corresponding to a principal name.
*
*
* Called from server_create_acl() and server_acl_mgr_setup().
*
******/
void server_get_local_principal_id(
unsigned_char_t *p_name, /* Simple principal name. */
uuid_t *p_id, /* UUID returned here. */
unsigned32 *status) /* Status returned here. */
{
char *cell_name; /* For local cell name. */
sec_rgy_handle_t rhandle; /* For registry server handle. */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug7,
"Entering server_get_local_principal_id()"));
/* First, get the local cell name... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_cf_get_cell_name()"));
dce_cf_get_cell_name(&cell_name, status);
if (*status != error_status_ok)
{
print_server_error("dce_cf_get_cell_name()", *status);
return;
}
/* Now bind to the cell’s registry... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling sec_rgy_site_open()"));
sec_rgy_site_open(cell_name, &rhandle, status);
if (*status != error_status_ok)
{
print_server_error("sec_rgy_site_open()", *status);
return;
}
/* Free the string space we got the cell name in... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling free()"));
free(cell_name);
/* Now get from the registry the UUID associated with the principal */
/* name we got in the first place... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling sec_rgy_pgo_name_to_id()"));
sec_rgy_pgo_name_to_id(rhandle,
sec_rgy_domain_person,
p_name,
p_id,
A− 34 Tandem Computers Incorporated 124246