diff options
author | Ondrej Kos <okos@redhat.com> | 2012-08-21 16:03:32 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2012-08-23 14:25:23 +0200 |
commit | e4c29d1f8e3b2c2b268105f169e5156a0a36aebf (patch) | |
tree | 5e2940d4366e363d993e63a90693282acfffce32 /src/util/usertools.c | |
parent | e523233315f44b8f77ab9c5143a3d80364ebf955 (diff) | |
download | sssd-e4c29d1f8e3b2c2b268105f169e5156a0a36aebf.tar.gz sssd-e4c29d1f8e3b2c2b268105f169e5156a0a36aebf.tar.xz sssd-e4c29d1f8e3b2c2b268105f169e5156a0a36aebf.zip |
Consolidation of functions that make realm upper-case
Diffstat (limited to 'src/util/usertools.c')
-rw-r--r-- | src/util/usertools.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c index 36641d49f..adef2b002 100644 --- a/src/util/usertools.c +++ b/src/util/usertools.c @@ -45,6 +45,27 @@ char *get_username_from_uid(TALLOC_CTX *mem_ctx, uid_t uid) return username; } +/* Function returns given realm name as new uppercase string */ +char *get_uppercase_realm(TALLOC_CTX *memctx, const char *name) +{ + char *realm; + char *c; + + realm = talloc_strdup(memctx, name); + if (!realm) { + return NULL; + } + + c = realm; + while(*c != '\0') { + *c = toupper(*c); + c++; + } + + return realm; +} + + static int sss_names_ctx_destructor(struct sss_names_ctx *snctx) { if (snctx->re) { |