2 * Copyright 1985, 1986, 1987, 1988 by the Massachusetts Institute of Technology.
3 * For copying and distribution information, please see the file <mit-copyright.h>.
16 * Specialized version of the kerberos krb_get_lrealm function.
17 * krb_get_lrealm takes a pointer to a string, and a number, n. It fills
18 * in the string, r, with the name of the nth realm specified on the
19 * first line of the kerberos config file (KRB_CONF, defined in "krb.h").
20 * It returns 0 (KSUCCESS) on success, and KFAILURE on failure.
22 * On the kerberos version if the config file does not exist, and if n=1, a
23 * successful return will occur with r = KRB_REALM (also defined in "krb.h").
30 afs_krb_get_lrealm(char *r, int n)
32 FILE *cnffile, *fopen();
35 return (KFAILURE); /* Temporary restriction */
37 if ((cnffile = fopen(AFSDIR_SERVER_KCONF_FILEPATH, "r")) == NULL) {
40 if (fscanf(cnffile, "%s", r) != 1) {
41 (void)fclose(cnffile);
44 (void)fclose(cnffile);