From 2e53c10c68a86c33d97936fce02c3c53aad82bfa Mon Sep 17 00:00:00 2001 From: Jakub Hrozek Date: Thu, 13 Aug 2009 13:02:28 +0200 Subject: Make "files" a reserved word for legacy local domain This patch introduces provider=files as a valid provider. Upon loading the backend, its properties in confdb are overwritten to those that represent legacy local domain. Also document this in sssd.conf(5) and example config --- server/providers/data_provider_be.c | 43 +++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'server/providers/data_provider_be.c') diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index c92289b6d..24d9105ef 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -874,6 +874,43 @@ done: return ret; } +/* Some providers are just aliases for more complicated settings, + * rewrite the alias into the actual settings */ +static int be_rewrite(struct be_ctx *ctx) +{ + int ret; + const char *val[2]; + val[1] = NULL; + + /* "files" is a special case that means: + * provider = proxy + * libName = files + */ + if (strcasecmp(ctx->name, "files") == 0) { + DEBUG(5, ("Rewriting provider %s\n", ctx->name)); + + val[0] = "proxy"; + ret = confdb_add_param(ctx->cdb, true, + ctx->conf_path, + "provider", + val); + if (ret) { + return ret; + } + + val[0] = "files"; + ret = confdb_add_param(ctx->cdb, true, + ctx->conf_path, + "libName", + val); + if (ret) { + return ret; + } + } + + return EOK; +} + int be_process_init(TALLOC_CTX *mem_ctx, const char *be_name, const char *be_domain, @@ -922,6 +959,12 @@ int be_process_init(TALLOC_CTX *mem_ctx, return ret; } + ret = be_rewrite(ctx); + if (ret != EOK) { + DEBUG(0, ("error rewriting provider types\n")); + return ret; + } + ret = load_backend_module(ctx, BET_ID, &ctx->bet_info[BET_ID].bet_ops, &ctx->bet_info[BET_ID].pvt_bet_data); -- cgit