diff options
author | Simo Sorce <simo@redhat.com> | 2013-01-06 01:39:03 -0500 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2013-01-15 10:49:20 +0100 |
commit | de526c8425886ca3bed8f07a0f092ba5ac325654 (patch) | |
tree | 14e700518dec7dfe3a4d3f64f990f8566081fe2b /src | |
parent | 4b49384056874e7999d8338ce5288f3d5c27a7b8 (diff) | |
download | sssd-de526c8425886ca3bed8f07a0f092ba5ac325654.tar.gz sssd-de526c8425886ca3bed8f07a0f092ba5ac325654.tar.bz2 sssd-de526c8425886ca3bed8f07a0f092ba5ac325654.zip |
Make sysdb_custom_dn() require a domain.
Diffstat (limited to 'src')
-rw-r--r-- | src/db/sysdb.c | 3 | ||||
-rw-r--r-- | src/db/sysdb.h | 1 | ||||
-rw-r--r-- | src/db/sysdb_autofs.c | 3 | ||||
-rw-r--r-- | src/db/sysdb_ops.c | 9 | ||||
-rw-r--r-- | src/providers/ipa/ipa_hbac_common.c | 6 | ||||
-rw-r--r-- | src/providers/ipa/ipa_selinux.c | 8 |
6 files changed, 20 insertions, 10 deletions
diff --git a/src/db/sysdb.c b/src/db/sysdb.c index 89512529..2f58d70d 100644 --- a/src/db/sysdb.c +++ b/src/db/sysdb.c @@ -120,6 +120,7 @@ struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb, } struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx, + struct sss_domain_info *dom, const char *object_name, const char *subtree_name) { @@ -145,7 +146,7 @@ struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx, } dn = ldb_dn_new_fmt(mem_ctx, sysdb->ldb, SYSDB_TMPL_CUSTOM, clean_name, - clean_subtree, sysdb->domain->name); + clean_subtree, dom->name); done: talloc_free(tmp_ctx); diff --git a/src/db/sysdb.h b/src/db/sysdb.h index 3a5e36da..fd1d7c81 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -337,6 +337,7 @@ struct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx, struct sss_domain_info *dom); struct ldb_dn *sysdb_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx); struct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx, + struct sss_domain_info *dom, const char *object_name, const char *subtree_name); struct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx, diff --git a/src/db/sysdb_autofs.c b/src/db/sysdb_autofs.c index 57380cfd..446b3cac 100644 --- a/src/db/sysdb_autofs.c +++ b/src/db/sysdb_autofs.c @@ -31,7 +31,8 @@ sysdb_autofsmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, const char *map_name) { - return sysdb_custom_dn(sysdb, mem_ctx, map_name, AUTOFS_MAP_SUBDIR); + return sysdb_custom_dn(sysdb, mem_ctx, + sysdb->domain, map_name, AUTOFS_MAP_SUBDIR); } static struct ldb_dn * diff --git a/src/db/sysdb_ops.c b/src/db/sysdb_ops.c index 4b0e1676..b70e0966 100644 --- a/src/db/sysdb_ops.c +++ b/src/db/sysdb_ops.c @@ -2037,7 +2037,8 @@ int sysdb_search_custom_by_name(TALLOC_CTX *mem_ctx, return ENOMEM; } - basedn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name); + basedn = sysdb_custom_dn(sysdb, tmp_ctx, + sysdb->domain, object_name, subtree_name); if (basedn == NULL) { DEBUG(1, ("sysdb_custom_dn failed.\n")); ret = ENOMEM; @@ -2119,7 +2120,8 @@ int sysdb_store_custom(struct sysdb_ctx *sysdb, goto done; } - msg->dn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name); + msg->dn = sysdb_custom_dn(sysdb, tmp_ctx, + sysdb->domain, object_name, subtree_name); if (!msg->dn) { DEBUG(1, ("sysdb_custom_dn failed.\n")); ret = ENOMEM; @@ -2189,7 +2191,8 @@ int sysdb_delete_custom(struct sysdb_ctx *sysdb, return ENOMEM; } - dn = sysdb_custom_dn(sysdb, tmp_ctx, object_name, subtree_name); + dn = sysdb_custom_dn(sysdb, tmp_ctx, + sysdb->domain, object_name, subtree_name); if (dn == NULL) { DEBUG(1, ("sysdb_custom_dn failed.\n")); ret = ENOMEM; diff --git a/src/providers/ipa/ipa_hbac_common.c b/src/providers/ipa/ipa_hbac_common.c index 33d1944e..500f3548 100644 --- a/src/providers/ipa/ipa_hbac_common.c +++ b/src/providers/ipa/ipa_hbac_common.c @@ -630,7 +630,8 @@ hbac_eval_service_element(TALLOC_CTX *mem_ctx, svc->name = servicename; - svc_dn = sysdb_custom_dn(sysdb, tmp_ctx, svc->name, HBAC_SERVICES_SUBDIR); + svc_dn = sysdb_custom_dn(sysdb, tmp_ctx, + domain, svc->name, HBAC_SERVICES_SUBDIR); if (svc_dn == NULL) { ret = ENOMEM; goto done; @@ -737,7 +738,8 @@ hbac_eval_host_element(TALLOC_CTX *mem_ctx, goto done; } - host_dn = sysdb_custom_dn(sysdb, tmp_ctx, host->name, HBAC_HOSTS_SUBDIR); + host_dn = sysdb_custom_dn(sysdb, tmp_ctx, + domain, host->name, HBAC_HOSTS_SUBDIR); if (host_dn == NULL) { ret = ENOMEM; goto done; diff --git a/src/providers/ipa/ipa_selinux.c b/src/providers/ipa/ipa_selinux.c index d1dbe576..7a615677 100644 --- a/src/providers/ipa/ipa_selinux.c +++ b/src/providers/ipa/ipa_selinux.c @@ -53,6 +53,7 @@ static errno_t ipa_get_selinux_recv(struct tevent_req *req, static struct ipa_selinux_op_ctx * ipa_selinux_create_op_ctx(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, struct be_req *be_req, const char *username, const char *hostname); static void ipa_selinux_handler_done(struct tevent_req *subreq); @@ -98,8 +99,8 @@ void ipa_selinux_handler(struct be_req *be_req) goto fail; } - op_ctx = ipa_selinux_create_op_ctx(be_req, be_req->sysdb, be_req, - pd->user, hostname); + op_ctx = ipa_selinux_create_op_ctx(be_req, be_req->sysdb, be_req->domain, + be_req, pd->user, hostname); if (op_ctx == NULL) { DEBUG(SSSDBG_OP_FAILURE, ("Cannot create op context\n")); goto fail; @@ -120,6 +121,7 @@ fail: static struct ipa_selinux_op_ctx * ipa_selinux_create_op_ctx(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + struct sss_domain_info *domain, struct be_req *be_req, const char *username, const char *hostname) { @@ -144,7 +146,7 @@ ipa_selinux_create_op_ctx(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, goto fail; } - host_dn = sysdb_custom_dn(sysdb, op_ctx, hostname, HBAC_HOSTS_SUBDIR); + host_dn = sysdb_custom_dn(sysdb, op_ctx, domain, hostname, HBAC_HOSTS_SUBDIR); if (host_dn == NULL) { goto fail; } |