summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorJakub Hrozek <jhrozek@redhat.com>2011-12-21 18:00:25 +0100
committerStephen Gallagher <sgallagh@redhat.com>2011-12-21 14:47:41 -0500
commitc7d387aaaa3d3470dec55a5ca0612873e6354ba8 (patch)
treeb78851a84b37efc43b994fa5c45a03fa654ddbed /src/util
parent6f52db9c8b1081565ffa0543f8c8b470b8375932 (diff)
downloadsssd-c7d387aaaa3d3470dec55a5ca0612873e6354ba8.tar.gz
sssd-c7d387aaaa3d3470dec55a5ca0612873e6354ba8.tar.bz2
sssd-c7d387aaaa3d3470dec55a5ca0612873e6354ba8.zip
sss_get_cased_name utility function
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);