xref: /freebsd/crypto/krb5/src/util/profile/profile.5 (revision 7f2fe78b9dd5f51c821d771b63d2e096f6fd49e9)
1*7f2fe78bSCy Schubert
2*7f2fe78bSCy SchubertA profile file is a generic way of storing program configuration
3*7f2fe78bSCy Schubertinformation for applications.  An application may choose to consult
4*7f2fe78bSCy Schubertmultiple configuration files; for example, a Kerberos application
5*7f2fe78bSCy Schubertmight look first in ~/.krb5rc, and then in /etc/krb5.conf.  So
6*7f2fe78bSCy Schubert/etc/krb5.conf would contain the side-wide default configuration for
7*7f2fe78bSCy SchubertKerberos, and ~/.krb5rc would contain the user's specific
8*7f2fe78bSCy Schubertconfiguration overrides.
9*7f2fe78bSCy Schubert
10*7f2fe78bSCy SchubertConfiguration information is stored in relations, which have a name
11*7f2fe78bSCy Schubertand a value.  There may be multiple relations with the same name.
12*7f2fe78bSCy SchubertRelations are always contained inside named sections.  Sections can
13*7f2fe78bSCy Schubertcontain relations and other named child sections.
14*7f2fe78bSCy Schubert
15*7f2fe78bSCy SchubertTop-level sections are defined by enclosing the section name in square
16*7f2fe78bSCy Schubertbraces.  Child sections are defined by enclosing the contents of the
17*7f2fe78bSCy Schubertchild section in curly braces.  Relations are defined by using the
18*7f2fe78bSCy Schubertformat "name = value".
19*7f2fe78bSCy Schubert
20*7f2fe78bSCy SchubertAn example profile file might look like this:
21*7f2fe78bSCy Schubert
22*7f2fe78bSCy Schubert[libdefaults]
23*7f2fe78bSCy Schubert	default_realm = ATHENA.MIT.EDU
24*7f2fe78bSCy Schubert
25*7f2fe78bSCy Schubert[realms]
26*7f2fe78bSCy Schubert	ATHENA.MIT.EDU = {
27*7f2fe78bSCy Schubert		kdc = kerberos.mit.edu
28*7f2fe78bSCy Schubert		kdc = kerberos-1.mit.edu
29*7f2fe78bSCy Schubert		kdc = kerberos-2.mit.edu
30*7f2fe78bSCy Schubert		primary_kdc = kerberos.mit.edu
31*7f2fe78bSCy Schubert		admin_server = kerberos.mit.edu
32*7f2fe78bSCy Schubert	}
33*7f2fe78bSCy Schubert	CYGNUS.COM = {
34*7f2fe78bSCy Schubert		kdc = KERBEROS-1.CYGNUS.COM
35*7f2fe78bSCy Schubert		kdc = KERBEROS.CYGNUS.COM
36*7f2fe78bSCy Schubert		admin_server = KERBEROS.MIT.EDU
37*7f2fe78bSCy Schubert	}
38*7f2fe78bSCy Schubert
39*7f2fe78bSCy SchubertIn this example, the profile file has two top-level sections,
40*7f2fe78bSCy Schubert"libdefaults" and "realms".  The libdefaults section has a single
41*7f2fe78bSCy Schubertrelation which is named "default_realm" and has the value
42*7f2fe78bSCy Schubert"ATHENA.MIT.EDU".  The realms section has two child sections,
43*7f2fe78bSCy Schubert"ATHENA.MIT.EDU" and "CYGNUS.MIT.EDU".  Each of these child has a
44*7f2fe78bSCy Schubertnumber of relations, "kdc", "admin_server", and (in the case of
45*7f2fe78bSCy Schubert"ATHENA.MIT.EDU"), "default_domain".  Note that there are multiple
46*7f2fe78bSCy Schubertrelations with the name "kdc" in both sections; if a
47*7f2fe78bSCy Schubertprofile_get_values() is called querying the "kdc" relation, both
48*7f2fe78bSCy Schubertvalues will be returned.
49*7f2fe78bSCy Schubert
50*7f2fe78bSCy SchubertSections may be marked as "final".  If they are marked as final, then
51*7f2fe78bSCy Schubertthe contents of that section override all subsequent profile files (if
52*7f2fe78bSCy Schubertthe application is searching multiple profile files for its
53*7f2fe78bSCy Schubertconfiguration information).  Normally, all of the profiles are
54*7f2fe78bSCy Schubertsearched for a matching relation, and all of the values found in all
55*7f2fe78bSCy Schubertof the various profile files will be returned.
56*7f2fe78bSCy Schubert
57*7f2fe78bSCy SchubertTop-level sections are marked as final by adding an '*' character
58*7f2fe78bSCy Schubertfollowing the closing square brace.  Child sections are marked as
59*7f2fe78bSCy Schubertfinal by adding a '*' character after the closing curly brace.  So for
60*7f2fe78bSCy Schubertexample, in this example both the "libdefaults" and "ATHENA.MIT.EDU"
61*7f2fe78bSCy Schubertsections have been marked as final:
62*7f2fe78bSCy Schubert
63*7f2fe78bSCy Schubert[libdefaults]*
64*7f2fe78bSCy Schubert	default_realm = ATHENA.MIT.EDU
65*7f2fe78bSCy Schubert
66*7f2fe78bSCy Schubert[realms]
67*7f2fe78bSCy Schubert	ATHENA.MIT.EDU = {
68*7f2fe78bSCy Schubert		kdc = kerberos.mit.edu
69*7f2fe78bSCy Schubert		primary_kdc = kerberos.mit.edu
70*7f2fe78bSCy Schubert		admin_server = kerberos.mit.edu
71*7f2fe78bSCy Schubert	}*
72*7f2fe78bSCy Schubert
73