summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/usertools.c9
-rw-r--r--src/util/util.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c
index 738ac62d..64e8b103 100644
--- a/src/util/usertools.c
+++ b/src/util/usertools.c
@@ -173,3 +173,12 @@ int sss_parse_name(TALLOC_CTX *memctx,
return EOK;
}
+
+char *
+sss_get_cased_name(TALLOC_CTX *mem_ctx,
+ const char *orig_name,
+ bool case_sensitive)
+{
+ return case_sensitive ? talloc_strdup(mem_ctx, orig_name) :
+ sss_tc_utf8_str_tolower(mem_ctx, orig_name);
+}
diff --git a/src/util/util.h b/src/util/util.h
index 4ff112b7..5428f0af 100644
--- a/src/util/util.h
+++ b/src/util/util.h
@@ -401,6 +401,10 @@ int sss_parse_name(TALLOC_CTX *memctx,
struct sss_names_ctx *snctx,
const char *orig, char **domain, char **name);
+char *
+sss_get_cased_name(TALLOC_CTX *mem_ctx, const char *orig_name,
+ bool case_sensitive);
+
/* from backup-file.c */
int backup_file(const char *src, int dbglvl);