openssh/openssh-do-not-send-empty-message.patch
Marcus Meissner 4038ff6c0f Accepting request 1034974 from home:hpjansson:openssh-tw
- Update openssh-8.1p1-audit.patch: Merge fix for race condition
  (bsc#1115550, bsc#1174162).
- Add openssh-do-not-send-empty-message.patch, which prevents
  superfluous newlines with empty MOTD files (bsc#1192439).

OBS-URL: https://build.opensuse.org/request/show/1034974
OBS-URL: https://build.opensuse.org/package/show/network/openssh?expand=0&rev=242
2022-11-15 15:28:59 +00:00

20 lines
685 B
Diff

--- openssh-8.4p1.orig/auth-pam.c 2020-09-27 09:25:01.000000000 +0200
+++ openssh-8.4p1/auth-pam.c 2022-03-04 13:02:23.447712697 +0100
@@ -638,10 +638,12 @@
switch (PAM_MSG_MEMBER(msg, i, msg_style)) {
case PAM_ERROR_MSG:
case PAM_TEXT_INFO:
- if ((r = sshbuf_putf(loginmsg, "%s\n",
- PAM_MSG_MEMBER(msg, i, msg))) != 0)
- fatal("%s: buffer error: %s",
- __func__, ssh_err(r));
+ if (strlen(PAM_MSG_MEMBER(msg, i, msg)) != 0) {
+ if ((r = sshbuf_putf(loginmsg, "%s\n",
+ PAM_MSG_MEMBER(msg, i, msg))) != 0)
+ fatal("%s: buffer error: %s",
+ __func__, ssh_err(r));
+ }
reply[i].resp_retcode = PAM_SUCCESS;
break;
default: