From b9d1f2e025035a63ed177365e46f4e9251e70069 Mon Sep 17 00:00:00 2001 From: David Levine Date: Sun, 28 Apr 2013 14:59:34 -0500 Subject: [PATCH 1/1] Fix to commit af429a902add614e35cd76d15172a4ccb70a3be1 to use the user found by nmh_get_credentials() in sm_auth_sasl(). --- mts/smtp/smtp.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mts/smtp/smtp.c b/mts/smtp/smtp.c index 231bdaef..98c20d83 100644 --- a/mts/smtp/smtp.c +++ b/mts/smtp/smtp.c @@ -854,11 +854,12 @@ sm_auth_sasl(char *user, int saslssf, char *mechlist, char *inhost) strncpy(host, inhost, sizeof(host) - 1); } - callbacks[SM_SASL_N_CB_USER].context = user; - callbacks[SM_SASL_N_CB_AUTHNAME].context = user; - nmh_get_credentials (host, user, 1, &creds); + /* It's OK to copy the creds pointers here. The callbacks that + use them will only be called before this function returns. */ + callbacks[SM_SASL_N_CB_USER].context = creds.user; + callbacks[SM_SASL_N_CB_AUTHNAME].context = creds.user; sasl_pw_context[0] = host; sasl_pw_context[1] = creds.user; sasl_pw_context[2] = creds.password; -- 2.48.1