summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2014-07-03 21:24:19 +1000
committerDamien Miller <djm@mindrot.org>2014-07-03 21:24:19 +1000
commite5c0d52ceb575c3db8c313e0b1aa3845943d7ba8 (patch)
tree38dd3c4459b009f696ae99a50b2186e4e1c3cf0e
parentc174a3b7c14e0d178c61219de2aa1110e209950c (diff)
- djm@cvs.openbsd.org 2014/07/03 03:34:09
[gss-serv.c session.c ssh-keygen.c] standardise on NI_MAXHOST for gethostname() string lengths; about 1/2 the cases were using it already. Fixes bz#2239 en passant
-rw-r--r--ChangeLog4
-rw-r--r--gss-serv.c6
-rw-r--r--session.c5
-rw-r--r--ssh-keygen.c4
4 files changed, 12 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 2dabfe251..1b12c37a2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,10 @@
25 use EVP_Digest() for one-shot hash instead of creating, updating, 25 use EVP_Digest() for one-shot hash instead of creating, updating,
26 finalising and destroying a context. 26 finalising and destroying a context.
27 bz#2231, based on patch from Timo Teras 27 bz#2231, based on patch from Timo Teras
28 - djm@cvs.openbsd.org 2014/07/03 03:34:09
29 [gss-serv.c session.c ssh-keygen.c]
30 standardise on NI_MAXHOST for gethostname() string lengths; about
31 1/2 the cases were using it already. Fixes bz#2239 en passant
28 32
2920140702 3320140702
30 - OpenBSD CVS Sync 34 - OpenBSD CVS Sync
diff --git a/gss-serv.c b/gss-serv.c
index e61b37bec..5c599247b 100644
--- a/gss-serv.c
+++ b/gss-serv.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: gss-serv.c,v 1.26 2014/02/26 20:28:44 djm Exp $ */ 1/* $OpenBSD: gss-serv.c,v 1.27 2014/07/03 03:34:09 djm Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved. 4 * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
@@ -97,13 +97,13 @@ static OM_uint32
97ssh_gssapi_acquire_cred(Gssctxt *ctx) 97ssh_gssapi_acquire_cred(Gssctxt *ctx)
98{ 98{
99 OM_uint32 status; 99 OM_uint32 status;
100 char lname[MAXHOSTNAMELEN]; 100 char lname[NI_MAXHOST];
101 gss_OID_set oidset; 101 gss_OID_set oidset;
102 102
103 gss_create_empty_oid_set(&status, &oidset); 103 gss_create_empty_oid_set(&status, &oidset);
104 gss_add_oid_set_member(&status, ctx->oid, &oidset); 104 gss_add_oid_set_member(&status, ctx->oid, &oidset);
105 105
106 if (gethostname(lname, MAXHOSTNAMELEN)) { 106 if (gethostname(lname, sizeof(lname))) {
107 gss_release_oid_set(&status, &oidset); 107 gss_release_oid_set(&status, &oidset);
108 return (-1); 108 return (-1);
109 } 109 }
diff --git a/session.c b/session.c
index 11f2571e0..821867d59 100644
--- a/session.c
+++ b/session.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: session.c,v 1.271 2014/03/03 22:22:30 djm Exp $ */ 1/* $OpenBSD: session.c,v 1.272 2014/07/03 03:34:09 djm Exp $ */
2/* 2/*
3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 3 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 * All rights reserved 4 * All rights reserved
@@ -49,6 +49,7 @@
49#include <errno.h> 49#include <errno.h>
50#include <fcntl.h> 50#include <fcntl.h>
51#include <grp.h> 51#include <grp.h>
52#include <netdb.h>
52#ifdef HAVE_PATHS_H 53#ifdef HAVE_PATHS_H
53#include <paths.h> 54#include <paths.h>
54#endif 55#endif
@@ -2653,7 +2654,7 @@ session_setup_x11fwd(Session *s)
2653{ 2654{
2654 struct stat st; 2655 struct stat st;
2655 char display[512], auth_display[512]; 2656 char display[512], auth_display[512];
2656 char hostname[MAXHOSTNAMELEN]; 2657 char hostname[NI_MAXHOST];
2657 u_int i; 2658 u_int i;
2658 2659
2659 if (no_x11_forwarding_flag) { 2660 if (no_x11_forwarding_flag) {
diff --git a/ssh-keygen.c b/ssh-keygen.c
index e2aa215b2..0ec615fd6 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.247 2014/06/24 01:13:21 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.248 2014/07/03 03:34:09 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -165,7 +165,7 @@ int rounds = 0;
165/* argv0 */ 165/* argv0 */
166extern char *__progname; 166extern char *__progname;
167 167
168char hostname[MAXHOSTNAMELEN]; 168char hostname[NI_MAXHOST];
169 169
170/* moduli.c */ 170/* moduli.c */
171int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *); 171int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);