OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug7,
"Exiting sample_mgmt_auth()"));
if (authorized)
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug8,
"AUTHORIZED!"));
else
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug8,
"NOT AUTHORIZED!"));
/* Return the result to the caller... */
return(authorized);
}
/******
*
* sample_resolve_by_name -- take the name of an object, and return the
* UUID of the object’s ACL.
*
* The address of this function is passed (via the call to
* server_acl_mgr_setup()) to the dce_acl_register_object_type() call. So
* it gets implicitly called anytime someone tries to retrieve the ACL of
* an object managed by the ACL manager we’ve set up.
*
* Basically, the most a server needs is one resolve-by-name routine and
* one resolve-by-UUID routine; the former gets you the desired object’s
* UUID; and the latter then will get you the object data itself (the way
* this works can be seen in the body of this routine below). In most
* cases, these routines will share the same name and UUID databases; if
* they don’t, the resolver_arg can be used to point to the correct other
* database. Typically, the only difference between the managers is that
* they use different print strings.
*
* For the official statement of the signature of a dce_acl_resolve_func_t,
* see the dce_acl_resolve_by_uuid() manpage; that routine has the same
* type.
*
* NOTE that all this routine really has to do is look up the object
* UUID, get the ACL UUID from the object header, then extract the
* ACL and check its manager type with the manager_type passed, and,
* if the manager types match, return the ACL UUID; otherwise, return
* an error. Everything else is superfluous, though (perhaps) inter-
* esting.
*
*******/
124246 Tandem Computers Incorporated A 61