1 .\" $Id: krb_realmofhost.3,v 1.2 1996/06/12 21:29:23 bg Exp $
2 .\" $FreeBSD: src/crypto/kerberosIV/man/krb_realmofhost.3,v 1.2 2000/02/24 20:21:15 markm Exp $
3 .\" Copyright 1989 by the Massachusetts Institute of Technology.
5 .\" For copying and distribution information,
6 .\" please see the file <mit-copyright.h>.
8 .TH KRB_REALMOFHOST 3 "Kerberos Version 4.0" "MIT Project Athena"
10 krb_realmofhost, krb_get_phost, krb_get_krbhst, krb_get_admhst,
11 krb_get_lrealm \- additional Kerberos utility routines
17 #include <openssl/des.h>
18 #include <netinet/in.h>
21 char *krb_realmofhost(host)
25 char *krb_get_phost(alias)
29 krb_get_krbhst(host,realm,n)
35 krb_get_admhst(host,realm,n)
41 krb_get_lrealm(realm,n)
48 returns the Kerberos realm of the host
50 as determined by the translation table
53 should be the fully-qualified domain-style primary host name of the host
54 in question. In order to prevent certain security attacks, this routine
57 knowledge of a host's realm, or obtain such information securely.
59 The format of the translation file is described by
63 exactly matches a host_name line, the corresponding realm
65 Otherwise, if the domain portion of
67 matches a domain_name line, the corresponding realm
71 contains a domain, but no translation is found,
73 domain is converted to upper-case and returned.
76 contains no discernable domain, or an error occurs,
77 the local realm name, as supplied by
78 .IR krb_get_lrealm (3),
84 (which can be either an official name or an alias) into the instance
85 name to be used in obtaining Kerberos tickets for most services,
86 including the Berkeley rcmd suite (rlogin, rcp, rsh).
88 The current convention is to return the first segment of the official
89 domain-style name after conversion to lower case.
94 with the hostname of the
96 host running a Kerberos key distribution center (KDC)
99 as specified in the configuration file (\fI/etc/krb.conf\fR).
100 The configuration file is described by
102 If the host is successfully filled in, the routine
104 If the file cannot be opened, and
106 equals 1, then the value of KRB_HOST as defined in
108 is filled in, and KSUCCESS is returned. If there are fewer than
110 hosts running a Kerberos KDC for the requested realm, or the
111 configuration file is malformed, the routine
117 with the hostname of the
119 host running a Kerberos KDC database administration server
122 as specified in the configuration file (\fI/etc/krb.conf\fR).
123 If the file cannot be opened or is malformed, or there are fewer than
125 hosts running a Kerberos KDC database administration server,
126 the routine returns KFAILURE.
128 The character arrays used as return values for
131 should be large enough to
132 hold any hostname (MAXHOSTNAMELEN from <sys/param.h>).
139 realm of the local host, as specified in the configuration file.
141 should be at least REALM_SZ (from
142 .IR <krb.h>) characters long.
145 kerberos(3), krb.conf(5), krb.realms(5)
149 translation file for host-to-realm mapping.
152 local realm-name and realm/server configuration file.
154 The current convention for instance names is too limited; the full
155 domain name should be used.
158 currently only supports
160 = 1. It should really consult the user's ticket cache to determine the
161 user's current realm, rather than consulting a file on the host.