Blame src/util/profile/profile.5

Packit fd8b60
Packit fd8b60
A profile file is a generic way of storing program configuration
Packit fd8b60
information for applications.  An application may choose to consult
Packit fd8b60
multiple configuration files; for example, a Kerberos application
Packit fd8b60
might look first in ~/.krb5rc, and then in /etc/krb5.conf.  So
Packit fd8b60
/etc/krb5.conf would contain the side-wide default configuration for
Packit fd8b60
Kerberos, and ~/.krb5rc would contain the user's specific
Packit fd8b60
configuration overrides.
Packit fd8b60
Packit fd8b60
Configuration information is stored in relations, which have a name
Packit fd8b60
and a value.  There may be multiple relations with the same name.
Packit fd8b60
Relations are always contained inside named sections.  Sections can
Packit fd8b60
contain relations and other named child sections.
Packit fd8b60
Packit fd8b60
Top-level sections are defined by enclosing the section name in square
Packit fd8b60
braces.  Child sections are defined by enclosing the contents of the
Packit fd8b60
child section in curly braces.  Relations are defined by using the
Packit fd8b60
format "name = value".  
Packit fd8b60
Packit fd8b60
An example profile file might look like this:
Packit fd8b60
Packit fd8b60
[libdefaults]
Packit fd8b60
	default_realm = ATHENA.MIT.EDU
Packit fd8b60
Packit fd8b60
[realms]
Packit fd8b60
	ATHENA.MIT.EDU = {
Packit fd8b60
		kdc = kerberos.mit.edu
Packit fd8b60
		kdc = kerberos-1.mit.edu
Packit fd8b60
		kdc = kerberos-2.mit.edu
Packit fd8b60
		master_kdc = kerberos.mit.edu
Packit fd8b60
		admin_server = kerberos.mit.edu
Packit fd8b60
	}
Packit fd8b60
	CYGNUS.COM = {
Packit fd8b60
		kdc = KERBEROS-1.CYGNUS.COM
Packit fd8b60
		kdc = KERBEROS.CYGNUS.COM
Packit fd8b60
		admin_server = KERBEROS.MIT.EDU
Packit fd8b60
	}
Packit fd8b60
Packit fd8b60
In this example, the profile file has two top-level sections,
Packit fd8b60
"libdefaults" and "realms".  The libdefaults section has a single
Packit fd8b60
relation which is named "default_realm" and has the value
Packit fd8b60
"ATHENA.MIT.EDU".  The realms section has two child sections,
Packit fd8b60
"ATHENA.MIT.EDU" and "CYGNUS.MIT.EDU".  Each of these child has a
Packit fd8b60
number of relations, "kdc", "admin_server", and (in the case of
Packit fd8b60
"ATHENA.MIT.EDU"), "default_domain".  Note that there are multiple
Packit fd8b60
relations with the name "kdc" in both sections; if a
Packit fd8b60
profile_get_values() is called querying the "kdc" relation, both
Packit fd8b60
values will be returned.
Packit fd8b60
Packit fd8b60
Sections may be marked as "final".  If they are marked as final, then
Packit fd8b60
the contents of that section override all subsequent profile files (if
Packit fd8b60
the application is searching multiple profile files for its
Packit fd8b60
configuration information).  Normally, all of the profiles are
Packit fd8b60
searched for a matching relation, and all of the values found in all
Packit fd8b60
of the various profile files will be returned.  
Packit fd8b60
Packit fd8b60
Top-level sections are marked as final by adding an '*' character
Packit fd8b60
following the closing square brace.  Child sections are marked as
Packit fd8b60
final by adding a '*' character after the closing curly brace.  So for
Packit fd8b60
example, in this example both the "libdefaults" and "ATHENA.MIT.EDU"
Packit fd8b60
sections have been marked as final:
Packit fd8b60
Packit fd8b60
[libdefaults]*
Packit fd8b60
	default_realm = ATHENA.MIT.EDU
Packit fd8b60
Packit fd8b60
[realms]
Packit fd8b60
	ATHENA.MIT.EDU = {
Packit fd8b60
		kdc = kerberos.mit.edu
Packit fd8b60
		master_kdc = kerberos.mit.edu
Packit fd8b60
		admin_server = kerberos.mit.edu
Packit fd8b60
	}*
Packit fd8b60