diff options
author | Michael Adam <obnox@samba.org> | 2009-02-02 00:35:43 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2009-02-16 09:56:51 +0100 |
commit | e95b16d9b274165ed0dc4a269c781560d667045d (patch) | |
tree | 809d42cefaa701417ccee30e007f27411697625e /source/winbindd/winbindd_user.c | |
parent | b8cb731f563cb3d1bdc3e65da605e8553ce834cb (diff) | |
download | samba-e95b16d9b274165ed0dc4a269c781560d667045d.tar.gz samba-e95b16d9b274165ed0dc4a269c781560d667045d.tar.xz samba-e95b16d9b274165ed0dc4a269c781560d667045d.zip |
s3:winbind_user: move initialization of domain up in winbindd_fill_pwent()
and streamline logic some
Michael
(cherry picked from commit f2acdca4ded8646752d154d55a0ade405f159e17)
Diffstat (limited to 'source/winbindd/winbindd_user.c')
-rw-r--r-- | source/winbindd/winbindd_user.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/source/winbindd/winbindd_user.c b/source/winbindd/winbindd_user.c index 5356e16a74d..2e326430fc1 100644 --- a/source/winbindd/winbindd_user.c +++ b/source/winbindd/winbindd_user.c @@ -80,6 +80,13 @@ static bool winbindd_fill_pwent(TALLOC_CTX *ctx, char *dom_name, char *user_name if (!pw || !dom_name || !user_name) return False; + domain = find_domain_from_name_noinit(dom_name); + if (domain == NULL) { + DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s. " + "Disabling name alias support\n", dom_name)); + nt_status = NT_STATUS_NO_SUCH_DOMAIN; + } + /* Resolve the uid number */ if (!NT_STATUS_IS_OK(idmap_sid_to_uid(dom_name, user_sid, @@ -98,19 +105,10 @@ static bool winbindd_fill_pwent(TALLOC_CTX *ctx, char *dom_name, char *user_name return False; } - strlower_m(user_name); - /* Username */ - domain = find_domain_from_name_noinit(dom_name); - if (domain) { - nt_status = normalize_name_map(ctx, domain, user_name, - &mapped_name); - } else { - DEBUG(5,("winbindd_fill_pwent: Failed to find domain for %s. " - "Disabling name alias support\n", dom_name)); - nt_status = NT_STATUS_NO_SUCH_DOMAIN; - } + strlower_m(user_name); + nt_status = normalize_name_map(ctx, domain, user_name, &mapped_name); /* Basic removal of whitespace */ if (NT_STATUS_IS_OK(nt_status)) { |