Bugzilla – Attachment 2448 Details for
Bug 2239
ssh-keygen cannot handle Linux with 64 char long hostname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
use NI_MAXHOST instead of HOSTNAMELEN
hostlen.diff (text/plain), 1.42 KB, created by
Damien Miller
on 2014-07-03 13:03:02 AEST
(
hide
)
Description:
use NI_MAXHOST instead of HOSTNAMELEN
Filename:
MIME Type:
Creator:
Damien Miller
Created:
2014-07-03 13:03:02 AEST
Size:
1.42 KB
patch
obsolete
>diff --git gss-serv.c gss-serv.c >index 8974c5f..d446748 100644 >--- gss-serv.c >+++ gss-serv.c >@@ -93,13 +93,13 @@ static OM_uint32 > ssh_gssapi_acquire_cred(Gssctxt *ctx) > { > OM_uint32 status; >- char lname[MAXHOSTNAMELEN]; >+ char lname[NI_MAXHOST]; > gss_OID_set oidset; > > 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 session.c session.c >index efda3d5..e20d72f 100644 >--- session.c >+++ session.c >@@ -45,6 +45,7 @@ > #include <fcntl.h> > #include <grp.h> > #include <login_cap.h> >+#include <netdb.h> > #include <paths.h> > #include <pwd.h> > #include <signal.h> >@@ -2260,7 +2261,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 ssh-keygen.c ssh-keygen.c >index 3bf4114..6add4ca 100644 >--- ssh-keygen.c >+++ ssh-keygen.c >@@ -22,6 +22,7 @@ > > #include <errno.h> > #include <fcntl.h> >+#include <netdb.h> > #include <pwd.h> > #include <stdio.h> > #include <stdlib.h> >@@ -160,7 +161,7 @@ int rounds = 0; > /* argv0 */ > extern char *__progname; > >-char hostname[MAXHOSTNAMELEN]; >+char hostname[NI_MAXHOST]; > > /* moduli.c */ > int gen_candidates(FILE *, u_int32_t, u_int32_t, BIGNUM *);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 2239
:
2434
| 2448