diff options
Diffstat (limited to 'source3/winbindd/winbindd_user.c')
-rw-r--r-- | source3/winbindd/winbindd_user.c | 97 |
1 files changed, 0 insertions, 97 deletions
diff --git a/source3/winbindd/winbindd_user.c b/source3/winbindd/winbindd_user.c index b1591475ac..4778289aa8 100644 --- a/source3/winbindd/winbindd_user.c +++ b/source3/winbindd/winbindd_user.c @@ -417,103 +417,6 @@ static void getpwsid_sid2gid_recv(void *private_data, bool success, gid_t gid) /* Return a password structure from a username. */ -static void getpwnam_name2sid_recv(void *private_data, bool success, - const DOM_SID *sid, enum lsa_SidType type); - -void winbindd_getpwnam(struct winbindd_cli_state *state) -{ - struct winbindd_domain *domain; - fstring domname, username; - char *mapped_user = NULL; - char *domuser; - NTSTATUS nt_status = NT_STATUS_UNSUCCESSFUL; - - domuser = state->request->data.username; - - /* Ensure null termination (it's an fstring) */ - domuser[sizeof(state->request->data.username)-1] = '\0'; - - DEBUG(3, ("[%5lu]: getpwnam %s\n", - (unsigned long)state->pid, - domuser)); - - nt_status = normalize_name_unmap(state->mem_ctx, domuser, - &mapped_user); - - /* If we could not convert from an aliased name or a - normalized name, then just use the original name */ - - if (!NT_STATUS_IS_OK(nt_status) && - !NT_STATUS_EQUAL(nt_status, NT_STATUS_FILE_RENAMED)) - { - mapped_user = domuser; - } - - if (!parse_domain_user(mapped_user, domname, username)) { - DEBUG(5, ("Could not parse domain user: %s\n", domuser)); - request_error(state); - return; - } - - /* Get info for the domain */ - - domain = find_domain_from_name_noinit(domname); - - if (domain == NULL) { - DEBUG(7, ("could not find domain entry for domain %s. " - "Using primary domain\n", domname)); - domain = find_our_domain(); - if (domain == NULL) { - DEBUG(0, ("Cannot find my primary domain " - "structure!\n")); - request_error(state); - return; - } - } - - if (strequal(domname, lp_workgroup()) && - lp_winbind_trusted_domains_only() ) { - DEBUG(7,("winbindd_getpwnam: My domain -- " - "rejecting getpwnam() for %s\\%s.\n", - domname, username)); - request_error(state); - return; - } - - /* Get rid and name type from name. The following costs 1 packet */ - - winbindd_lookupname_async(state->mem_ctx, domname, username, - getpwnam_name2sid_recv, WINBINDD_GETPWNAM, - state); -} - -static void getpwnam_name2sid_recv(void *private_data, bool success, - const DOM_SID *sid, enum lsa_SidType type) -{ - struct winbindd_cli_state *state = - (struct winbindd_cli_state *)private_data; - fstring domname, username; - char *domuser = state->request->data.username; - - if (!success) { - DEBUG(5, ("Could not lookup name for user %s\n", domuser)); - request_error(state); - return; - } - - if ((type != SID_NAME_USER) && (type != SID_NAME_COMPUTER)) { - DEBUG(5, ("%s is not a user\n", domuser)); - request_error(state); - return; - } - - if (parse_domain_user(domuser, domname, username)) { - check_domain_trusted(domname, sid); - } - - getpwsid_queryuser(state, sid); -} - static void getpwuid_recv(void *private_data, bool success, const char *sid) { struct winbindd_cli_state *state = |