OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
sec_id_parse_name(rhandle, /* Handle to the registry server. */
princ_name, /* Global (full) name of the principal. */
NULL, /* Principal’s home cell name returned here. */
NULL, /* Pointer to UUID of above returned here. */
local_name, /* Principal local name returned here. */
NULL, /* Pointer to UUID of above returned here. */
status);
if (*status != error_status_ok)
{
free(local_name);
print_error("sec_id_parse_name()", *status);
return 0;
}
else
{
fprintf(stdout,
"sample_client: Full principal name == %s0,
princ_name);
fprintf(stdout,
"sample_client: Local principal name == %s0,
local_name);
}
/* And finally, find out from the registry whether that principal */
/* is a valid member of the specified group... */
fprintf(stdout, "sample_client: Calling sec_rgy_pgo_is_member()...0);
is_valid = sec_rgy_pgo_is_member(rhandle,
sec_rgy_domain_group,
group,
local_name,
status);
if (*status != error_status_ok)
{
free(local_name);
print_error("sec_rgy_pgo_is_member()", *status);
return 0;
}
/* Free the principal name string area... */
free(local_name);
return(is_valid);
}
124246 Tandem Computers Incorporated A− 91