From 86c8042d9dac0b30cd6244d75eaaefaed222efe0 Mon Sep 17 00:00:00 2001 From: Barry Jaspan Date: Thu, 26 Sep 1996 21:46:40 +0000 Subject: [PATCH] * api.0/init.exp, api.1/lock.exp, api.2/init.exp: use $K5ROOT instead of /krb5 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9120 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/kadm5/ChangeLog | 5 +++ src/lib/kadm5/alt_prof.c | 52 ++------------------------ src/lib/kadm5/unit-test/api.0/init.exp | 5 ++- src/lib/kadm5/unit-test/api.1/lock.exp | 2 +- src/lib/kadm5/unit-test/api.2/init.exp | 5 ++- 5 files changed, 15 insertions(+), 54 deletions(-) diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog index 28bc24f3b..411bc75f6 100644 --- a/src/lib/kadm5/ChangeLog +++ b/src/lib/kadm5/ChangeLog @@ -1,3 +1,8 @@ +Thu Sep 26 17:45:18 1996 Barry Jaspan + + * alt_prof.c: don't allow admin_dbname or admin_lockfile to be + independetly configured + Fri Sep 20 16:52:07 1996 Barry Jaspan * configure.in: add unit-test directory diff --git a/src/lib/kadm5/alt_prof.c b/src/lib/kadm5/alt_prof.c index 71b259786..374e22706 100644 --- a/src/lib/kadm5/alt_prof.c +++ b/src/lib/kadm5/alt_prof.c @@ -364,35 +364,9 @@ krb5_error_code kadm5_get_config_params(context, kdcprofile, kdcenv, } /* - * Get the value for the admin (policy) database and lockfile. - * The logic here is slightly tricky. DBNAME, ADBNAME, and - * ADB_LOCKFILE are dependent on the earlier items in the - * sequence. If an earlier item was specified via the input - * parameters, that value overrides the variables in the config - * file and causes the later item to be set to ".kadm5" or - * ".lock", respectively. However, if no earlier item was - * specified, the variables in the config file are used, and the - * ".kadm5" and ".lock" suffixes are only added as a no-variable - * default. - * - * Read the spec. + * admin database name and lockfile are now always derived from dbname */ - hierarchy[2] = "admin_database_name"; - if (params_in->mask & KADM5_CONFIG_ADBNAME) { - params.admin_dbname = strdup(params_in->admin_dbname); - if (params.admin_dbname) - params.mask |= KADM5_CONFIG_ADBNAME; - } else if (params_in->mask & KADM5_CONFIG_DBNAME) { - params.admin_dbname = (char *) malloc(strlen(params.dbname) + 7); - if (params.admin_dbname) { - sprintf(params.admin_dbname, "%s.kadm5", params.dbname); - params.mask |= KADM5_CONFIG_ADBNAME; - } - } else if (aprofile && - !krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { - params.admin_dbname = svalue; - params.mask |= KADM5_CONFIG_ADBNAME; - } else if (params.mask & KADM5_CONFIG_DBNAME) { + if (params.mask & KADM5_CONFIG_DBNAME) { params.admin_dbname = (char *) malloc(strlen(params.dbname) + 7); if (params.admin_dbname) { sprintf(params.admin_dbname, "%s.kadm5", params.dbname); @@ -400,27 +374,7 @@ krb5_error_code kadm5_get_config_params(context, kdcprofile, kdcenv, } } - /* Get the value for the admin (policy) database lock file*/ - hierarchy[2] = "admin_database_lockfile"; - if (params_in->mask & KADM5_CONFIG_ADB_LOCKFILE) { - params.admin_lockfile = strdup(params_in->admin_lockfile); - if (params.admin_lockfile) - params.mask |= KADM5_CONFIG_ADB_LOCKFILE; - } else if ((params_in->mask & KADM5_CONFIG_ADBNAME) || - (params_in->mask & KADM5_CONFIG_DBNAME)) { - /* if DBNAME is set but ADBNAME is not, then admin_database - * will already have been set above */ - params.admin_lockfile = (char *) malloc(strlen(params.admin_dbname) - + 6); - if (params.admin_lockfile) { - sprintf(params.admin_lockfile, "%s.lock", params.admin_dbname); - params.mask |= KADM5_CONFIG_ADB_LOCKFILE; - } - } else if (aprofile && - !krb5_aprof_get_string(aprofile, hierarchy, TRUE, &svalue)) { - params.mask |= KADM5_CONFIG_ADB_LOCKFILE; - params.admin_lockfile = svalue; - } else if (params.mask & KADM5_CONFIG_ADBNAME) { + if (params.mask & KADM5_CONFIG_ADBNAME) { params.admin_lockfile = (char *) malloc(strlen(params.admin_dbname) + 6); if (params.admin_lockfile) { diff --git a/src/lib/kadm5/unit-test/api.0/init.exp b/src/lib/kadm5/unit-test/api.0/init.exp index 08fed8b18..eec097ea1 100644 --- a/src/lib/kadm5/unit-test/api.0/init.exp +++ b/src/lib/kadm5/unit-test/api.0/init.exp @@ -716,9 +716,10 @@ if {$RPC} { test45_46 ovsec_adm/changepw # re-extract the keytab so it is right - exec rm /krb5/ovsec_adm.srvtab + exec rm $env(K5ROOT)/ovsec_adm.srvtab exec $env(MAKE_KEYTAB) -princ ovsec_adm/admin -princ ovsec_adm/changepw \ - -princ kadmin/admin -princ kadmin/changepw /krb5/ovsec_adm.srvtab + -princ kadmin/admin -princ kadmin/changepw \ + $env(K5ROOT)/ovsec_adm.srvtab } return "" diff --git a/src/lib/kadm5/unit-test/api.1/lock.exp b/src/lib/kadm5/unit-test/api.1/lock.exp index a646b3287..f9a302027 100644 --- a/src/lib/kadm5/unit-test/api.1/lock.exp +++ b/src/lib/kadm5/unit-test/api.1/lock.exp @@ -12,7 +12,7 @@ if { $RPC } { } set locktest $LOCKTEST -set lockfile "/krb5/kdb5.kadm5.lock" +set lockfile $env(K5ROOT)/kdb5.kadm5.lock # The lock tests use the program lock-test in the unit test # directory. The basic idea is that lock-test can be told to acquire diff --git a/src/lib/kadm5/unit-test/api.2/init.exp b/src/lib/kadm5/unit-test/api.2/init.exp index 9707d3bf3..79efcee15 100644 --- a/src/lib/kadm5/unit-test/api.2/init.exp +++ b/src/lib/kadm5/unit-test/api.2/init.exp @@ -720,9 +720,10 @@ if {$RPC} { test45_46 ovsec_adm/changepw # re-extract the keytab so it is right - exec rm /krb5/ovsec_adm.srvtab + exec rm $env(K5ROOT)/ovsec_adm.srvtab exec $env(MAKE_KEYTAB) -princ ovsec_adm/admin -princ ovsec_adm/changepw \ - -princ kadmin/admin -princ kadmin/changepw /krb5/ovsec_adm.srvtab + -princ kadmin/admin -princ kadmin/changepw \ + $env(K5ROOT)/ovsec_adm.srvtab } return "" -- 2.26.2