1 .\" Copyright (c) 2003 Kungliga Tekniska Högskolan
2 .\" (Royal Institute of Technology, Stockholm, Sweden).
3 .\" All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
16 .\" 3. Neither the name of the Institute nor the names of its contributors
17 .\" may be used to endorse or promote products derived from this software
18 .\" without specific prior written permission.
20 .\" THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
21 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
24 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 .\" $Id: krb5_set_default_realm.3,v 1.2 2003/04/16 13:58:11 lha Exp $
35 .Dt KRB5_SET_DEFAULT_REALM 3
38 .Nm krb5_free_host_realm
39 .Nm krb5_get_default_realm
40 .Nm krb5_get_default_realms
41 .Nm krb5_get_host_realm
42 .Nm krb5_set_default_realm
43 .Nd default and host realm read and manipulation routines
45 Kerberos 5 Library (libkrb5, -lkrb5)
49 .Fo krb5_free_host_realm
50 .Fa "krb5_context context"
51 .Fa "krb5_realm *realmlist"
54 .Fo krb5_get_default_realm
55 .Fa "krb5_context context"
56 .Fa "krb5_realm *realm"
59 .Fo krb5_get_default_realms
60 .Fa "krb5_context context"
61 .Fa "krb5_realm **realm"
64 .Fo krb5_get_host_realm
65 .Fa "krb5_context context"
66 .Fa "const char *host"
67 .Fa "krb5_realm **realms"
70 .Fo krb5_set_default_realm
71 .Fa "krb5_context context"
72 .Fa "const char *realm"
75 .Fn krb5_free_host_realm
76 frees all memory allocated by
79 .Fn krb5_get_default_realm
80 returns the first default realm for this host.
81 The realm returned should be free with
84 .Fn krb5_get_default_realms
87 terminated list of default realms for this context.
89 .Fn krb5_get_default_realms
91 .Fn krb5_free_host_realm .
93 .Fn krb5_get_host_realm
96 terminated list of realms for
98 by looking up the information in the
106 results in the string
108 DNS is used to lookup the realm.
112 to a resolve the domain for the host a.b.c,
113 .Fn krb5_get_host_realm
116 resource record named
117 .Li _kerberos.a.b.c ,
118 and if not found, it strips off the first component and tries a again
119 (_kerberos.b.c) until it reaches the root.
121 If there is no configuration or DNS information found,
122 .Fn krb5_get_host_realm
123 assumes it can use the domain part of the
127 .Fn krb5_set_default_realm
128 sets the default realm for the
135 .Li [libdefaults]default_realm
139 If there is no such stanza in the configuration file, the
140 .Fn krb5_get_host_realm
141 function is used to form a default realm.