summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ssh.c5
-rw-r--r--sshconnect2.c21
2 files changed, 12 insertions, 14 deletions
diff --git a/ssh.c b/ssh.c
index 4e4ff610d..03a23fb6a 100644
--- a/ssh.c
+++ b/ssh.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh.c,v 1.444 2016/07/16 06:57:55 jmc Exp $ */ 1/* $OpenBSD: ssh.c,v 1.445 2016/07/17 04:20:16 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -67,6 +67,7 @@
67#include <string.h> 67#include <string.h>
68#include <unistd.h> 68#include <unistd.h>
69#include <limits.h> 69#include <limits.h>
70#include <locale.h>
70 71
71#include <netinet/in.h> 72#include <netinet/in.h>
72#include <arpa/inet.h> 73#include <arpa/inet.h>
@@ -592,6 +593,8 @@ main(int ac, char **av)
592 */ 593 */
593 umask(022); 594 umask(022);
594 595
596 setlocale(LC_CTYPE, "");
597
595 /* 598 /*
596 * Initialize option structure to indicate that no values have been 599 * Initialize option structure to indicate that no values have been
597 * set. 600 * set.
diff --git a/sshconnect2.c b/sshconnect2.c
index 3d3c7bf42..6742a318c 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshconnect2.c,v 1.245 2016/05/24 04:43:45 dtucker Exp $ */ 1/* $OpenBSD: sshconnect2.c,v 1.246 2016/07/17 04:20:16 djm Exp $ */
2/* 2/*
3 * Copyright (c) 2000 Markus Friedl. All rights reserved. 3 * Copyright (c) 2000 Markus Friedl. All rights reserved.
4 * Copyright (c) 2008 Damien Miller. All rights reserved. 4 * Copyright (c) 2008 Damien Miller. All rights reserved.
@@ -71,6 +71,7 @@
71#include "uidswap.h" 71#include "uidswap.h"
72#include "hostfile.h" 72#include "hostfile.h"
73#include "ssherr.h" 73#include "ssherr.h"
74#include "utf8.h"
74 75
75#ifdef GSSAPI 76#ifdef GSSAPI
76#include "ssh-gss.h" 77#include "ssh-gss.h"
@@ -495,21 +496,15 @@ input_userauth_error(int type, u_int32_t seq, void *ctxt)
495int 496int
496input_userauth_banner(int type, u_int32_t seq, void *ctxt) 497input_userauth_banner(int type, u_int32_t seq, void *ctxt)
497{ 498{
498 char *msg, *raw, *lang; 499 char *msg, *lang;
499 u_int len; 500 u_int len;
500 501
501 debug3("input_userauth_banner"); 502 debug3("%s", __func__);
502 raw = packet_get_string(&len); 503 msg = packet_get_string(&len);
503 lang = packet_get_string(NULL); 504 lang = packet_get_string(NULL);
504 if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO) { 505 if (len > 0 && options.log_level >= SYSLOG_LEVEL_INFO)
505 if (len > 65536) 506 fmprintf(stderr, "%s", msg);
506 len = 65536; 507 free(msg);
507 msg = xmalloc(len * 4 + 1); /* max expansion from strnvis() */
508 strnvis(msg, raw, len * 4 + 1, VIS_SAFE|VIS_OCTAL|VIS_NOSLASH);
509 fprintf(stderr, "%s", msg);
510 free(msg);
511 }
512 free(raw);
513 free(lang); 508 free(lang);
514 return 0; 509 return 0;
515} 510}