~ubuntu-branches/ubuntu/natty/curl/natty

« back to all changes in this revision

Viewing changes to lib/krb4.c

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2009-04-29 11:10:29 UTC
  • mfrom: (3.2.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090429111029-2j5eiyokfw2bw049
Tags: 7.19.4-1ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop build dependencies: stunnel, libdb4.6-dev, libssh2-1-dev
  - Add build-dependency on openssh-server
  - Drop libssh2-1-dev from libcurl4-openssl-dev's Depends.
  - Call automake-1.9 with --add-missing --copy --force
* drop debian/patches/security_CVE-2009-0037.patch 
  - this patch is part of 7.19.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38
38
 * SUCH DAMAGE.
39
39
 *
40
 
 * $Id: krb4.c,v 1.48 2008-05-09 11:27:55 mmarek Exp $
 
40
 * $Id: krb4.c,v 1.51 2008-11-16 12:26:50 bagder Exp $
41
41
 */
42
42
 
43
43
#include "setup.h"
58
58
#endif
59
59
 
60
60
#include "urldata.h"
61
 
#include "base64.h"
 
61
#include "curl_base64.h"
62
62
#include "ftp.h"
63
63
#include "sendf.h"
64
64
#include "krb4.h"
 
65
#include "inet_ntop.h"
65
66
#include "memory.h"
66
67
 
67
 
#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL)
68
 
#include "inet_ntoa_r.h"
69
 
#endif
70
 
 
71
68
/* The last #include file should be: */
72
69
#include "memdebug.h"
73
70
 
156
153
{
157
154
  struct krb4_data *d = app_data;
158
155
  *to = malloc(length + 31);
 
156
  if(!*to)
 
157
    return -1;
159
158
  if(level == prot_safe)
160
159
    /* NOTE that the void* cast is safe, krb_mk_safe/priv don't modify the
161
160
     * input buffer
242
241
                 krb_realmofhost(host));
243
242
    else {
244
243
      if(natAddr.s_addr != localaddr->sin_addr.s_addr) {
245
 
#ifdef HAVE_INET_NTOA_R
246
 
        char ntoa_buf[64];
247
 
        char *ip = (char *)inet_ntoa_r(natAddr, ntoa_buf, sizeof(ntoa_buf));
248
 
#else
249
 
        char *ip = (char *)inet_ntoa(natAddr);
250
 
#endif
251
 
        infof(data, "Using NAT IP address (%s) for kerberos 4\n", ip);
 
244
        char addr_buf[128];
 
245
        if(Curl_inet_ntop(AF_INET, natAddr, addr_buf, sizeof(addr_buf)))
 
246
          infof(data, "Using NAT IP address (%s) for kerberos 4\n", addr_buf);
252
247
        localaddr->sin_addr = natAddr;
253
248
      }
254
249
    }