OSF DCE Application Development Guide--Introduction and Style Guide

Security
/* == TRUE from main(). */
/* [out] parameters: */
dce_db_handle_t *db_acl, /* ACL-indexed store handle. */
dce_db_handle_t *db_object, /* Object-indexed store handle. */
dce_db_handle_t *db_name, /* Name-indexed store handle. */
uuid_t *object_acl_uuid, /* Object ACL UUID. */
uuid_t *mgmt_acl_uuid, /* Mgmt ACL UUID. */
unsigned32 *status)
{
sec_acl_t new_acl;
uuid_t machine_princ_id;
unsigned_char_t machine_principal[MAXHOSTNAMELEN + 20];
unsigned_char_t *uuid_string;
boolean32 need_init;
unsigned32 dbflags;
static sample_data_t datahdr;
unsigned_char_t *acl_path_string;
sec_acl_permset_t permset = (sec_acl_permset_t) 0;
*status = error_status_ok;
bzero(&datahdr, sizeof datahdr);
uuid_create_nil(object_acl_uuid, status);
need_init = 0;
/* Build the full pathname string for the db_acl database... */
acl_path_string = malloc(MAX_ACL_PATH_SIZE);
strcpy(acl_path_string, db_acl_path);
strcat(acl_path_string, (unsigned_char_t *)"/");
strncat(acl_path_string, "db_acl", strlen("db_acl"));
/* If the thing doesn’t exist yet, then we need to do some init- */
/* ialization... */
if (access((char *)acl_path_string, R_OK) != 0)
if (errno == ENOENT)
need_init = 1;
/********************************************************************/
/* Create the indexed-by-UUID databases. There are two of these: */
/* One for the ACL UUID-indexed store, and */
/* One for the Object UUID-indexed store... */
dbflags = db_c_index_by_uuid;
if (need_init)
dbflags |= db_c_create;
/* Open (or create) the "db_acl" ACL UUID-indexed backing store... */
dce_db_open(
(char *)acl_path_string, /* Filename of backing store. */
NULL, /* Backing store "backend type" default == hash. */
dbflags, /* We already specified index by UUID for this. */
(dce_db_convert_func_t)dce_rdacl_convert, /* Serialization */
/* function (generated by IDL). */
124246 Tandem Computers Incorporated 3 37