OSF DCE Application Development Guide--Introduction and Style Guide

A Sample Application
/* Build the full pathname string for the database... */
free(acl_path_string);
acl_path_string = malloc(MAX_ACL_PATH_SIZE);
strcpy((char *)acl_path_string, (char *)db_acl_path);
strcat((char *)acl_path_string, (char *)"/");
strncat((char *)acl_path_string, "db_name", strlen("db_name"));
dce_db_open(
(char *)acl_path_string, /* Filename of backing store. */
NULL, /* Backing store "backend type" default == hash. */
dbflags, /* Specifies index by name. */
(dce_db_convert_func_t)uu_convert, /* Serialization func- */
/* tion for name data. */
db_name, /* The returned backing store handle. */
status);
if (*status != error_status_ok)
{
print_server_error("dce_db_open()", *status);
free(acl_path_string);
return;
}
free(acl_path_string);
/********************************************************************/
/* Now register our ACL manager’s object types with the ACL */
/* library... */
/* Register for the mgmt ACL... */
DCE_SVC_DEBUG((smp_svc_handle, smp_s_server, svc_c_debug4,
"Calling dce_acl_register_object_type()"));
dce_acl_register_object_type(
*db_acl, /* Backing store where ACLs are to be stored. */
&mgmt_acl_mgr_uuid, /* Type of ACL manager: this one is */
/* for mgmt ACL operations; the UUID is defined */
/* globally at the top of this file. */
/* Why do we need this parameter? Well, the way */
/* that the ACL library keeps track of the differ- */
/* ent "sets" of ACL databases is by manager UUID. */
/* The manager UUID is what the library will use */
/* to figure out which ACL database to open and */
/* retrieve a requested ACL’s contents from. */
/* Essentially what we are doing here is setting */
/* up things so that calls to the library routine */
/* dce_acl_is_client_authorized() can be made to */
/* check our ACLs, giving only the ACL UUID and a */
/* manager UUID to get the desired result. */
124246 Tandem Computers Incorporated A 45