OSF DCE Application Development Guide--Introduction and Style Guide
A Sample Application
/* Here it might be interesting to try retrieving the ACL itself, */
/* and e.g seeing what its manager type is... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_db_fetch_by_uuid()"));
dce_db_fetch_by_uuid(db_acl,
acl_uuid,
&retrieved_acl,
st);
if (*st != error_status_ok)
{
print_server_error("dce_db_fetch_by_uuid()", *st);
return(0);
}
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling uuid_to_string()"));
uuid_to_string(&(retrieved_acl.sec_acl_manager_type), &uuid_string, st);
if (*st != uuid_s_ok)
{
print_server_error("uuid_to_string()", *st);
return(0);
}
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug8,
"sec_acl_manager_type == %s", uuid_string));
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling rpc_string_free()"));
rpc_string_free(&uuid_string, st);
if (*st != rpc_s_ok)
{
print_server_error("rpc_string_free()", *st);
}
/* We are handling two ACL managers through this function, so we */
/* have to make sure that we’ve extracted from the single ACL */
/* database the correct ACL: i.e., one whose manager type UUID is */
/* identical to the manager_type parameter we were passed: this is */
/* the manager whose ACL the runtime is trying to bind to. The */
/* point is that the ACL library is going to call all its regis- */
/* tered resolvers successively with the SAME ACL UUID, until it */
/* finds one that works. If we just return the ACL UUID without */
/* checking whether the right manager_type is being asked for, */
/* we’ll only cause an error in the ACL library when it discovers */
/* that the types don’t match up. This will prevent acl_edit from */
/* working. So do the checking here... */
if ((manager_type != NULL) && (!uuid_equal(manager_type,
&(retrieved_acl.sec_acl_manager_type),
st)))
124246 Tandem Computers Incorporated A− 65