Only match db databases on filename starting with '/'.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16311 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2005-11-29 18:48:07 +00:00
parent 56538b207f
commit f32ada0887

View File

@@ -53,17 +53,17 @@ static struct hdb_method methods[] = {
#endif
#if defined(OPENLDAP) && !defined(OPENLDAP_MODULE)
{"ldap:", hdb_ldap_create},
#endif
#if HAVE_DB1 || HAVE_DB3
{"", hdb_db_create},
#elif defined(HAVE_NDBM)
{"", hdb_ndbm_create},
#elif defined(OPENLDAP) && !defined(OPENLDAP_MODULE)
{"", hdb_ldap_create},
#endif
{NULL, NULL}
};
#if HAVE_DB1 || HAVE_DB3
static struct hdb_method dbmetod = {"", hdb_db_create };
#elif defined(HAVE_NDBM)
static struct hdb_method dbmetod = {"", hdb_ndbm_create };
#endif
krb5_error_code
hdb_next_enctype2key(krb5_context context,
const hdb_entry *e,
@@ -327,11 +327,19 @@ find_method (const char *filename, const char **rest)
{
const struct hdb_method *h;
for (h = methods; h->prefix != NULL; ++h)
for (h = methods; h->prefix != NULL; ++h) {
if (strncmp (filename, h->prefix, strlen(h->prefix)) == 0) {
*rest = filename + strlen(h->prefix);
return h;
}
}
#if defined(HAVE_DB1) || defined(HAVE_DB3) || define(HAVE_NDBM)
if (filename[0] == '/') {
*rest = filename;
return &dbmetod;
}
#endif
return NULL;
}
@@ -357,8 +365,6 @@ hdb_list_builtin(krb5_context context, char **list)
buf[0] = '\0';
for (h = methods; h->prefix != NULL; ++h) {
if (h->prefix[0] == '\0')
continue;
if (h != methods)
strlcat(buf, ", ", len);
strlcat(buf, h->prefix, len);