Deleted Added
sdiff udiff text old ( 78527 ) new ( 90926 )
full compact
1/*
2 * Copyright (c) 1997-2002 Kungliga Tekniska H�gskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 *
10 * 1. Redistributions of source code must retain the above copyright

--- 19 unchanged lines hidden (view full) ---

30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 */
33
34#include "kdc_locl.h"
35#include <getarg.h>
36#include <parse_bytes.h>
37
38RCSID("$Id: config.c,v 1.39 2002/02/04 10:53:48 joda Exp $");
39
40static char *config_file; /* location of kdc config file */
41
42int require_preauth = -1; /* 1 == require preauth for all principals */
43
44size_t max_request; /* maximal size of a request */
45
46static char *max_request_str; /* `max_request' as a string */

--- 15 unchanged lines hidden (view full) ---

62
63static struct getarg_strings addresses_str; /* addresses to listen on */
64krb5_addresses explicit_addresses;
65
66#ifdef KRB4
67char *v4_realm;
68int enable_v4 = -1;
69int enable_524 = -1;
70int enable_kaserver = -1;
71#endif
72
73static int help_flag;
74static int version_flag;
75
76static struct getargs args[] = {
77 {
78 "config-file", 'c', arg_string, &config_file,
79 "location of config file", "file"

--- 19 unchanged lines hidden (view full) ---

99 },
100 { "524", 0, arg_negative_flag, &enable_524,
101 "don't respond to 524 requests"
102 },
103 {
104 "v4-realm", 'r', arg_string, &v4_realm,
105 "realm to serve v4-requests for"
106 },
107 {
108 "kaserver", 'K', arg_flag, &enable_kaserver,
109 "enable kaserver support"
110 },
111#endif
112 { "ports", 'P', arg_string, &port_str,
113 "ports to listen to", "portspec"
114 },
115 { "addresses", 0, arg_strings, &addresses_str,
116 "addresses to listen on", "list of addresses" },
117 { "help", 'h', arg_flag, &help_flag },
118 { "version", 'v', arg_flag, &version_flag }
119};
120
121static int num_args = sizeof(args) / sizeof(args[0]);

--- 54 unchanged lines hidden (view full) ---

176 }
177 p = krb5_config_get_string(context, default_binding, "mkey_file", NULL);
178 if(p) {
179 di->mkey_file = strdup(p);
180 default_mkey = p;
181 }
182 *dt = di;
183 dt = &di->next;
184 } else if(databases == NULL) {
185 /* if there are none specified, use some default */
186 di = calloc(1, sizeof(*di));
187 di->dbname = strdup(default_dbname);
188 di->mkey_file = strdup(default_mkey);
189 *dt = di;
190 dt = &di->next;
191 }
192 for(di = databases; di; di = di->next) {
193 if(di->dbname == NULL)
194 di->dbname = strdup(default_dbname);
195 if(di->mkey_file == NULL) {
196 p = strrchr(di->dbname, '.');
197 if(p == NULL || strchr(p, '/') != NULL)
198 /* final pathname component does not contain a . */
199 asprintf(&di->mkey_file, "%s.mkey", di->dbname);
200 else
201 /* the filename is something.else, replace .else with
202 .mkey */
203 asprintf(&di->mkey_file, "%.*s.mkey",
204 (int)(p - di->dbname), di->dbname);
205 }
206 }
207}
208
209static void
210add_one_address (const char *str, int first)

--- 113 unchanged lines hidden (view full) ---

324 if(v4_realm == NULL){
325 p = krb5_config_get_string (context, cf,
326 "kdc",
327 "v4-realm",
328 NULL);
329 if(p)
330 v4_realm = strdup(p);
331 }
332 if (enable_kaserver == -1)
333 enable_kaserver = krb5_config_get_bool_default(context, cf, FALSE,
334 "kdc",
335 "enable-kaserver",
336 NULL);
337#endif
338
339 encode_as_rep_as_tgs_rep = krb5_config_get_bool(context, cf, "kdc",
340 "encode_as_rep_as_tgs_rep",
341 NULL);

--- 21 unchanged lines hidden ---