OSF DCE Application Development Guide--Introduction and Style Guide

Security
3.4.3.13 ACL Manager Coding Example
The following subsections contain extracts from the DCE sample application which is
reprinted in full in Appendix A. The subsections below contain only the ACL manager
code portions of the server application.
In order to save space and to improve the readability of the text, the code shown below
has been slightly edited: all status checks, and all calls to the DCE serviceability
interface (to print or log status or informational messages), have been removed.
3.4.3.14 Data Definitions
The following code consists of all ACL manager-related data and other definitions for
the sample server application.
#define mgmt_perm_inq_if sec_acl_perm_unused_00000080
#define mgmt_perm_inq_pname sec_acl_perm_unused_00000100
#define mgmt_perm_inq_stats sec_acl_perm_unused_00000200
#define mgmt_perm_ping sec_acl_perm_unused_00000400
#define mgmt_perm_kill sec_acl_perm_unused_00000800
/* The constants below come from aclbase.h (aclbase.idl)... */
#define OBJ_OWNER_PERMS sec_acl_perm_read | sec_acl_perm_write \
| sec_acl_perm_delete | sec_acl_perm_test \
| sec_acl_perm_control | sec_acl_perm_execute
#define ALL_MGMT_PERMS mgmt_perm_inq_if | mgmt_perm_inq_pname \
| mgmt_perm_inq_stats | mgmt_perm_ping \
| mgmt_perm_kill | sec_acl_perm_test \
| sec_acl_perm_control
/* These two UUIDs could be treated as "well known": that is applications */
/* that use the same ACL manager for mgmt operations can use these... */
uuid_t mgmt_acl_mgr_uuid = {/* 0060f928-bbf3-1d35-8d7d-0000c0d4de56 */
0x0060f928, 0xbbf3, 0x1d35, 0x8d, 0x7d, 0x00, 0x00, 0xc0, 0xd4, 0xde, 0x56
};
uuid_t mgmt_object_uuid = {/* 00573b0e-bcc2-1d35-a73e-0000c0d4de56 */
0x00573b0e, 0xbcc2, 0x1d35, 0xa7, 0xe3, 0x00, 0x00, 0xc0, 0xd4, 0xde, 0x56
};
/* These UUIDs are specific to this server... */
/* Some ACL UUIDs that will be globally used: */
uuid_t mgmt_acl_uuid;
uuid_t sample_acl_uuid;
/* The UUID of the sample ACL manager: */
uuid_t sample_acl_mgr_uuid={/* 001a15a9-3382-1d23-a16a-0000c0d4de56 */
124246 Tandem Computers Incorporated 3 31