diff options
author | Tom Yu <tlyu@mit.edu> | 2015-12-30 17:17:02 -0500 |
---|---|---|
committer | Tom Yu <tlyu@mit.edu> | 2016-01-06 22:20:29 -0500 |
commit | 0491c778064e80aaf2aaeb4475a0db333542fed9 (patch) | |
tree | b4888c73edc371a80d2e42bfbd96f4d0f035708b /src/appl | |
parent | 40b007c0d8e2a12c6f4205ac111dee731c9d970c (diff) | |
download | krb5-0491c778064e80aaf2aaeb4475a0db333542fed9.zip krb5-0491c778064e80aaf2aaeb4475a0db333542fed9.tar.gz krb5-0491c778064e80aaf2aaeb4475a0db333542fed9.tar.bz2 |
Don't canonicalize hostname in sim_client.c
krb5_mk_req() already canonicalizes the target hostname, so don't try
to use a buffer of size MAXHOSTNAMELEN to canonicalize the hostname
beforehand. This buffer will be too short for some unusually long
FQDNs.
ticket: 8336 (new)
subject: MAXHOSTNAMELEN is too short for some FQDNs
Diffstat (limited to 'src/appl')
-rw-r--r-- | src/appl/simple/client/sim_client.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/src/appl/simple/client/sim_client.c b/src/appl/simple/client/sim_client.c index aaa6446..bd3c38c 100644 --- a/src/appl/simple/client/sim_client.c +++ b/src/appl/simple/client/sim_client.c @@ -67,7 +67,6 @@ main(int argc, char *argv[]) struct servent *serv; struct hostent *host; char *cp; - char full_hname[MAXHOSTNAMELEN]; #ifdef BROKEN_STREAMS_SOCKETS char my_hostname[MAXHOSTNAMELEN]; #endif @@ -145,13 +144,6 @@ main(int argc, char *argv[]) fprintf(stderr, "%s: unknown host\n", hostname); exit(1); } - strncpy(full_hname, host->h_name, sizeof(full_hname)-1); - full_hname[sizeof(full_hname)-1] = '\0'; - - /* lower-case to get name for "instance" part of service name */ - for (cp = full_hname; *cp; cp++) - if (isupper((int) *cp)) - *cp = tolower((int) *cp); /* Set server's address */ (void) memset(&s_sock, 0, sizeof(s_sock)); @@ -212,7 +204,7 @@ main(int argc, char *argv[]) exit(1); } - if ((retval = krb5_mk_req(context, &auth_context, 0, service, full_hname, + if ((retval = krb5_mk_req(context, &auth_context, 0, service, hostname, &inbuf, ccdef, &packet))) { com_err(progname, retval, "while preparing AP_REQ"); exit(1); |