These three patches provide changes that reduce the amount of data retrieved from IPA server in case this data is previously retrieved by HBAC access provider.
#168: modify hbac_get_cached_rules() so it can be used out of the HBAC code #169: use cache for HBAC rules #170: use cache for host record
Thanks Jan
On Mon, Jul 30, 2012 at 09:34:43AM +0200, Jan Zelený wrote:
These three patches provide changes that reduce the amount of data retrieved from IPA server in case this data is previously retrieved by HBAC access provider.
#168: modify hbac_get_cached_rules() so it can be used out of the HBAC code #169: use cache for HBAC rules #170: use cache for host record
Nack, the patches break HBAC-linked SELinux mappings completely.
hbac_get_cached_rules() doesn't return originalDN, yet ipa_get_selinux_hbac_process depends on them.
Code style issues are inline.
+errno_t hbac_get_cached_rules(TALLOC_CTX *mem_ctx,
struct sysdb_ctx *sysdb,size_t *_rule_count,struct sysdb_attrs ***_rules){ errno_t ret;
- struct sysdb_ctx *sysdb = hbac_ctx_sysdb(hbac_ctx);
- size_t count; struct ldb_message **msgs;
- struct sysdb_attrs **rules;
- size_t rule_count; TALLOC_CTX *tmp_ctx; char *filter; const char *attrs[] = { OBJECTCLASS,
@@ -680,7 +680,7 @@ static errno_t hbac_get_cached_rules(TALLOC_CTX *mem_ctx, IPA_HOST_CATEGORY, NULL };
- tmp_ctx = talloc_new(hbac_ctx);
- tmp_ctx = talloc_new(mem_ctx);
Please create temporary context on NULL..
if (tmp_ctx == NULL) return ENOMEM; filter = talloc_asprintf(tmp_ctx, "(objectClass=%s)", IPA_HBAC_RULE);@@ -691,20 +691,22 @@ static errno_t hbac_get_cached_rules(TALLOC_CTX *mem_ctx,
ret = sysdb_search_custom(mem_ctx, sysdb, filter,
..use the temporary context here ^^ instead of mem_ctx..
HBAC_RULES_SUBDIR, attrs,
&count, &msgs);
if (ret != EOK && ret != ENOENT) { DEBUG(1, ("Error looking up HBAC rules")); goto done; } if (ret == ENOENT) {&rule_count, &msgs);
count = 0;
}rule_count = 0;
- ret = sysdb_msg2attrs(mem_ctx, count, msgs, &hbac_ctx->rules);
- ret = sysdb_msg2attrs(mem_ctx, rule_count, msgs, &rules); if (ret != EOK) { DEBUG(1, ("Could not convert ldb message to sysdb_attrs\n")); goto done; }
- hbac_ctx->rule_count = count;
- if (_rules) *_rules = rules;
..and then steal the result with talloc_steal()
if (_rule_count) *_rule_count = rule_count;
ret = EOK;
done:
Dne pondělí 30 července 2012 19:04:50, Jakub Hrozek napsal(a):
On Mon, Jul 30, 2012 at 09:34:43AM +0200, Jan Zelený wrote:
These three patches provide changes that reduce the amount of data retrieved from IPA server in case this data is previously retrieved by HBAC access provider.
#168: modify hbac_get_cached_rules() so it can be used out of the HBAC code #169: use cache for HBAC rules #170: use cache for host record
Nack, the patches break HBAC-linked SELinux mappings completely.
hbac_get_cached_rules() doesn't return originalDN, yet ipa_get_selinux_hbac_process depends on them.
Thanks for catching this. As it turned out, I had disabled HBAC-linked rules on my IPA server at some point, that's why I didn't catch this myself.
Code style issues are inline.
All fixed, new patches attached.
Thanks Jan
On Tue, Jul 31, 2012 at 09:49:45AM +0200, Jan Zelený wrote:
Dne pondělí 30 července 2012 19:04:50, Jakub Hrozek napsal(a):
On Mon, Jul 30, 2012 at 09:34:43AM +0200, Jan Zelený wrote:
These three patches provide changes that reduce the amount of data retrieved from IPA server in case this data is previously retrieved by HBAC access provider.
#168: modify hbac_get_cached_rules() so it can be used out of the HBAC code #169: use cache for HBAC rules #170: use cache for host record
Nack, the patches break HBAC-linked SELinux mappings completely.
hbac_get_cached_rules() doesn't return originalDN, yet ipa_get_selinux_hbac_process depends on them.
Thanks for catching this. As it turned out, I had disabled HBAC-linked rules on my IPA server at some point, that's why I didn't catch this myself.
Code style issues are inline.
All fixed, new patches attached.
Thanks Jan
Ack.
On Tue, Jul 31, 2012 at 02:10:54PM +0200, Jakub Hrozek wrote:
On Tue, Jul 31, 2012 at 09:49:45AM +0200, Jan Zelený wrote:
Dne pondělí 30 července 2012 19:04:50, Jakub Hrozek napsal(a):
On Mon, Jul 30, 2012 at 09:34:43AM +0200, Jan Zelený wrote:
These three patches provide changes that reduce the amount of data retrieved from IPA server in case this data is previously retrieved by HBAC access provider.
#168: modify hbac_get_cached_rules() so it can be used out of the HBAC code #169: use cache for HBAC rules #170: use cache for host record
Nack, the patches break HBAC-linked SELinux mappings completely.
hbac_get_cached_rules() doesn't return originalDN, yet ipa_get_selinux_hbac_process depends on them.
Thanks for catching this. As it turned out, I had disabled HBAC-linked rules on my IPA server at some point, that's why I didn't catch this myself.
Code style issues are inline.
All fixed, new patches attached.
Thanks Jan
Ack.
Pushed to master.
sssd-devel@lists.fedorahosted.org