diff --git a/debian/changelog b/debian/changelog index 5af6215..7b27169 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +openssh (1:9.9p2-0deepin6) unstable; urgency=medium + + * fix duplicate output. + + -- xinpeng.wang Fri, 15 May 2026 16:27:44 +0800 + openssh (1:9.9p2-0deepin5) unstable; urgency=medium * Apply patches from upstream: diff --git a/debian/patches/series b/debian/patches/series index 3f86ef0..bfb88f6 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -37,3 +37,4 @@ add-sm-support.patch 0035-upstream-Improve-rules-for-expansion-of-username.patch 0036-upstream-don-t-allow-0-characters-in-url-encoded-str.patch 0037-Add-more-username-validity-checks.patch +uniontech-fix-duplicate-loginmsg.patch diff --git a/debian/patches/uniontech-fix-duplicate-loginmsg.patch b/debian/patches/uniontech-fix-duplicate-loginmsg.patch new file mode 100644 index 0000000..a0d65c3 --- /dev/null +++ b/debian/patches/uniontech-fix-duplicate-loginmsg.patch @@ -0,0 +1,32 @@ +From: Lu Peilong +Subject: [PATCH] Fix duplicate PAM Text Info message on SSH login + +Bug: 333423 + +Root cause: +In privilege separation mode, the monitor process sends loginmsg +(PAM_TEXT_INFO) to the child process twice: + +1. mm_answer_pam_account() sends loginmsg via MONITOR_ANS_PAM_ACCOUNT + (used as SSH2_MSG_USERAUTH_BANNER during auth phase) +2. mm_answer_pty() sends loginmsg again during session setup + (displayed via PTY by display_loginmsg() in session.c) + +After mm_answer_pam_account() sends the loginmsg, it does not reset +the buffer, so the PTY setup sends the same content again, resulting +in duplicate "验证成功" messages on the client. + +Fix: +Add sshbuf_reset(loginmsg) after mm_request_send() in +mm_answer_pam_account() so the message is only sent once. + +--- a/monitor.c ++++ b/monitor.c +@@ -1085,6 +1085,7 @@ mm_answer_pam_account(struct ssh *ssh, int sock, struct sshbuf *m) + fatal("%s: buffer error: %s", __func__, ssh_err(r)); + + mm_request_send(sock, MONITOR_ANS_PAM_ACCOUNT, m); ++ sshbuf_reset(loginmsg); + + return (ret); + }