+2005-10-04 Ken Raeburn <raeburn@mit.edu>
+
+ * kdb5_mkdums.c (set_dbname_help): Set default realm and construct
+ an argument vector describing the database pathname, before
+ calling krb5_db_open.
+
2005-06-20 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (KDB5_DEP_LIB): Use DL_LIB and THREAD_LINKOPTS
int nentries;
krb5_boolean more;
krb5_data pwd, scratch;
+ char *args[2];
-#if 0
- if ((retval = krb5_db_set_name(test_context, dbname))) {
- com_err(pname, retval, "while setting active database to '%s'",
- dbname);
- return(1);
- }
-#endif
/* assemble & parse the master key name */
if ((retval = krb5_db_setup_mkey_name(test_context, mkey_name, cur_realm,
return(1);
}
}
-#if 0
- if ((retval = krb5_db_init(test_context))) {
-#endif
- if ((retval = krb5_db_open(test_context, NULL, KRB5_KDB_OPEN_RO))) {
+
+ /* Ick! Current DAL interface requires that the default_realm
+ field be set in the krb5_context. */
+ if ((retval = krb5_set_default_realm(test_context, cur_realm))) {
+ com_err(pname, retval, "setting default realm");
+ return 1;
+ }
+ /* Pathname is passed to db2 via 'args' parameter. */
+ args[1] = NULL;
+ args[0] = malloc(sizeof("dbname=") + strlen(dbname));
+ if (args[0] == NULL) {
+ com_err(pname, errno, "while setting up db parameters");
+ return 1;
+ }
+ sprintf(args[0], "dbname=%s", dbname);
+
+ if ((retval = krb5_db_open(test_context, args, KRB5_KDB_OPEN_RO))) {
com_err(pname, retval, "while initializing database");
return(1);
}
+2005-10-04 Ken Raeburn <raeburn@mit.edu>
+
+ * kdb5_verify.c (set_dbname_help): Set default realm and construct
+ argument vector describing database location, before calling
+ krb5_db_open.
+
2005-06-20 Ken Raeburn <raeburn@mit.edu>
* Makefile.in (KDB5_DEP_LIB): Use DL_LIB and THREAD_LINKOPTS
int nentries;
krb5_boolean more;
krb5_data pwd, scratch;
-
-#if 0
- if ((retval = krb5_db_set_name(context, dbname))) {
- com_err(pname, retval, "while setting active database to '%s'",
- dbname);
- return(1);
- }
-#endif
+ char *args[2];
/* assemble & parse the master key name */
return(1);
}
}
- if ((retval = krb5_db_open(context, NULL, KRB5_KDB_OPEN_RO))) {
+
+ /* Ick! Current DAL interface requires that the default_realm
+ field be set in the krb5_context. */
+ if ((retval = krb5_set_default_realm(context, cur_realm))) {
+ com_err(pname, retval, "setting default realm");
+ return 1;
+ }
+ /* Pathname is passed to db2 via 'args' parameter. */
+ args[1] = NULL;
+ args[0] = malloc(sizeof("dbname=") + strlen(dbname));
+ if (args[0] == NULL) {
+ com_err(pname, errno, "while setting up db parameters");
+ return 1;
+ }
+ sprintf(args[0], "dbname=%s", dbname);
+
+ if ((retval = krb5_db_open(context, args, KRB5_KDB_OPEN_RO))) {
com_err(pname, retval, "while initializing database");
return(1);
}