standardise on NI_MAXHOST for gethostname() string lengths (#1051490)
This commit is contained in:
parent
d75575229f
commit
66d55f7a69
|
@ -0,0 +1,70 @@
|
||||||
|
diff --git a/ChangeLog b/ChangeLog
|
||||||
|
index 55dee98..7bcd596 100644
|
||||||
|
--- a/ChangeLog
|
||||||
|
+++ b/ChangeLog
|
||||||
|
@@ -1,3 +1,10 @@
|
||||||
|
+20140703
|
||||||
|
+ - OpenBSD CVS Sync
|
||||||
|
+ - 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
|
||||||
|
+
|
||||||
|
20140304
|
||||||
|
- OpenBSD CVS Sync
|
||||||
|
- djm@cvs.openbsd.org 2014/03/03 22:22:30
|
||||||
|
diff --git a/gss-serv.c b/gss-serv.c
|
||||||
|
index e533c3a..7e343db 100644
|
||||||
|
--- a/gss-serv.c
|
||||||
|
+++ b/gss-serv.c
|
||||||
|
@@ -83,14 +83,14 @@ static OM_uint32
|
||||||
|
ssh_gssapi_acquire_cred(Gssctxt *ctx)
|
||||||
|
{
|
||||||
|
OM_uint32 status;
|
||||||
|
- char lname[MAXHOSTNAMELEN];
|
||||||
|
+ char lname[NI_MAXHOST];
|
||||||
|
gss_OID_set oidset;
|
||||||
|
|
||||||
|
if (options.gss_strict_acceptor) {
|
||||||
|
gss_create_empty_oid_set(&status, &oidset);
|
||||||
|
gss_add_oid_set_member(&status, ctx->oid, &oidset);
|
||||||
|
|
||||||
|
- if (gethostname(lname, MAXHOSTNAMELEN)) {
|
||||||
|
+ if (gethostname(lname, sizeof(lname))) {
|
||||||
|
gss_release_oid_set(&status, &oidset);
|
||||||
|
return (-1);
|
||||||
|
}
|
||||||
|
diff --git a/session.c b/session.c
|
||||||
|
index f5b6848..86da7cf 100644
|
||||||
|
--- a/session.c
|
||||||
|
+++ b/session.c
|
||||||
|
@@ -49,6 +49,7 @@
|
||||||
|
#include <errno.h>
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <grp.h>
|
||||||
|
+#include <netdb.h>
|
||||||
|
#ifdef HAVE_PATHS_H
|
||||||
|
#include <paths.h>
|
||||||
|
#endif
|
||||||
|
@@ -2697,7 +2698,7 @@ session_setup_x11fwd(Session *s)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
char display[512], auth_display[512];
|
||||||
|
- char hostname[MAXHOSTNAMELEN];
|
||||||
|
+ char hostname[NI_MAXHOST];
|
||||||
|
u_int i;
|
||||||
|
|
||||||
|
if (no_x11_forwarding_flag) {
|
||||||
|
diff --git a/ssh-keygen.c b/ssh-keygen.c
|
||||||
|
index 2569016..1bddd72 100644
|
||||||
|
--- a/ssh-keygen.c
|
||||||
|
+++ b/ssh-keygen.c
|
||||||
|
@@ -153,7 +153,7 @@ char *pkcs11provider = NULL;
|
||||||
|
/* argv0 */
|
||||||
|
extern char *__progname;
|
||||||
|
|
||||||
|
-char hostname[MAXHOSTNAMELEN];
|
||||||
|
+char hostname[NI_MAXHOST];
|
||||||
|
|
||||||
|
/* moduli.c */
|
||||||
|
int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
|
|
@ -195,7 +195,8 @@ Patch907: openssh-6.4p1-CLOCK_BOOTTIME.patch
|
||||||
Patch908: openssh-6.4p1-CVE-2014-2653.patch
|
Patch908: openssh-6.4p1-CVE-2014-2653.patch
|
||||||
# ignore environment variables with embedded '=' or '\0' characters (#1077843)
|
# ignore environment variables with embedded '=' or '\0' characters (#1077843)
|
||||||
Patch909: openssh-6.4p1-ignore-bad-env-var.patch
|
Patch909: openssh-6.4p1-ignore-bad-env-var.patch
|
||||||
|
# standardise on NI_MAXHOST for gethostname() string lengths (#1051490)
|
||||||
|
Patch910: openssh-6.4p1-NI_MAXHOST.patch
|
||||||
|
|
||||||
License: BSD
|
License: BSD
|
||||||
Group: Applications/Internet
|
Group: Applications/Internet
|
||||||
|
@ -423,6 +424,8 @@ popd
|
||||||
%patch907 -p1 -b .CLOCK_BOOTTIME
|
%patch907 -p1 -b .CLOCK_BOOTTIME
|
||||||
%patch908 -p1 -b .CVE-2014-2653
|
%patch908 -p1 -b .CVE-2014-2653
|
||||||
%patch909 -p1 -b .bad-env-var
|
%patch909 -p1 -b .bad-env-var
|
||||||
|
%patch910 -p1 -b .NI_MAXHOST
|
||||||
|
|
||||||
|
|
||||||
%if 0
|
%if 0
|
||||||
# Nothing here yet
|
# Nothing here yet
|
||||||
|
|
Loading…
Reference in New Issue