summaryrefslogtreecommitdiff
path: root/source3/nsswitch/winbindd_pam.c
diff options
context:
space:
mode:
authorTim Potter <tpot@samba.org>2003-08-12 00:46:15 +0000
committerTim Potter <tpot@samba.org>2003-08-12 00:46:15 +0000
commitdffd0f379fdbb74533ceab18d199302f3b15a7c9 (patch)
tree07fe79a13ddd865a2fa1b2010525e6bda2fe0557 /source3/nsswitch/winbindd_pam.c
parent102de75a7ca4055dee21610061429e100cfc5699 (diff)
downloadsamba-dffd0f379fdbb74533ceab18d199302f3b15a7c9.tar.gz
samba-dffd0f379fdbb74533ceab18d199302f3b15a7c9.tar.bz2
samba-dffd0f379fdbb74533ceab18d199302f3b15a7c9.zip
Fix for bug 269. Change wbinfo and ntlm_auth to convert domain, username
and workstation to utf8 before sending the winbindd request. Also, don't continue when the call to pull_utf8() fails but rather return a winbind error. (This is what was causing the crash) (This used to be commit ca1c463360b75538a93b56a87cbb4a6ee7b6cec6)
Diffstat (limited to 'source3/nsswitch/winbindd_pam.c')
-rw-r--r--source3/nsswitch/winbindd_pam.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/source3/nsswitch/winbindd_pam.c b/source3/nsswitch/winbindd_pam.c
index a8908487c1..a89c7ca065 100644
--- a/source3/nsswitch/winbindd_pam.c
+++ b/source3/nsswitch/winbindd_pam.c
@@ -226,10 +226,8 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
}
/* Ensure null termination */
- state->request.data.auth_crap.user[sizeof(state->request.data.auth_crap.user)-1]='\0';
-
- /* Ensure null termination */
- state->request.data.auth_crap.domain[sizeof(state->request.data.auth_crap.domain)-1]='\0';
+ state->request.data.auth_crap.user[sizeof(state->request.data.auth_crap.user)-1]=0;
+ state->request.data.auth_crap.domain[sizeof(state->request.data.auth_crap.domain)-1]=0;
if (!(mem_ctx = talloc_init("winbind pam auth crap for (utf8) %s", state->request.data.auth_crap.user))) {
DEBUG(0, ("winbindd_pam_auth_crap: could not talloc_init()!\n"));
@@ -239,12 +237,16 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
if (pull_utf8_talloc(mem_ctx, &user, state->request.data.auth_crap.user) == (size_t)-1) {
DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
}
if (*state->request.data.auth_crap.domain) {
char *dom = NULL;
if (pull_utf8_talloc(mem_ctx, &dom, state->request.data.auth_crap.domain) == (size_t)-1) {
DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
}
domain = dom;
} else if (lp_winbind_use_default_domain()) {
@@ -268,6 +270,8 @@ enum winbindd_result winbindd_pam_auth_crap(struct winbindd_cli_state *state)
char *wrk = NULL;
if (pull_utf8_talloc(mem_ctx, &wrk, state->request.data.auth_crap.workstation) == (size_t)-1) {
DEBUG(0, ("winbindd_pam_auth_crap: pull_utf8_talloc failed!\n"));
+ result = NT_STATUS_UNSUCCESSFUL;
+ goto done;
}
workstation = wrk;
} else {