Author: abartlet Date: 2007-06-18 05:27:40 +0000 (Mon, 18 Jun 2007) New Revision: 745
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=745 Log: I forgot to include this change (to ensure that default_config.c doesn't contain references to hdb) in the diff, so lha's merge wiped it out. Andrew Bartlett Modified: trunk/heimdal/heimdal-lorikeet.diff trunk/heimdal/kdc/config.c trunk/heimdal/kdc/default_config.c Changeset: Modified: trunk/heimdal/heimdal-lorikeet.diff =================================================================== --- trunk/heimdal/heimdal-lorikeet.diff 2007-06-18 05:27:03 UTC (rev 744) +++ trunk/heimdal/heimdal-lorikeet.diff 2007-06-18 05:27:40 UTC (rev 745) @@ -96,3 +96,131 @@ esym="__i686.get_pc_thunk fc_softc" symbols= +--- /data/heimdal-svn/kdc/default_config.c 2007-06-08 12:22:34.000000000 +1000 ++++ kdc/default_config.c 2007-06-11 19:03:21.000000000 +1000 +@@ -38,51 +38,6 @@ + + RCSID("$Id: default_config.c 20532 2007-04-23 07:46:57Z lha $"); + +-static void +-get_dbinfo(krb5_context context, struct krb5_kdc_configuration *c) +-{ +- struct hdb_dbinfo *info, *d; +- krb5_error_code ret; +- +- /* fetch the databases */ +- ret = hdb_get_dbinfo(context, &info); +- if (ret) +- krb5_err(context, 1, ret, "hdb_get_dbinfo"); +- +- d = NULL; +- while ((d = hdb_dbinfo_get_next(info, d)) != NULL) { +- void *ptr; +- +- ptr = realloc(c->db, (c->num_db + 1) * sizeof(*c->db)); +- if (ptr == NULL) +- krb5_err(context, 1, ret, "out of memory"); +- c->db = ptr; +- +- ret = hdb_create(context, &c->db[c->num_db], +- hdb_dbinfo_get_dbname(context, d)); +- if(ret) +- krb5_err(context, 1, ret, "hdb_create %s", +- hdb_dbinfo_get_dbname(context, d)); +- +- ret = hdb_set_master_keyfile(context, c->db[c->num_db], +- hdb_dbinfo_get_mkey_file(context, d)); +- if (ret) +- krb5_err(context, 1, ret, "hdb_set_master_keyfile"); +- +- c->num_db++; +- +- kdc_log(context, c, 0, "label: %s\n", +- hdb_dbinfo_get_label(context, d)); +- kdc_log(context, c, 0, "\trealm: %s\n", +- hdb_dbinfo_get_realm(context, d)); +- kdc_log(context, c, 0, "\tdbname: %s\n", +- hdb_dbinfo_get_dbname(context, d)); +- kdc_log(context, c, 0, "\tmkey_file: %s\n", +- hdb_dbinfo_get_mkey_file(context, d)); +- } +- hdb_free_dbinfo(context, &info); +-} +- + + int + krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config) +@@ -112,8 +67,6 @@ + c->num_db = 0; + c->logf = NULL; + +- get_dbinfo(context, c); +- + c->require_preauth = + krb5_config_get_bool_default(context, NULL, + c->require_preauth, +--- /data/heimdal-svn/kdc/config.c 2007-06-08 12:22:33.000000000 +1000 ++++ kdc/config.c 2007-06-13 15:25:07.000000000 +1000 +@@ -145,6 +145,51 @@ + krb5_free_addresses (context, &tmp); + } + ++static void ++get_dbinfo(krb5_context context, struct krb5_kdc_configuration *c) ++{ ++ struct hdb_dbinfo *info, *d; ++ krb5_error_code ret; ++ ++ /* fetch the databases */ ++ ret = hdb_get_dbinfo(context, &info); ++ if (ret) ++ krb5_err(context, 1, ret, "hdb_get_dbinfo"); ++ ++ d = NULL; ++ while ((d = hdb_dbinfo_get_next(info, d)) != NULL) { ++ void *ptr; ++ ++ ptr = realloc(c->db, (c->num_db + 1) * sizeof(*c->db)); ++ if (ptr == NULL) ++ krb5_err(context, 1, ret, "out of memory"); ++ c->db = ptr; ++ ++ ret = hdb_create(context, &c->db[c->num_db], ++ hdb_dbinfo_get_dbname(context, d)); ++ if(ret) ++ krb5_err(context, 1, ret, "hdb_create %s", ++ hdb_dbinfo_get_dbname(context, d)); ++ ++ ret = hdb_set_master_keyfile(context, c->db[c->num_db], ++ hdb_dbinfo_get_mkey_file(context, d)); ++ if (ret) ++ krb5_err(context, 1, ret, "hdb_set_master_keyfile"); ++ ++ c->num_db++; ++ ++ kdc_log(context, c, 0, "label: %s\n", ++ hdb_dbinfo_get_label(context, d)); ++ kdc_log(context, c, 0, "\trealm: %s\n", ++ hdb_dbinfo_get_realm(context, d)); ++ kdc_log(context, c, 0, "\tdbname: %s\n", ++ hdb_dbinfo_get_dbname(context, d)); ++ kdc_log(context, c, 0, "\tmkey_file: %s\n", ++ hdb_dbinfo_get_mkey_file(context, d)); ++ } ++ hdb_free_dbinfo(context, &info); ++} ++ + krb5_kdc_configuration * + configure(krb5_context context, int argc, char **argv) + { +@@ -200,7 +245,9 @@ + if (ret) + krb5_err(context, 1, ret, "krb5_kdc_default_config"); + +- kdc_openlog(context, config); ++ get_dbinfo(context, config); ++ ++ kdc_openlog(context, config); + + if(max_request_str) + max_request = parse_bytes(max_request_str, NULL); Modified: trunk/heimdal/kdc/config.c =================================================================== --- trunk/heimdal/kdc/config.c 2007-06-18 05:27:03 UTC (rev 744) +++ trunk/heimdal/kdc/config.c 2007-06-18 05:27:40 UTC (rev 745) @@ -145,6 +145,51 @@ krb5_free_addresses (context, &tmp); } +static void +get_dbinfo(krb5_context context, struct krb5_kdc_configuration *c) +{ + struct hdb_dbinfo *info, *d; + krb5_error_code ret; + + /* fetch the databases */ + ret = hdb_get_dbinfo(context, &info); + if (ret) + krb5_err(context, 1, ret, "hdb_get_dbinfo"); + + d = NULL; + while ((d = hdb_dbinfo_get_next(info, d)) != NULL) { + void *ptr; + + ptr = realloc(c->db, (c->num_db + 1) * sizeof(*c->db)); + if (ptr == NULL) + krb5_err(context, 1, ret, "out of memory"); + c->db = ptr; + + ret = hdb_create(context, &c->db[c->num_db], + hdb_dbinfo_get_dbname(context, d)); + if(ret) + krb5_err(context, 1, ret, "hdb_create %s", + hdb_dbinfo_get_dbname(context, d)); + + ret = hdb_set_master_keyfile(context, c->db[c->num_db], + hdb_dbinfo_get_mkey_file(context, d)); + if (ret) + krb5_err(context, 1, ret, "hdb_set_master_keyfile"); + + c->num_db++; + + kdc_log(context, c, 0, "label: %s\n", + hdb_dbinfo_get_label(context, d)); + kdc_log(context, c, 0, "\trealm: %s\n", + hdb_dbinfo_get_realm(context, d)); + kdc_log(context, c, 0, "\tdbname: %s\n", + hdb_dbinfo_get_dbname(context, d)); + kdc_log(context, c, 0, "\tmkey_file: %s\n", + hdb_dbinfo_get_mkey_file(context, d)); + } + hdb_free_dbinfo(context, &info); +} + krb5_kdc_configuration * configure(krb5_context context, int argc, char **argv) { @@ -200,8 +245,10 @@ if (ret) krb5_err(context, 1, ret, "krb5_kdc_default_config"); - kdc_openlog(context, config); + get_dbinfo(context, config); + kdc_openlog(context, config); + if(max_request_str) max_request = parse_bytes(max_request_str, NULL); Modified: trunk/heimdal/kdc/default_config.c =================================================================== --- trunk/heimdal/kdc/default_config.c 2007-06-18 05:27:03 UTC (rev 744) +++ trunk/heimdal/kdc/default_config.c 2007-06-18 05:27:40 UTC (rev 745) @@ -38,52 +38,7 @@ RCSID("$Id: default_config.c 20532 2007-04-23 07:46:57Z lha $"); -static void -get_dbinfo(krb5_context context, struct krb5_kdc_configuration *c) -{ - struct hdb_dbinfo *info, *d; - krb5_error_code ret; - /* fetch the databases */ - ret = hdb_get_dbinfo(context, &info); - if (ret) - krb5_err(context, 1, ret, "hdb_get_dbinfo"); - - d = NULL; - while ((d = hdb_dbinfo_get_next(info, d)) != NULL) { - void *ptr; - - ptr = realloc(c->db, (c->num_db + 1) * sizeof(*c->db)); - if (ptr == NULL) - krb5_err(context, 1, ret, "out of memory"); - c->db = ptr; - - ret = hdb_create(context, &c->db[c->num_db], - hdb_dbinfo_get_dbname(context, d)); - if(ret) - krb5_err(context, 1, ret, "hdb_create %s", - hdb_dbinfo_get_dbname(context, d)); - - ret = hdb_set_master_keyfile(context, c->db[c->num_db], - hdb_dbinfo_get_mkey_file(context, d)); - if (ret) - krb5_err(context, 1, ret, "hdb_set_master_keyfile"); - - c->num_db++; - - kdc_log(context, c, 0, "label: %s\n", - hdb_dbinfo_get_label(context, d)); - kdc_log(context, c, 0, "\trealm: %s\n", - hdb_dbinfo_get_realm(context, d)); - kdc_log(context, c, 0, "\tdbname: %s\n", - hdb_dbinfo_get_dbname(context, d)); - kdc_log(context, c, 0, "\tmkey_file: %s\n", - hdb_dbinfo_get_mkey_file(context, d)); - } - hdb_free_dbinfo(context, &info); -} - - int krb5_kdc_get_config(krb5_context context, krb5_kdc_configuration **config) { @@ -112,8 +67,6 @@ c->num_db = 0; c->logf = NULL; - get_dbinfo(context, c); - c->require_preauth = krb5_config_get_bool_default(context, NULL, c->require_preauth,