From 74ad8516d713b208b54cee4abd0bc19cfb4a4307 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Fri, 6 Jul 2007 22:14:29 +0000 Subject: Thomas J. Moore made it build with less warnings --- lib/krb5.c | 31 ++++++++----------------------- 1 file changed, 8 insertions(+), 23 deletions(-) (limited to 'lib/krb5.c') diff --git a/lib/krb5.c b/lib/krb5.c index 6655973d4..2c0a16f2a 100644 --- a/lib/krb5.c +++ b/lib/krb5.c @@ -1,11 +1,4 @@ -/* This source code was modified by Martin Hedenfalk for - * use in Curl. His latest changes were done 2000-09-18. - * - * It has since been patched away like a madman by Daniel Stenberg - * to make it better applied to curl conditions, and to make - * it not use globals, pollute name space and more. This source code awaits a - * rewrite to work around the paragraph 2 in the BSD licenses as explained - * below. +/* GSSAPI/krb5 support for FTP - loosely based on old krb4.c * * Copyright (c) 1995, 1996, 1997, 1998, 1999 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). @@ -52,10 +45,6 @@ #include #include -#ifdef HAVE_UNISTD_H -#include /* for getpid() */ -#endif - #include "urldata.h" #include "base64.h" #include "ftp.h" @@ -63,22 +52,15 @@ #include "krb4.h" #include "memory.h" -#if defined(HAVE_INET_NTOA_R) && !defined(HAVE_INET_NTOA_R_DECL) -#include "inet_ntoa_r.h" -#endif - /* The last #include file should be: */ #include "memdebug.h" #define LOCAL_ADDR (&conn->local_addr) #define REMOTE_ADDR conn->ip_addr->ai_addr -#define myctladdr LOCAL_ADDR -#define hisctladdr REMOTE_ADDR static int krb5_check_prot(void *app_data, int level) { - gss_ctx_id_t *context = app_data; app_data = NULL; /* prevent compiler warning */ if(level == prot_confidential) return -1; @@ -93,6 +75,10 @@ krb5_decode(void *app_data, void *buf, int len, int level, OM_uint32 maj, min; gss_buffer_desc enc, dec; + /* shut gcc up */ + level = 0; + conn = NULL; + enc.value = buf; enc.length = len; maj = gss_unseal(&min, *context, &enc, &dec, NULL, NULL); @@ -112,7 +98,6 @@ krb5_decode(void *app_data, void *buf, int len, int level, static int krb5_overhead(void *app_data, int level, int len) { - gss_ctx_id_t *context = app_data; /* no arguments are used, just init them to prevent compiler warnings */ app_data = NULL; level = 0; @@ -130,6 +115,9 @@ krb5_encode(void *app_data, void *from, int length, int level, void **to, int state; int len; + /* shut gcc up */ + conn = NULL; + dec.value = from; dec.length = length; maj = gss_seal(&min, *context, @@ -155,9 +143,6 @@ krb5_auth(void *app_data, struct connectdata *conn) { int ret; char *p; - unsigned char *ptr; - size_t len; - u_int32_t cs; const char *host = conn->dns_entry->addr->ai_canonname; ssize_t nread; unsigned int l = sizeof(conn->local_addr); -- cgit v1.2.3