OSF DCE Application Development Guide--Introduction and Style Guide
Security
3.4.3.23 The sample_resolve_by_name Routine
The sample_resolve_by_name( ) routine derives the ACL UUID of an object from its
name.
/******
*
* 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() reference page; that routine has the same
* type.
*
*
*******/
dce_acl_resolve_func_t sample_resolve_by_name(
handle_t h, /* Client binding handle passed into the */
/* server stub. sec_acl_bind() is used to */
/* create this handle. */
sec_acl_component_name_t name, /* The object whose ACL’s UUID we want. */
sec_acl_type_t sec_acl_type, /* The type of ACL whose UUID we want. */
uuid_t *manager_type, /* The object’s manager type. */
/* NOTE that this parameter isn’t used be- */
/* low. */
boolean32 writing, /* "This parameter is ignored in OSF’s im- */
/* plementation" (from the reference page */
/* for dce_acl_resolve_by_uuid()). */
void *resolver_arg, /* This is the app-defined argument passed */
/* to dce_acl_register_object_type(); it */
/* should be a handle for a backing store */
/* indexed by UUID. Note that it isn’t */
/* used here though. */
uuid_t *acl_uuid, /* To return ACL’s UUID in. */
error_status_t *st /* To return status in. */
)
124246 Tandem Computers Incorporated 3− 47