diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2011-12-21 18:00:25 +0100 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2011-12-21 14:47:41 -0500 |
commit | c7d387aaaa3d3470dec55a5ca0612873e6354ba8 (patch) | |
tree | b78851a84b37efc43b994fa5c45a03fa654ddbed /src/util | |
parent | 6f52db9c8b1081565ffa0543f8c8b470b8375932 (diff) | |
download | sssd-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.c | 9 | ||||
-rw-r--r-- | src/util/util.h | 4 |
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); |