dce_cf_intro(3dce) — Subroutines
Name
dce_cf_intro - Introduction to the DCE configuration routines
Description
The DCE configuration routines return information based on the contents of the local DCE configuration file, which is created during the DCE cell-configuration or machine-configuration process. A configuration file is located on each DCE machine; it contains the host’s name, the primary name of the cell in which the host is located, and any aliases for that cell name.
The configuration routines can also be used to get the following additional information corollary to the host name:
•The host’s principal name
•Binding information to the host
The configuration file on machines that belong to internationalized DCE cells also contains the pathname to the code set registry object file on the host.
The security service component on each DCE machine must be able to find out, by strictly local means, its machine’s host name, the host machine’s principal name, and its cell’s name. The DCE configuration routines exist primarily to enable security components to do these things. But because this information can be useful to DCE applications as well, these routines are made available as part of the general application programming interface.
Note that host name as used throughout this section refers to the DCE host name (that is, the machine’s /.../cellname/host_directory/hostname entry in the CDS namespace), and not, for example, its Domain Name Service (DNS) host name, which could be quite different from the DCE name.
The DCE configuration routines are as follows:
dce_cf_binding_entry_from_host()
Returns the host binding entry name.
dce_cf_dced_entry_from_host()
Returns the dced entry name on a host.
dce_cf_find_name_by_key()
Returns a string tagged by key (this is a lower-level utility routine that is used by the others).
dce_cf_free_cell_aliases()
Frees a list of cell aliases for a cell.
dce_cf_get_cell_aliases()
Returns a list of cell aliases for a cell.
dce_cf_get_cell_name()
Returns the primary cell name for the local cell.
dce_cf_get_csrgy_filename()
Returns the pathname of the local code set registry object file.
dce_cf_get_host_name()
Returns the host name relative to a local cell.
dce_cf_prin_name_from_host()
Returns the host’s principal name.
dce_cf_profile_entry_from_host
Returns the host’s profile entry.
dce_cf_same_cell_name()
Indicates whether or not two cell names refer to the same cell.
Files
dcelocal/dce_cf.db
The machine’s local DCE configuration file (where dcelocal is usually something like /opt/dcelocal).
The format of the configuration file is as follows:
Each of the entries is tagged with its own identifier, which must be the first nonblank token on a line that does not begin with a # (number sign) comment character. The second token on a line is assumed to be the name associated with the tag that was detected in front of it.
For example, cellname and hostname are tags, identifying the cell name and host name, respectively, for the machine on which the configuration file is located. A sample configuration file could have the following contents, which would identify the host brazil in the osf.org cell:
cellname /.../osf.org
hostname hosts/brazil
Text characterized by the following is ignored:
•Garbage lines (lines that do not conform to the previously described format)
•Leading and trailing spaces in lines
•Additional tokens appearing on a line after the second token
The configuration file should be writable only by privileged users, and readable by all.
Output
The DCE configuration routines return names without global or cell-relative prefixes, such as the following:
host_directory/hostname
or
principalname
where host_directory is usually hosts.
However, the DCE Name Service Interface (NSI) routines require names passed to them to be expressed either in a cell-relative form or as global names. Cell-relative names have the following form:
/.:/host_directory/hostname
Global names, with the global root prefix /.../ and the cell name, have the following form:
/.../cellname/host_directory/hostname
Therefore, an application must add either the cell-relative prefix (/.:/) or correct global prefix (/.../cellname) to any name it receives from a DCE configuration routine before it passes the name to an NSI routine. (NSI routines all have names beginning with rpc_ns_.) For example, the name host_directory/hostname would become the following, if expressed in cell-relative form:
/.:/hosts/hostname
The cell-relative form of the name principalname would be
/.:/sec/principals/principalname
where hostname and principalname are the host’s name and principal name, respectively.
Related Information
Functions: dce_cf_binding_entry_from_host(3dce), dce_cf_dced_entry_from_host(3dce), dce_cf_find_name_by_key(3dce), dce_cf_free_cell_aliases(3dce), dce_cf_get_cell_aliases(3dce), dce_cf_get_cell_name(3dce), dce_cf_get_csrgy_filename(3dce), dce_cf_get_host_name(3dce), dce_cf_prin_name_from_host(3dce), dce_cf_profile_entry_from_host(3dce), dce_cf_same_cell_name(3dce).
Books: OSF DCE Application Development Guide—Core Components, OSF DCE Command Reference.