[openssh-commits] [openssh] branch master updated: upstream: Use fmprintf instead of logit for challenge-response name and
git+noreply at mindrot.org
git+noreply at mindrot.org
Sat Feb 28 14:55:33 AEDT 2026
This is an automated email from the git hooks/post-receive script.
dtucker pushed a commit to branch master
in repository openssh.
The following commit(s) were added to refs/heads/master by this push:
new c65f4d258 upstream: Use fmprintf instead of logit for challenge-response name and
c65f4d258 is described below
commit c65f4d2586416274e92720c9e1e745422e182488
Author: dtucker at openbsd.org <dtucker at openbsd.org>
AuthorDate: Tue Feb 24 01:50:51 2026 +0000
upstream: Use fmprintf instead of logit for challenge-response name and
info to preserve UTF-8 characters where appropriate. Prompted by github
PR#452, with & ok djm at .
OpenBSD-Commit-ID: e6361242329ec6925571478f60f4739726aad308
---
sshconnect2.c | 26 +++++++++++++++++---------
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/sshconnect2.c b/sshconnect2.c
index a8ad17330..f26637202 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect2.c,v 1.382 2026/02/16 00:45:41 dtucker Exp $ */
+/* $OpenBSD: sshconnect2.c,v 1.383 2026/02/24 01:50:51 dtucker Exp $ */
/*
* Copyright (c) 2000 Markus Friedl. All rights reserved.
* Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -1074,7 +1074,8 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
char *info = NULL, *lang = NULL, *password = NULL, *retype = NULL;
char prompt[256];
const char *host;
- int r;
+ int r, addnl;
+ size_t len;
debug2("input_userauth_passwd_changereq");
@@ -1086,8 +1087,10 @@ input_userauth_passwd_changereq(int type, u_int32_t seqnr, struct ssh *ssh)
if ((r = sshpkt_get_cstring(ssh, &info, NULL)) != 0 ||
(r = sshpkt_get_cstring(ssh, &lang, NULL)) != 0)
goto out;
- if (strlen(info) > 0)
- logit("%s", info);
+ if ((len = strlen(info)) > 0) {
+ addnl = info[len] != '\n';
+ fmprintf(stderr, "%s%s", info, addnl ? "\n" : "");
+ }
if ((r = sshpkt_start(ssh, SSH2_MSG_USERAUTH_REQUEST)) != 0 ||
(r = sshpkt_put_cstring(ssh, authctxt->server_user)) != 0 ||
(r = sshpkt_put_cstring(ssh, authctxt->service)) != 0 ||
@@ -1942,7 +1945,8 @@ input_userauth_info_req(int type, u_int32_t seq, struct ssh *ssh)
char *display_prompt = NULL, *response = NULL;
u_char echo = 0;
u_int num_prompts, i;
- int r;
+ int r, addnl;
+ size_t len;
debug2_f("entering");
@@ -1955,10 +1959,14 @@ input_userauth_info_req(int type, u_int32_t seq, struct ssh *ssh)
(r = sshpkt_get_cstring(ssh, &inst, NULL)) != 0 ||
(r = sshpkt_get_cstring(ssh, &lang, NULL)) != 0)
goto out;
- if (strlen(name) > 0)
- logit("%s", name);
- if (strlen(inst) > 0)
- logit("%s", inst);
+ if ((len = strlen(name)) > 0) {
+ addnl = name[len] != '\n';
+ fmprintf(stderr, "%s%s", name, addnl ? "\n" : "");
+ }
+ if ((len = strlen(inst)) > 0) {
+ addnl = inst[len] != '\n';
+ fmprintf(stderr, "%s%s", inst, addnl ? "\n" : "");
+ }
if ((r = sshpkt_get_u32(ssh, &num_prompts)) != 0)
goto out;
--
To stop receiving notification emails like this one, please contact
djm at mindrot.org.
More information about the openssh-commits
mailing list