[nginx] Mail: fixed EXTERNAL auth to clear s->passwd.

Maxim Dounin mdounin at mdounin.ru
Mon Jun 3 15:16:21 UTC 2024


details:   http://freenginx.org/hg/nginx/rev/f83cb031a4a4
branches:  
changeset: 9288:f83cb031a4a4
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Mon Jun 03 18:03:07 2024 +0300
description:
Mail: fixed EXTERNAL auth to clear s->passwd.

The s->passwd field might be set after previous (failed) authentication
in the same session, and since EXTERNAL authentication did not touch it,
it was sent to the auth server.

diffstat:

 src/mail/ngx_mail_handler.c |  2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diffs (12 lines):

diff --git a/src/mail/ngx_mail_handler.c b/src/mail/ngx_mail_handler.c
--- a/src/mail/ngx_mail_handler.c
+++ b/src/mail/ngx_mail_handler.c
@@ -744,6 +744,8 @@ ngx_mail_auth_external(ngx_mail_session_
     s->login.len = external.len;
     s->login.data = external.data;
 
+    ngx_str_null(&s->passwd);
+
     ngx_log_debug1(NGX_LOG_DEBUG_MAIL, c->log, 0,
                    "mail auth external: \"%V\"", &s->login);
 



More information about the nginx-devel mailing list