summaryrefslogtreecommitdiff
path: root/src/responder/nss
diff options
context:
space:
mode:
Diffstat (limited to 'src/responder/nss')
-rw-r--r--src/responder/nss/nsssrv_cmd.c9
-rw-r--r--src/responder/nss/nsssrv_netgroup.c9
2 files changed, 9 insertions, 9 deletions
diff --git a/src/responder/nss/nsssrv_cmd.c b/src/responder/nss/nsssrv_cmd.c
index 0bd2f75e..71c949f1 100644
--- a/src/responder/nss/nsssrv_cmd.c
+++ b/src/responder/nss/nsssrv_cmd.c
@@ -741,8 +741,7 @@ static int nss_cmd_getpwnam_search(struct nss_dom_ctx *dctx)
dctx->domain = dom;
talloc_free(name);
- name = dom->case_sensitive ? talloc_strdup(dctx, cmdctx->name) :
- sss_tc_utf8_str_tolower(dctx, cmdctx->name);
+ name = sss_get_cased_name(dctx, cmdctx->name, dom->case_sensitive);
if (!name) return ENOMEM;
/* verify this user has not yet been negatively cached,
@@ -2033,8 +2032,7 @@ static int nss_cmd_getgrnam_search(struct nss_dom_ctx *dctx)
dctx->domain = dom;
talloc_free(name);
- name = dom->case_sensitive ? talloc_strdup(dctx, cmdctx->name) :
- sss_tc_utf8_str_tolower(dctx, cmdctx->name);
+ name = sss_get_cased_name(dctx, cmdctx->name, dom->case_sensitive);
if (!name) return ENOMEM;
/* verify this group has not yet been negatively cached,
@@ -3104,8 +3102,7 @@ static int nss_cmd_initgroups_search(struct nss_dom_ctx *dctx)
dctx->domain = dom;
talloc_free(name);
- name = dom->case_sensitive ? talloc_strdup(dctx, cmdctx->name) :
- sss_tc_utf8_str_tolower(dctx, cmdctx->name);
+ name = sss_get_cased_name(dctx, cmdctx->name, dom->case_sensitive);
if (!name) return ENOMEM;
/* verify this user has not yet been negatively cached,
diff --git a/src/responder/nss/nsssrv_netgroup.c b/src/responder/nss/nsssrv_netgroup.c
index 39ba4ff7..1b089f71 100644
--- a/src/responder/nss/nsssrv_netgroup.c
+++ b/src/responder/nss/nsssrv_netgroup.c
@@ -402,9 +402,12 @@ static errno_t lookup_netgr_step(struct setent_step_ctx *step_ctx)
step_ctx->dctx->domain = dom;
talloc_free(name);
- name = dom->case_sensitive ? \
- talloc_strdup(step_ctx, step_ctx->name) :
- sss_tc_utf8_str_tolower(step_ctx, step_ctx->name);
+ name = sss_get_cased_name(step_ctx, step_ctx->name,
+ dom->case_sensitive);
+ if (!name) {
+ DEBUG(SSSDBG_CRIT_FAILURE, ("sss_get_cased_name failed\n"));
+ return ENOMEM;
+ }
DEBUG(4, ("Requesting info for [%s@%s]\n",
name, dom->name));