diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-04-16 14:52:01 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-04-17 13:59:17 +0200 |
commit | 02bb3d36c01d61fd7f4246b968f966dfe4b75e4c (patch) | |
tree | 5292d0e2b576aece0c115406205037455fa5962c /src | |
parent | f424902e9e6c0fb6cae309bef0ce208b13733fb6 (diff) | |
download | sssd-02bb3d36c01d61fd7f4246b968f966dfe4b75e4c.tar.gz sssd-02bb3d36c01d61fd7f4246b968f966dfe4b75e4c.tar.xz sssd-02bb3d36c01d61fd7f4246b968f966dfe4b75e4c.zip |
Minor fixes for sss_parse_name_for_domains
- use brackets after an if
- use the right variable name (candidate_domain instead of
candidate_name).
- fix a typo in a debug message
- only print a debug message about using a default domain when using a
default domain
- add a comment explaning when is a codepath executed
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/util/usertools.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/util/usertools.c b/src/util/usertools.c index 51927393d..ea2123061 100644 --- a/src/util/usertools.c +++ b/src/util/usertools.c @@ -393,8 +393,9 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, int ret; tmp_ctx = talloc_new(NULL); - if (tmp_ctx == NULL) + if (tmp_ctx == NULL) { return ENOMEM; + } rname = NULL; rdomain = NULL; @@ -433,7 +434,7 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, } rname = nmatch; break; - } else if (candidate_name == NULL) { + } else if (candidate_domain == NULL) { candidate_domain = dmatch; } } @@ -465,18 +466,22 @@ int sss_parse_name_for_domains(TALLOC_CTX *memctx, } if (match == NULL) { DEBUG(SSSDBG_FUNC_DATA, "default domain [%s] is currently " \ - "not know, trying to look it up.\n", - rdomain); + "not known, trying to look it up.\n", + rdomain); *domain = talloc_steal(memctx, rdomain); ret = EAGAIN; goto done; } + DEBUG(SSSDBG_FUNC_DATA, "using default domain [%s]\n", rdomain); } - DEBUG(SSSDBG_FUNC_DATA, "using default domain [%s]\n", rdomain); - rname = candidate_name; } else if (candidate_domain) { + /* This branch is taken when the input matches the configured + * regular expression, but the domain is now known. Normally, this + * is the case with a FQDN of a user from subdomain that was not + * yet discovered + */ *domain = talloc_steal(memctx, candidate_domain); ret = EAGAIN; goto done; |