diff options
author | Daniel Stenberg <daniel@haxx.se> | 2007-07-06 22:14:29 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2007-07-06 22:14:29 +0000 |
commit | 74ad8516d713b208b54cee4abd0bc19cfb4a4307 (patch) | |
tree | f8e0eb4b2404c5617e20fe789a698fcd1daa155a | |
parent | ed4a16dbd167234fb593ac5c83cf67311555e64a (diff) |
Thomas J. Moore made it build with less warnings
-rw-r--r-- | lib/krb5.c | 31 | ||||
-rw-r--r-- | lib/security.c | 4 |
2 files changed, 10 insertions, 25 deletions
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 <mhe@stacken.kth.se> for - * use in Curl. His latest changes were done 2000-09-18. - * - * It has since been patched away like a madman by Daniel Stenberg - * <daniel@haxx.se> 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 <gssapi/gssapi_generic.h> #include <gssapi/gssapi_krb5.h> -#ifdef HAVE_UNISTD_H -#include <unistd.h> /* 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); diff --git a/lib/security.c b/lib/security.c index 5aa6ebfb5..cd644e596 100644 --- a/lib/security.c +++ b/lib/security.c @@ -129,9 +129,9 @@ block_read(int fd, void *buf, size_t len) } static int -block_write(int fd, void *buf, size_t len) +block_write(int fd, const void *buf, size_t len) { - unsigned char *p = buf; + const unsigned char *p = buf; int b; while(len) { b = write(fd, p, len); |