summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_user.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/winbindd/winbindd_user.c')
-rw-r--r--source3/winbindd/winbindd_user.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c
index 5356e16a74..62fd4d7f07 100644
--- a/source3/winbindd/winbindd_user.c
+++ b/source3/winbindd/winbindd_user.c
@@ -80,9 +80,17 @@ 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,
+ if (!NT_STATUS_IS_OK(idmap_sid_to_uid(domain->have_idmap_config ?
+ dom_name : "", user_sid,
&pw->pw_uid))) {
DEBUG(1, ("error getting user id for sid %s\n",
sid_string_dbg(user_sid)));
@@ -91,26 +99,18 @@ static bool winbindd_fill_pwent(TALLOC_CTX *ctx, char *dom_name, char *user_name
/* Resolve the gid number */
- if (!NT_STATUS_IS_OK(idmap_sid_to_gid(dom_name, group_sid,
+ if (!NT_STATUS_IS_OK(idmap_sid_to_gid(domain->have_idmap_config ?
+ dom_name : "", group_sid,
&pw->pw_gid))) {
DEBUG(1, ("error getting group id for sid %s\n",
sid_string_dbg(group_sid)));
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)) {