From 4efa04cf1236c207b6ec5bb705ae02e622167336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Fri, 27 Apr 2007 20:19:30 +0000 Subject: [PATCH] add acl file git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20574 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/hdb/dbinfo.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/lib/hdb/dbinfo.c b/lib/hdb/dbinfo.c index a5e741751..865438751 100644 --- a/lib/hdb/dbinfo.c +++ b/lib/hdb/dbinfo.c @@ -40,6 +40,7 @@ struct hdb_dbinfo { char *realm; char *dbname; char *mkey_file; + char *acl_file; const krb5_config_binding *binding; struct hdb_dbinfo *next; }; @@ -73,6 +74,9 @@ get_dbinfo(krb5_context context, p = krb5_config_get_string(context, db_binding, "mkey_file", NULL); if(p) di->mkey_file = strdup(p); + p = krb5_config_get_string(context, db_binding, "acl_file", NULL); + if(p) + di->acl_file = strdup(p); di->binding = db_binding; @@ -88,6 +92,7 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) struct hdb_dbinfo *di, **dt, *databases; const char *default_dbname = HDB_DEFAULT_DB; const char *default_mkey = HDB_DB_DIR "/m-key"; + const char *default_acl = HDB_DB_DIR "/kadmind.acl"; const char *p; int ret; @@ -134,6 +139,7 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) di = calloc(1, sizeof(*di)); di->dbname = strdup(default_dbname); di->mkey_file = strdup(default_mkey); + di->acl_file = strdup(default_acl); databases = di; } for(di = databases; di; di = di->next) { @@ -150,6 +156,9 @@ hdb_get_dbinfo(krb5_context context, struct hdb_dbinfo **dbp) asprintf(&di->mkey_file, "%.*s.mkey", (int)(p - di->dbname), di->dbname); } + if(di->acl_file == NULL) + di->acl_file = strdup(default_acl); + } *dbp = databases; return 0; @@ -189,6 +198,12 @@ hdb_dbinfo_get_mkey_file(krb5_context context, struct hdb_dbinfo *dbp) return dbp->mkey_file; } +const char * +hdb_dbinfo_get_acl_file(krb5_context context, struct hdb_dbinfo *dbp) +{ + return dbp->acl_file; +} + const krb5_config_binding * hdb_dbinfo_get_binding(krb5_context context, struct hdb_dbinfo *dbp) {