~ubuntu-branches/ubuntu/maverick/krb5/maverick

« back to all changes in this revision

Viewing changes to src/tests/resolve/resolve.c

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hartman
  • Date: 2009-05-07 16:16:34 UTC
  • mfrom: (13.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20090507161634-xqyk0s9na0le4flj
Tags: 1.7dfsg~beta1-4
When  decrypting the TGS response fails with the subkey, try with the
session key to work around Heimdal bug, Closes: #527353 

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
/* This program tests the resolve library and sees if it is broken... */
43
43
 
 
44
#include "autoconf.h"
44
45
#include <stdio.h>
45
46
 
46
47
#if STDC_HEADERS
68
69
#include <unistd.h>
69
70
#endif
70
71
 
 
72
#include <netinet/in.h>
71
73
#include <netdb.h>
72
74
 
73
75
#ifndef MAXHOSTNAMELEN
81
83
{
82
84
        char myname[MAXHOSTNAMELEN+1];
83
85
        char *ptr;
84
 
        char addrcopy[4];
 
86
        struct in_addr addrcopy;
85
87
        struct hostent *host;
86
88
        int quiet = 0;
87
89
 
127
129
            printf("Host address: %d.%d.%d.%d\n", 
128
130
                   UC(ptr[0]), UC(ptr[1]), UC(ptr[2]), UC(ptr[3]));
129
131
 
130
 
        memcpy(addrcopy, ptr, 4);
 
132
        memcpy(&addrcopy.s_addr, ptr, 4);
131
133
 
132
134
        /* Convert back to full name */
133
 
        if((host = gethostbyaddr(addrcopy, 4, AF_INET)) == NULL) {
 
135
        if((host = gethostbyaddr(&addrcopy.s_addr, 4, AF_INET)) == NULL) {
134
136
                fprintf(stderr, "Error looking up IP address - fatal\n");
135
137
                exit(2);
136
138
        }