vishalmishra434 / rpms / openssh

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