rcolebaugh / rpms / openssh

Forked from rpms/openssh 2 years ago
Clone

Blame SOURCES/openssh-6.6.1p1-NI_MAXHOST.patch

017ff1
diff --git a/ChangeLog b/ChangeLog
017ff1
index 928999d..3887495 100644
017ff1
--- a/ChangeLog
017ff1
+++ b/ChangeLog
017ff1
@@ -1,3 +1,10 @@
017ff1
+20140703
017ff1
+ - OpenBSD CVS Sync
017ff1
+   - djm@cvs.openbsd.org 2014/07/03 03:34:09
017ff1
+     [gss-serv.c session.c ssh-keygen.c]
017ff1
+     standardise on NI_MAXHOST for gethostname() string lengths; about
017ff1
+     1/2 the cases were using it already. Fixes bz#2239 en passant
017ff1
+
017ff1
 20140420
017ff1
  - (djm) [bufaux.c compat.c compat.h sshconnect2.c sshd.c version.h]
017ff1
    OpenSSH 6.5 and 6.6 sometimes encode a value used in the curve25519
017ff1
diff --git a/gss-serv.c b/gss-serv.c
017ff1
index 14f540e..29916d3 100644
017ff1
--- a/gss-serv.c
017ff1
+++ b/gss-serv.c
017ff1
@@ -1,4 +1,4 @@
017ff1
-/* $OpenBSD: gss-serv.c,v 1.26 2014/02/26 20:28:44 djm Exp $ */
017ff1
+/* $OpenBSD: gss-serv.c,v 1.27 2014/07/03 03:34:09 djm Exp $ */
017ff1
 
017ff1
 /*
017ff1
  * Copyright (c) 2001-2003 Simon Wilkinson. All rights reserved.
017ff1
@@ -102,14 +102,14 @@ static OM_uint32
017ff1
 ssh_gssapi_acquire_cred(Gssctxt *ctx)
017ff1
 {
017ff1
 	OM_uint32 status;
017ff1
-	char lname[MAXHOSTNAMELEN];
017ff1
+	char lname[NI_MAXHOST];
017ff1
 	gss_OID_set oidset;
017ff1
 
017ff1
 	if (options.gss_strict_acceptor) {
017ff1
 		gss_create_empty_oid_set(&status, &oidset);
017ff1
 		gss_add_oid_set_member(&status, ctx->oid, &oidset);
017ff1
 
017ff1
-		if (gethostname(lname, MAXHOSTNAMELEN)) {
017ff1
+		if (gethostname(lname, sizeof(lname))) {
017ff1
 			gss_release_oid_set(&status, &oidset);
017ff1
 			return (-1);
017ff1
 		}
017ff1
diff --git a/session.c b/session.c
017ff1
index ba4589b..e4add93 100644
017ff1
--- a/session.c
017ff1
+++ b/session.c
017ff1
@@ -49,6 +49,7 @@
017ff1
 #include <errno.h>
017ff1
 #include <fcntl.h>
017ff1
 #include <grp.h>
017ff1
+#include <netdb.h>
017ff1
 #ifdef HAVE_PATHS_H
017ff1
 #include <paths.h>
017ff1
 #endif
017ff1
@@ -2669,7 +2670,7 @@ session_setup_x11fwd(Session *s)
017ff1
 {
017ff1
 	struct stat st;
017ff1
 	char display[512], auth_display[512];
017ff1
-	char hostname[MAXHOSTNAMELEN];
017ff1
+	char hostname[NI_MAXHOST];
017ff1
 	u_int i;
017ff1
 
017ff1
 	if (no_x11_forwarding_flag) {
017ff1
diff --git a/ssh-keygen.c b/ssh-keygen.c
017ff1
index 482dc1c..66198e6 100644
017ff1
--- a/ssh-keygen.c
017ff1
+++ b/ssh-keygen.c
017ff1
@@ -165,7 +165,7 @@ int rounds = 0;
017ff1
 /* argv0 */
017ff1
 extern char *__progname;
017ff1
 
017ff1
-char hostname[MAXHOSTNAMELEN];
017ff1
+char hostname[NI_MAXHOST];
017ff1
 
017ff1
 /* moduli.c */
017ff1
 int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);