Add context to all krb5_config_*get_*.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4263 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-01-03 21:25:07 +00:00
parent ad6c0a43d5
commit 312a29e401
7 changed files with 32 additions and 22 deletions

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -169,7 +169,11 @@ main(int argc, char **argv)
config_file = HDB_DB_DIR "/kdc.conf"; config_file = HDB_DB_DIR "/kdc.conf";
if(krb5_config_parse_file(config_file, &cf) == 0) { if(krb5_config_parse_file(config_file, &cf) == 0) {
const char *p = krb5_config_get_string (cf, "kdc", "key-file", NULL); const char *p = krb5_config_get_string (context,
cf,
"kdc",
"key-file",
NULL);
if (p) if (p)
keyfile = strdup(p); keyfile = strdup(p);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -169,7 +169,8 @@ main(int argc, char **argv)
config_file = HDB_DB_DIR "/kdc.conf"; config_file = HDB_DB_DIR "/kdc.conf";
if(krb5_config_parse_file(config_file, &cf) == 0) { if(krb5_config_parse_file(config_file, &cf) == 0) {
const char *p = krb5_config_get_string (cf, "kdc", "key-file", NULL); const char *p = krb5_config_get_string (context, cf,
"kdc", "key-file", NULL);
if (p) if (p)
keyfile = strdup(p); keyfile = strdup(p);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -177,7 +177,8 @@ main(int argc, char **argv)
config_file = HDB_DB_DIR "/kdc.conf"; config_file = HDB_DB_DIR "/kdc.conf";
if(krb5_config_parse_file(config_file, &cf) == 0) { if(krb5_config_parse_file(config_file, &cf) == 0) {
const char *p = krb5_config_get_string (cf, "kdc", "key-file", NULL); const char *p = krb5_config_get_string (context, cf,
"kdc", "key-file", NULL);
if (p) if (p)
keyfile = strdup(p); keyfile = strdup(p);
} }

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -143,7 +143,7 @@ configure(int argc, char **argv)
goto end; goto end;
if(keyfile == NULL){ if(keyfile == NULL){
p = krb5_config_get_string (cf, p = krb5_config_get_string (context, cf,
"kdc", "kdc",
"key-file", "key-file",
NULL); NULL);
@@ -152,7 +152,7 @@ configure(int argc, char **argv)
} }
if(database == NULL){ if(database == NULL){
p = krb5_config_get_string (cf, "kdc", "database", NULL); p = krb5_config_get_string (context, cf, "kdc", "database", NULL);
if(p) database = strdup(p); if(p) database = strdup(p);
} }
@@ -161,7 +161,8 @@ configure(int argc, char **argv)
} }
if(max_request == 0){ if(max_request == 0){
p = krb5_config_get_string (cf, p = krb5_config_get_string (context,
cf,
"kdc", "kdc",
"max-request", "max-request",
NULL); NULL);
@@ -170,18 +171,19 @@ configure(int argc, char **argv)
} }
if(require_preauth == -1) if(require_preauth == -1)
require_preauth = krb5_config_get_bool(cf, "kdc", require_preauth = krb5_config_get_bool(context, cf, "kdc",
"require-preauth", NULL); "require-preauth", NULL);
if(port_str == NULL){ if(port_str == NULL){
p = krb5_config_get_string(cf, "kdc", "ports", NULL); p = krb5_config_get_string(context, cf, "kdc", "ports", NULL);
port_str = (char*)p; port_str = (char*)p;
} }
if(enable_http == -1) if(enable_http == -1)
enable_http = krb5_config_get_bool(cf, "kdc", "enable-http", NULL); enable_http = krb5_config_get_bool(context, cf, "kdc",
"enable-http", NULL);
#ifdef KRB4 #ifdef KRB4
if(v4_realm == NULL){ if(v4_realm == NULL){
p = krb5_config_get_string (cf, p = krb5_config_get_string (context, cf,
"kdc", "kdc",
"v4-realm", "v4-realm",
NULL); NULL);
@@ -190,7 +192,7 @@ configure(int argc, char **argv)
} }
#endif #endif
kdc_warn_pwexpire = krb5_config_get_time (cf, kdc_warn_pwexpire = krb5_config_get_time (context, cf,
"kdc", "kdc",
"kdc_warn_pwexpire", "kdc_warn_pwexpire",
NULL); NULL);

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -1045,7 +1045,8 @@ is_krbtgt(PrincipalName *p)
static Realm static Realm
find_rpath(Realm r) find_rpath(Realm r)
{ {
const char *new_realm = krb5_config_get_string(context->cf, const char *new_realm = krb5_config_get_string(context,
NULL,
"libdefaults", "libdefaults",
"capath", "capath",
r, r,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -47,16 +47,17 @@ kdc_openlog(krb5_config_section *cf)
char **s = NULL, **p; char **s = NULL, **p;
krb5_initlog(context, "kdc", &logf); krb5_initlog(context, "kdc", &logf);
if(cf) if(cf)
s = krb5_config_get_strings(cf, "kdc", "logging", NULL); s = krb5_config_get_strings(context, cf, "kdc", "logging", NULL);
if(s == NULL) if(s == NULL)
s = krb5_config_get_strings(context->cf, "logging", "kdc", NULL); s = krb5_config_get_strings(context, NULL, "logging", "kdc", NULL);
if(s){ if(s){
for(p = s; *p; p++) for(p = s; *p; p++)
krb5_addlog_dest(context, logf, *p); krb5_addlog_dest(context, logf, *p);
krb5_config_free_strings(s); krb5_config_free_strings(s);
}else }else
krb5_addlog_dest(context, logf, "0-1/FILE:" HDB_DB_DIR "/kdc.log"); krb5_addlog_dest(context, logf, "0-1/FILE:" HDB_DB_DIR "/kdc.log");
krb5_set_warn_dest(context, logf);
} }
char* char*

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 1997 Kungliga Tekniska H<>gskolan * Copyright (c) 1997, 1998 Kungliga Tekniska H<>gskolan
* (Royal Institute of Technology, Stockholm, Sweden). * (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved. * All rights reserved.
* *
@@ -332,7 +332,7 @@ change (krb5_auth_context auth_context,
} }
ent.modified_by = e; ent.modified_by = e;
if (ent.pw_end){ if (ent.pw_end){
int t = krb5_config_get_time(context->cf, int t = krb5_config_get_time(context, NULL,
"libdefaults", "libdefaults",
"pw_expiration", NULL); "pw_expiration", NULL);
if(t > 0) if(t > 0)