OSF DCE Application Development Guide--Core Components
The Access Control List APIs
The next example shows dce_acl_resolve_by_name().
A server uses the residual name to resolve an ACL object by using
dce_acl_resolve_by_name( ). This routine requires a DCE database that maps names
into ACL UUIDs. This backing store database must be maintained by the server
application so that created objects always get a name, and that name must be a key into a
database that stores the UUID identifying the object. The resolver_arg parameter given
in the dce_acl_register_object_type() call must be a handle for that database.
#define STAT_CHECK_RET(st) { if (st != error_status_ok) return; }
dce_acl_resolve_func_t
dce_acl_resolve_by_name(
/* in */
handle_t h,
sec_acl_component_name_t component_name,
sec_acl_type_t sec_acl_type,
uuid_t *manager_type,
boolean32 writing,
void *resolver_arg,
/* out */
uuid_t *acl_uuid,
error_status_t *st
)
{
dce_db_handle_t db_h;
dce_db_header_t dbh;
/* Get object header using the object backing store.
* The handle was passed in as the resolver_arg in the
* dce_acl_register_object_type call.
*/
db_h = (dce_db_handle_t)resolver_arg;
dce_db_std_header_fetch(db_h, component_name, &dbh, st);
STAT_CHECK_RET(*st);
/* Get the appropriate ACL based on the ACL type. */
dce_acl_inq_acl_from_header(dbh, sec_acl_type, acl_uuid, st);
STAT_CHECK_RET(*st);
}
124245 Tandem Computers Incorporated 31− 13