/* Parse domain and username */
- if (!canonicalize_username(state->request->data.ccache_ntlm_auth.user,
- name_domain, name_user)) {
+ ok = canonicalize_username(state->request->data.ccache_ntlm_auth.user,
+ name_namespace,
+ name_domain,
+ name_user);
+ if (!ok) {
DEBUG(5,("winbindd_ccache_ntlm_auth: cannot parse domain and user from name [%s]\n",
state->request->data.ccache_ntlm_auth.user));
request_error(state);
void winbindd_ccache_save(struct winbindd_cli_state *state)
{
struct winbindd_domain *domain;
- fstring name_domain, name_user;
+ fstring name_namespace, name_domain, name_user;
NTSTATUS status;
+ bool ok;
/* Ensure null termination */
state->request->data.ccache_save.user[
/* Parse domain and username */
- if (!canonicalize_username(state->request->data.ccache_save.user,
- name_domain, name_user)) {
+ ok = canonicalize_username(state->request->data.ccache_save.user,
+ name_namespace,
+ name_domain,
+ name_user);
+ if (!ok) {
DEBUG(5,("winbindd_ccache_save: cannot parse domain and user "
"from name [%s]\n",
state->request->data.ccache_save.user));
struct tevent_req *req, *subreq;
struct winbindd_pam_auth_state *state;
struct winbindd_domain *domain;
- fstring name_domain, name_user;
+ fstring name_namespace, name_domain, name_user;
char *mapped = NULL;
NTSTATUS status;
+ bool ok;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_pam_auth_state);
fstrcpy(request->data.auth.user, mapped);
}
- if (!canonicalize_username(request->data.auth.user, name_domain, name_user)) {
+ ok = canonicalize_username(request->data.auth.user,
+ name_namespace,
+ name_domain,
+ name_user);
+ if (!ok) {
tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
return tevent_req_post(req, ev);
}
- domain = find_auth_domain(request->flags, name_domain);
+ domain = find_auth_domain(request->flags, name_namespace);
if (domain == NULL) {
tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
return tevent_req_post(req, ev);
struct tevent_req *req, *subreq;
struct winbindd_pam_chauthtok_state *state;
struct winbindd_domain *contact_domain;
- fstring domain, user;
+ fstring namespace, domain, user;
char *mapped_user;
NTSTATUS status;
+ bool ok;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_pam_chauthtok_state);
fstrcpy(request->data.chauthtok.user, mapped_user);
}
- if (!canonicalize_username(request->data.chauthtok.user, domain,
- user)) {
+ ok = canonicalize_username(request->data.chauthtok.user,
+ namespace,
+ domain,
+ user);
+ if (!ok) {
DEBUG(10, ("winbindd_pam_chauthtok: canonicalize_username %s "
"failed with\n", request->data.chauthtok.user));
tevent_req_nterror(req, NT_STATUS_NO_SUCH_USER);
return tevent_req_post(req, ev);
}
- contact_domain = find_domain_from_name(domain);
+ contact_domain = find_domain_from_name(namespace);
if (contact_domain == NULL) {
DEBUG(3, ("Cannot change password for [%s] -> [%s]\\[%s] "
"as %s is not a trusted domain\n",
struct tevent_req *req, *subreq;
struct winbindd_pam_logoff_state *state;
struct winbindd_domain *domain;
- fstring name_domain, user;
+ fstring name_namespace, name_domain, user;
uid_t caller_uid;
gid_t caller_gid;
int res;
+ bool ok;
req = tevent_req_create(mem_ctx, &state,
struct winbindd_pam_logoff_state);
goto failed;
}
- if (!canonicalize_username(request->data.logoff.user, name_domain,
- user)) {
+ ok = canonicalize_username(request->data.logoff.user,
+ name_namespace,
+ name_domain,
+ user);
+ if (!ok) {
goto failed;
}
- domain = find_auth_domain(request->flags, name_domain);
+ domain = find_auth_domain(request->flags, name_namespace);
if (domain == NULL) {
goto failed;
}
fstring namespace,
fstring domain,
fstring user);
-bool canonicalize_username(fstring username_inout, fstring domain, fstring user);
+bool canonicalize_username(fstring username_inout,
+ fstring namespace,
+ fstring domain,
+ fstring user);
void fill_domain_username(fstring name, const char *domain, const char *user, bool can_assume);
char *fill_domain_username_talloc(TALLOC_CTX *ctx,
const char *domain,
really should be changed to use this instead of doing things
by hand. JRA. */
-bool canonicalize_username(fstring username_inout, fstring domain, fstring user)
+bool canonicalize_username(fstring username_inout,
+ fstring namespace,
+ fstring domain,
+ fstring user)
{
- fstring namespace;
bool ok;
ok = parse_domain_user(username_inout, namespace, domain, user);