diff options
author | Pavel Reichl <preichl@redhat.com> | 2016-03-01 08:41:24 -0500 |
---|---|---|
committer | Lukas Slebodnik <lslebodn@redhat.com> | 2016-03-02 20:33:21 +0100 |
commit | bda0a8ee67c4222ede597fd57456b74e33116653 (patch) | |
tree | 85e7a52721601e8f235dd2a4c0dc0611527f4acc | |
parent | 5ff7a765434ed0b4d37564ade26d7761d06f81c3 (diff) | |
download | sssd-bda0a8ee67c4222ede597fd57456b74e33116653.tar.gz sssd-bda0a8ee67c4222ede597fd57456b74e33116653.tar.xz sssd-bda0a8ee67c4222ede597fd57456b74e33116653.zip |
IDMAP: Make parameter names more descriptive
Domain SID (not name) is part of identification string for helper range
in generate_sec_slice_name().
Use more generic name for range identifier when calculating range for
new slice in sss_idmap_calculate_range().
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r-- | src/lib/idmap/sss_idmap.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/idmap/sss_idmap.c b/src/lib/idmap/sss_idmap.c index 5c84f2a99..58b0ec621 100644 --- a/src/lib/idmap/sss_idmap.c +++ b/src/lib/idmap/sss_idmap.c @@ -377,7 +377,7 @@ static bool check_dom_overlap(struct idmap_range_params *prim_range, } enum idmap_error_code sss_idmap_calculate_range(struct sss_idmap_ctx *ctx, - const char *dom_sid, + const char *range_id, id_t *slice_num, struct sss_idmap_range *_range) { @@ -419,8 +419,8 @@ enum idmap_error_code sss_idmap_calculate_range(struct sss_idmap_ctx *ctx, */ orig_slice = 0; } else { - /* Hash the domain sid string */ - hash_val = murmurhash3(dom_sid, strlen(dom_sid), 0xdeadbeef); + /* Hash the range identifier string */ + hash_val = murmurhash3(range_id, strlen(range_id), 0xdeadbeef); /* Now get take the modulus of the hash val and the max_slices * to determine its optimal position in the range. @@ -593,13 +593,13 @@ idmap_error_code dom_check_collision(struct idmap_domain_info *dom_list, static char* generate_sec_slice_name(struct sss_idmap_ctx *ctx, - const char *domain_name, uint32_t rid) + const char *domain_sid, uint32_t rid) { const char *SEC_SLICE_NAME_FMT = "%s-%"PRIu32; char *slice_name; int len, len2; - len = snprintf(NULL, 0, SEC_SLICE_NAME_FMT, domain_name, rid); + len = snprintf(NULL, 0, SEC_SLICE_NAME_FMT, domain_sid, rid); if (len <= 0) { return NULL; } @@ -609,7 +609,7 @@ generate_sec_slice_name(struct sss_idmap_ctx *ctx, return NULL; } - len2 = snprintf(slice_name, len + 1, SEC_SLICE_NAME_FMT, domain_name, + len2 = snprintf(slice_name, len + 1, SEC_SLICE_NAME_FMT, domain_sid, rid); if (len != len2) { ctx->free_func(slice_name, ctx->alloc_pvt); |