diff options
author | Simo Sorce <ssorce@redhat.com> | 2009-04-11 00:18:23 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2009-04-13 09:07:04 -0400 |
commit | f16705ecade500f77b525d1a3df0109196c98ee0 (patch) | |
tree | 972b1dba612fa52dd5f9f98b098aa5ad31d2b6f6 /server/providers | |
parent | a89fce4904ecb1169026238a6952d4d6a1995c7f (diff) | |
download | sssd-f16705ecade500f77b525d1a3df0109196c98ee0.tar.gz sssd-f16705ecade500f77b525d1a3df0109196c98ee0.tar.bz2 sssd-f16705ecade500f77b525d1a3df0109196c98ee0.zip |
Always pass full domain info
Change sysdb to always passwd sss_domain_info, not just the domain name.
This way domain specific options can always be honored at the db level.
Diffstat (limited to 'server/providers')
-rw-r--r-- | server/providers/data_provider_be.c | 17 | ||||
-rw-r--r-- | server/providers/dp_backend.h | 2 | ||||
-rw-r--r-- | server/providers/proxy.c | 18 |
3 files changed, 23 insertions, 14 deletions
diff --git a/server/providers/data_provider_be.c b/server/providers/data_provider_be.c index 61844bbe..796ab532 100644 --- a/server/providers/data_provider_be.c +++ b/server/providers/data_provider_be.c @@ -141,7 +141,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) if (!ctx) return EINVAL; DEBUG(4,("Sending ID reply: (%d,%d,%s,%s)\n", - clitype, version, ctx->name, ctx->domain)); + clitype, version, ctx->name, ctx->domain->name)); reply = dbus_message_new_method_return(message); if (!reply) return ENOMEM; @@ -150,7 +150,7 @@ static int be_identity(DBusMessage *message, struct sbus_conn_ctx *sconn) DBUS_TYPE_UINT16, &clitype, DBUS_TYPE_UINT16, &version, DBUS_TYPE_STRING, &ctx->name, - DBUS_TYPE_STRING, &ctx->domain, + DBUS_TYPE_STRING, &ctx->domain->name, DBUS_TYPE_INVALID); if (!ret) { dbus_message_unref(reply); @@ -599,10 +599,10 @@ done: talloc_free(be_req); } - DEBUG(4, ("Sending result [%d][%s]\n", pam_status, ctx->domain)); + DEBUG(4, ("Sending result [%d][%s]\n", pam_status, ctx->domain->name)); ret = dbus_message_append_args(reply, DBUS_TYPE_UINT32, &pam_status, - DBUS_TYPE_STRING, &ctx->domain, + DBUS_TYPE_STRING, &ctx->domain->name, DBUS_TYPE_INVALID); if (!ret) return EIO; @@ -948,14 +948,19 @@ int be_process_init(TALLOC_CTX *mem_ctx, ctx->ev = ev; ctx->cdb = cdb; ctx->name = talloc_strdup(ctx, be_name); - ctx->domain = talloc_strdup(ctx, be_domain); ctx->identity = talloc_asprintf(ctx, "%%BE_%s", be_domain); ctx->conf_path = talloc_asprintf(ctx, "config/domains/%s", be_domain); - if (!ctx->name || !ctx->domain || !ctx->identity || !ctx->conf_path) { + if (!ctx->name || !ctx->identity || !ctx->conf_path) { DEBUG(0, ("Out of memory!?\n")); return ENOMEM; } + ret = confdb_get_domain(cdb, ctx, be_domain, &ctx->domain); + if (ret != EOK) { + DEBUG(0, ("fatal error retrieving domain configuration\n")); + return ret; + } + ret = sysdb_init(ctx, ev, cdb, NULL, &ctx->sysdb); if (ret != EOK) { DEBUG(0, ("fatal error opening cache database\n")); diff --git a/server/providers/dp_backend.h b/server/providers/dp_backend.h index 2d1cd83e..da71e753 100644 --- a/server/providers/dp_backend.h +++ b/server/providers/dp_backend.h @@ -43,8 +43,8 @@ struct be_ctx { struct sysdb_ctx *sysdb; struct service_sbus_ctx *ss_ctx; struct service_sbus_ctx *dp_ctx; + struct sss_domain_info *domain; const char *name; - const char *domain; const char *identity; const char *conf_path; diff --git a/server/providers/proxy.c b/server/providers/proxy.c index 1b4a8300..907f044e 100644 --- a/server/providers/proxy.c +++ b/server/providers/proxy.c @@ -308,7 +308,7 @@ static void get_pw_name(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); @@ -376,8 +376,10 @@ static void get_pw_uid(struct be_req *req, uid_t uid) /* FIXME: verify user does not have gid=0 as these are invalid values */ if (data->pwd->pw_gid == 0) { data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, data->pwd->pw_name); - ret = sysdb_transaction(data, req->be_ctx->sysdb, del_db_entry, data); + req->be_ctx->domain->name, + data->pwd->pw_name); + ret = sysdb_transaction(data, req->be_ctx->sysdb, + del_db_entry, data); break; } @@ -580,7 +582,7 @@ static void get_gr_name(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_group_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); @@ -647,8 +649,10 @@ static void get_gr_gid(struct be_req *req, gid_t gid) /* FIXME: verify group does not have gid=0 as this is invalid */ if (data->grp->gr_gid == 0) { data->dn = sysdb_group_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, data->grp->gr_name); - ret = sysdb_transaction(data, req->be_ctx->sysdb, del_db_entry, data); + req->be_ctx->domain->name, + data->grp->gr_name); + ret = sysdb_transaction(data, req->be_ctx->sysdb, + del_db_entry, data); break; } @@ -952,7 +956,7 @@ static void get_initgr_user(struct be_req *req, char *name) switch (status) { case NSS_STATUS_NOTFOUND: data->dn = sysdb_user_dn(req->be_ctx->sysdb, data, - req->be_ctx->domain, name); + req->be_ctx->domain->name, name); if (!data->dn) return proxy_reply(req, ENOMEM, "Out of memory"); |