summaryrefslogtreecommitdiffstats
path: root/src/kadmin/testing/util
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2006-05-16 01:45:00 +0000
committerKen Raeburn <raeburn@mit.edu>2006-05-16 01:45:00 +0000
commit776a9fa505e71b6277a8857a2bfd527e02667465 (patch)
tree7a8f23966b0c6fcba07d7b331106f00a98e1ff6b /src/kadmin/testing/util
parent88dcc5fb29c10da8f83ed959c32e047b40c4cce9 (diff)
downloadkrb5-776a9fa505e71b6277a8857a2bfd527e02667465.tar.gz
krb5-776a9fa505e71b6277a8857a2bfd527e02667465.tar.xz
krb5-776a9fa505e71b6277a8857a2bfd527e02667465.zip
* lib/kadm5/alt_prof.c (kadm5_get_config_params): Replace filename and
envvar arguments with a flag indicating whether KDC config data should be used. Prototype and all callers changed. (krb5_read_realm_params): Delete config file and env var arguments. Prototype and all callers changed. * lib/kadm5/admin.h (KADM5_CONFIG_PROFILE): Commented out. (struct _kadm5_config_params): Delete field PROFILE. * lib/kadm5/alt_prof.c (kadm5_get_config_params): Don't look at it. (kadm5_free_config_params): Don't free it. * kadmin/testing/tcl/util.t: Remove profile data from config params. * kadmin/testing/util/tcl_kadm5.c (config_mask_flags): Deleted KADM5_CONFIG_PROFILE entry. (parse_config_params): Changed to require 20 parameters instead of 21. * lib/kadm5/unit-test/api.2/init-v2.exp (test100): Deleted. * lib/kadm5/alt_prof.c (krb5_aprof_init): Fetch the list of config files from the library and add the caller-indicated config file to the front of the list. * lib/kadm5/clnt/client_init.c (kadm5_init_krb5_context): New function. * lib/kadm5/clnt/libkadm5clnt.exports: Export it. * lib/kadm5/srv/server_init.c: Include k5-int.h, osconf.h, gssapiP_krb5.h. (kadm5_init_krb5_context): New function. * lib/kadm5/srv/libkadm5srv.exports: Export it. * lib/kadm5/srv/Makefile.in (LOCAL_INCLUDES): Add gssapi directories. * lib/kadm5/admin.h (kadm5_init_krb5_context): Declare it. * kadmin/dbutil/kdb5_destroy.c (kdb5_destroy): Call kadm5_init_krb5_context instead of krb5_init_context. * kadmin/dbutil/dump.c (load_db): Likewise. * kadmin/dbutil/kdb5_util.c (main): Likewise. * kadmin/dbutil/kadm5_create.c (kadm5_create): Likewise. * kadmin/dbutil/kdb5_stash.c (kdb5_stash): Likewise. * kadmin/dbutil/loadv4.c (load_v4db): Likewise. * kadmin/server/ovsec_kadmd.c (main): Likewise. * kadmin/cli/kadmin.c (kadmin_startup): Likewise. * kadmin/testing/util/tcl_ovsec_kadm.c (tcl_ovsec_kadm_init): Likewise. * lib/kadm5/unit-test/lock-test.c (main): Likewise. * lib/kadm5/unit-test/handle-test.c (main): Likewise. * lib/kadm5/unit-test/randkey-test.c (main): Likewise. * lib/kadm5/unit-test/setkey-test.c (main): Likewise. * lib/kadm5/chpass_util.c (_kadm5_chpass_principal_util): Likewise. * lib/kadm5/kadm_rpc_xdr.c (xdr_krb5_principal): Likewise. * lib/krb5/os/init_os_ctx.c (add_kdc_config_file): New function. (os_init_paths): Add new argument KDC; call add_kdc_config_file if true. * lib/krb5/krb/init_ctx.c (krb5int_init_context_kdc): New function. (init_common): Add new argument KDC, passed to krb5_os_init_context. * lib/krb5/libkrb5.exports: Export krb5int_init_context_kdc. * k5-int.h (krb5_os_init_context): Update decl. * lib/kadm5/srv/server_init.c (kadm5_init): Call krb5int_init_context_kdc. * krb524/krb524d.c (main): Likewise. * lib/kadm5/unit-test/api.2/init-v2.exp: Don't run test 154 for error for $KRB5_KDC_PROFILE file not present. * lib/krb5/os/init_os_ctx.c (os_get_default_config_files): Rewrite KLL test so as not to confuse Emacs indentation support. * lib/gssapi/krb5/init_sec_context.c (kg_kdc_flag_mutex, kdc_flag): New variables. (krb5_gss_init_context, krb5_gss_use_kdc_context): New functions. * lib/gssapi/krb5/gssapiP_krb5.h (kg_kdc_flag_mutex): Declare. (krb5_gss_init_context, krb5_gss_use_kdc_context): Declare. (krb5_init_context): Define as macro to invoke krb5_gss_init_context for now. * lib/gssapi/gss_libinit.c (gssint_lib_init): Initialize the mutex. (gssint_lib_fini): Destroy it. * lib/gssapi/libgssapi_krb5.exports: Export krb5_gss_use_kdc_context. * lib/kadm5/srv/server_init.c (kadm5_init): Don't complain if the config files specify an admin server, since we now look at krb5.conf as well. * lib/kadm5/unit-test/api.2/init-v2.exp: Delete test test114 for bad server params. * plugins/kdb/db2/adb_openclose.c (osa_adb_init_db): Use krb5int_init_context_kdc instead of krb5_init_context. * kdc/rtest.c (main): Likewise. * kdc/fakeka.c (main): Likewise. * kdc/main.c (main, init_realm): Likewise. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18009 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/kadmin/testing/util')
-rw-r--r--src/kadmin/testing/util/tcl_kadm5.c48
-rw-r--r--src/kadmin/testing/util/tcl_ovsec_kadm.c2
2 files changed, 22 insertions, 28 deletions
diff --git a/src/kadmin/testing/util/tcl_kadm5.c b/src/kadmin/testing/util/tcl_kadm5.c
index e177d7b7d..fb6466db2 100644
--- a/src/kadmin/testing/util/tcl_kadm5.c
+++ b/src/kadmin/testing/util/tcl_kadm5.c
@@ -87,7 +87,6 @@ static struct flagval config_mask_flags[] = {
{"KADM5_CONFIG_ENCTYPE", KADM5_CONFIG_ENCTYPE},
{"KADM5_CONFIG_ADBNAME", KADM5_CONFIG_ADBNAME},
{"KADM5_CONFIG_ADB_LOCKFILE", KADM5_CONFIG_ADB_LOCKFILE},
- {"KADM5_CONFIG_PROFILE", KADM5_CONFIG_PROFILE},
{"KADM5_CONFIG_ACL_FILE", KADM5_CONFIG_ACL_FILE},
{"KADM5_CONFIG_KADMIND_PORT", KADM5_CONFIG_KADMIND_PORT},
{"KADM5_CONFIG_ENCTYPES", KADM5_CONFIG_ENCTYPES},
@@ -994,9 +993,9 @@ static int parse_config_params(Tcl_Interp *interp, char *list,
return retcode;
}
- if (argc != 21) {
+ if (argc != 20) {
sprintf(interp->result,
- "wrong # args in config params structure (%d should be 21)",
+ "wrong # args in config params structure (%d should be 20)",
argc);
retcode = TCL_ERROR;
goto finished;
@@ -1015,114 +1014,109 @@ static int parse_config_params(Tcl_Interp *interp, char *list,
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[2], &params->profile)) != TCL_OK) {
- Tcl_AppendElement(interp, "while parsing profile name");
- retcode = TCL_ERROR;
- goto finished;
- }
- if ((retcode = Tcl_GetInt(interp, argv[3], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[2], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing kadmind_port");
retcode = TCL_ERROR;
goto finished;
}
params->kadmind_port = tmp;
- if ((retcode = parse_str(interp, argv[4], &params->admin_server))
+ if ((retcode = parse_str(interp, argv[3], &params->admin_server))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing profile name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[5], &params->dbname)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[4], &params->dbname)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing profile name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[6], &params->admin_dbname)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[5], &params->admin_dbname)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing admin_dbname name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[7], &params->admin_lockfile)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[6], &params->admin_lockfile)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing admin_lockfile name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[8], &params->admin_keytab)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[7], &params->admin_keytab)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing admin_keytab name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[9], &params->acl_file)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[8], &params->acl_file)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing acl_file name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[10], &params->dict_file)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[9], &params->dict_file)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing dict_file name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = Tcl_GetInt(interp, argv[11], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[10], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing mkey_from_kbd");
retcode = TCL_ERROR;
goto finished;
}
params->mkey_from_kbd = tmp;
- if ((retcode = parse_str(interp, argv[12], &params->stash_file)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[11], &params->stash_file)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing stash_file name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = parse_str(interp, argv[13], &params->mkey_name)) != TCL_OK) {
+ if ((retcode = parse_str(interp, argv[12], &params->mkey_name)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing mkey_name name");
retcode = TCL_ERROR;
goto finished;
}
- if ((retcode = Tcl_GetInt(interp, argv[14], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[13], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing enctype");
retcode = TCL_ERROR;
goto finished;
}
params->enctype = tmp;
- if ((retcode = Tcl_GetInt(interp, argv[15], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[14], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing max_life");
retcode = TCL_ERROR;
goto finished;
}
params->max_life = tmp;
- if ((retcode = Tcl_GetInt(interp, argv[16], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[15], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing max_rlife");
retcode = TCL_ERROR;
goto finished;
}
params->max_rlife = tmp;
- if ((retcode = Tcl_GetInt(interp, argv[17], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[16], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing expiration");
retcode = TCL_ERROR;
goto finished;
}
params->expiration = tmp;
- if ((retcode = parse_krb5_flags(interp, argv[18], &tmp))
+ if ((retcode = parse_krb5_flags(interp, argv[17], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing flags");
retcode = TCL_ERROR;
goto finished;
}
params->flags = tmp;
- if ((retcode = Tcl_GetInt(interp, argv[19], &tmp))
+ if ((retcode = Tcl_GetInt(interp, argv[18], &tmp))
!= TCL_OK) {
Tcl_AppendElement(interp, "while parsing num_keysalts");
retcode = TCL_ERROR;
goto finished;
}
params->num_keysalts = tmp;
- if ((retcode = parse_keysalts(interp, argv[20], &params->keysalts,
+ if ((retcode = parse_keysalts(interp, argv[19], &params->keysalts,
params->num_keysalts)) != TCL_OK) {
Tcl_AppendElement(interp, "while parsing keysalts");
retcode = TCL_ERROR;
@@ -1578,7 +1572,7 @@ static int _tcl_kadm5_init_any(enum init_type init_type, ClientData clientData,
argv++, argc--;
- krb5_init_context(&context);
+ kadm5_init_krb5_context(&context);
if (argc != 7) {
Tcl_AppendResult(interp, whoami, ": ", arg_error, 0);
diff --git a/src/kadmin/testing/util/tcl_ovsec_kadm.c b/src/kadmin/testing/util/tcl_ovsec_kadm.c
index c64657d75..7e04f04e9 100644
--- a/src/kadmin/testing/util/tcl_ovsec_kadm.c
+++ b/src/kadmin/testing/util/tcl_ovsec_kadm.c
@@ -1018,7 +1018,7 @@ static int tcl_ovsec_kadm_init(ClientData clientData, Tcl_Interp *interp,
argv++, argc--;
- krb5_init_context(&context);
+ kadm5_init_krb5_context(&context);
if (argc != 7) {
Tcl_AppendResult(interp, whoami, ": ", arg_error, 0);