OSF DCE Application Development Guide--Introduction and Style Guide
OSF DCE Application Development Guide—Introduction and Style Guide
/* Now register for the regular ACL... */
dce_acl_register_object_type(
*db_acl, /* Backing store where ACLs are to be stored. */
&sample_acl_mgr_uuid, /* Hard-coded at the top of this */
/* file. */
sizeof sample_printstr/sizeof sample_printstr[0], /* Number */
/* of items in our printstring array. */
sample_printstr, /* An array of sec_acl_printstring_t */
/* structures containing the printable rep- */
/* resentation of each specified permis- */
/* sion set. */
&sample_info, /* A single sec_acl_printstring_t contain- */
/* ing the name and short description for */
/* the manager we’re registering. */
sec_acl_perm_control, /* Permission set needed to change an */
/* ACL. */
sec_acl_perm_test, /* The permission you need to test an */
/* ACL maintained by this manager. */
resolver, /* Application server function that gives */
/* the ACL UUID for a given object, when */
/* presented with that object’s name; for */
/* us it’s the sample_resolve_by_name() */
/* routine, below. */
NULL, /* Argument to pass to resolver routine; */
/* identified as the "resolver_arg" in the */
/* code to that function below. */
0, /* Flags -- none here. */
status);
/* If we’re initializing, then we have to create all this stuff... */
if (need_init)
{
dce_svc_printf(NO_ACL_DBS_MSG);
/* Create the mgmt interface ACL... */
server_create_acl(
mgmt_acl_mgr_uuid, /* Create mgmt manager type ACL. */
ALL_MGMT_PERMS, /* Permission set for new ACL. */
owner, /* Principal name for new entry. */
&new_acl, /* This will contain the new ACL. */
mgmt_acl_uuid, /* This will contain the ACL UUID. */
status);
/************************************************************/
/* For the management ACL we must add a default entry for */
/* the machine principal so dced can manage the server. */
/* Construct the name entry string... */
strcpy(machine_principal, "hosts/");
gethostname((char *)(machine_principal + 6), MAXHOSTNAMELEN + 1);
strcat(machine_principal, "/self");
/* Get the machine principal’s UUID... */
server_get_local_principal_id(
3 −40 Tandem Computers Incorporated 124246