Blob Blame History Raw
diff -ur dcap-2.47.10.orig/configure.ac dcap-2.47.10/configure.ac
--- dcap-2.47.10.orig/configure.ac	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/configure.ac	2016-10-15 12:04:18.665573320 +0200
@@ -130,6 +130,7 @@
 AC_TYPE_SIZE_T
 AC_TYPE_UID_T
 AC_C_BIGENDIAN
+AC_CHECK_TYPES([long long])
 
 
 dnl Store the compile flags prior to testing the presence.
diff -ur dcap-2.47.10.orig/plugins/gssapi/client.c dcap-2.47.10/plugins/gssapi/client.c
--- dcap-2.47.10.orig/plugins/gssapi/client.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/plugins/gssapi/client.c	2016-10-15 12:04:18.665573320 +0200
@@ -28,10 +28,7 @@
 	int             fd;
 	struct sockaddr_in serv_addr;
 	struct hostent *hp;
-	char *secret;
-	int n;
 	char c;
-	char buffer[512];
 
 	if(argc != 3 ) {
 		printf("Usage: %s <host> <port>\n", argv[0]);
diff -ur dcap-2.47.10.orig/plugins/gssapi/gssIoTunnel.c dcap-2.47.10/plugins/gssapi/gssIoTunnel.c
--- dcap-2.47.10.orig/plugins/gssapi/gssIoTunnel.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/plugins/gssapi/gssIoTunnel.c	2016-10-15 12:04:18.666573328 +0200
@@ -492,7 +492,7 @@
 
 		if (output_token.length != 0) {
 			eWrite(sock, output_token.value, output_token.length);
-			printf("sended token %d\n", output_token.length);
+			printf("sended token %lu\n", (unsigned long)output_token.length);
 			gss_release_buffer(&min_stat, &output_token);
 		}
 
diff -ur dcap-2.47.10.orig/plugins/gssapi/tunnelQueue.c dcap-2.47.10/plugins/gssapi/tunnelQueue.c
--- dcap-2.47.10.orig/plugins/gssapi/tunnelQueue.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/plugins/gssapi/tunnelQueue.c	2016-10-15 12:04:15.015547060 +0200
@@ -6,6 +6,7 @@
  *                 DESY Hamburg DMG-Division
  */
 #include "tunnelQueue.h"
+#include <stdlib.h>
 
 
 #define MAX_GSS_CONTEXT 8192
diff -ur dcap-2.47.10.orig/plugins/gssapi/util.c dcap-2.47.10/plugins/gssapi/util.c
--- dcap-2.47.10.orig/plugins/gssapi/util.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/plugins/gssapi/util.c	2016-10-15 12:04:18.666573328 +0200
@@ -25,6 +25,8 @@
 #include <gssapi_generic.h>
 #endif /* MIT_KRB5 */
 
+#include "debug_level.h"
+
 /* workaround for MIT kerberos implementation */
 #ifndef GSS_C_AF_INET6
 #  define GSS_C_AF_INET6 24
diff -ur dcap-2.47.10.orig/plugins/ssl/sslTunnel.c dcap-2.47.10/plugins/ssl/sslTunnel.c
--- dcap-2.47.10.orig/plugins/ssl/sslTunnel.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/plugins/ssl/sslTunnel.c	2016-10-15 12:04:18.667573335 +0200
@@ -146,8 +146,10 @@
 {
 
 	register unsigned int i;
+	/*
 	sslPair * tmp;
 	SSL *ssl_con;
+	*/
 
 	for(i = 0; i < qLen; i++) {
 		if(sslPairArray[i].sock == sock) {
diff -ur dcap-2.47.10.orig/src/dcap.c dcap-2.47.10/src/dcap.c
--- dcap-2.47.10.orig/src/dcap.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap.c	2016-10-15 12:04:18.668573342 +0200
@@ -813,7 +813,7 @@
 #else
 	size_t          addrSize;
 #endif
-	int             bindResult;
+	int             bindResult = -1;
 	int             i;
 
 	*dataFd = socket(AF_INET, SOCK_STREAM, 0);
@@ -833,14 +833,12 @@
 
 
 	/* try to get free slot in range of TCP ports */
-	for( i = 0 ; i < callBackPortRange; i++) {
+	for( i = 0 ; i < callBackPortRange && bindResult < 0; i++) {
 
 		*cbPort += i;
 		me.sin_port = htons(*cbPort + i);
 		addrSize = sizeof(me);
 		bindResult = bind(*dataFd, (struct sockaddr *) & me, addrSize);
-		if( bindResult == 0) break;
-
 	}
 
 	if (bindResult < 0) {
@@ -1274,7 +1272,6 @@
 	u_short         remotePort;
 	char           *hostname;
 	int32_t         sessionId, challengeSize;
-	int             tmp;
 
 	while(1) {
 
@@ -1360,10 +1357,10 @@
 		}
 #endif /* SO_SNDBUF */
 
-		tmp = readn(newFd, (char *) &sessionId, sizeof(sessionId), NULL);
+		readn(newFd, (char *) &sessionId, sizeof(sessionId), NULL);
 		sessionId = ntohl(sessionId);
 
-		tmp = readn(newFd, (char *) &challengeSize, sizeof(challengeSize), NULL);
+		readn(newFd, (char *) &challengeSize, sizeof(challengeSize), NULL);
 		challengeSize = ntohl(challengeSize);
 
 		dc_debug(DC_INFO, "Got callback connection from %s:%d for session %d, myID %d.",
@@ -1417,7 +1414,6 @@
 	asciiMessage *aM;
 	int try = 0;
 	int rc = 0;
-	int err = 0;
 
 	dc_debug(DC_CALLS, "Entered sendDataMessage.");
 again:
@@ -1436,7 +1432,6 @@
 	if( ret < sizeOfMessage ) {
 		dc_debug(DC_ERROR, "sendDataMessage: write message failed => ret = %d.", ret);
 		rc = -1;
-		err = 1;
 		goto end;
 	}
 
@@ -1641,10 +1636,8 @@
    if( (s == NULL) || (getenv("DCACHE_REPLY") != NULL) )
         return;
 
-   if( hostName != NULL )
-        free(hostName);
-
-	dc_debug(DC_INFO, "Binding client callback hostname to %s.", s);
+    dc_debug(DC_INFO, "Binding client callback hostname to %s.", s);
+    free(hostName);
     hostName = (char *)strdup(s);
 }
 
diff -ur dcap-2.47.10.orig/src/dcap_lcb.c dcap-2.47.10/src/dcap_lcb.c
--- dcap-2.47.10.orig/src/dcap_lcb.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap_lcb.c	2016-10-15 12:04:18.668573342 +0200
@@ -523,7 +523,7 @@
 cbindex_t *find_lru_buf(local_cache_buffer_t *lb)
 {
     int i;
-    cbindex_t *cb, *lru_cb;
+    cbindex_t *cb, *lru_cb = NULL;
     unsigned long age, maxage;
 
     /* The algorithm requires that the first buffer (index 0) of the
diff -ur dcap-2.47.10.orig/src/dcap_poll.c dcap-2.47.10/src/dcap_poll.c
--- dcap-2.47.10.orig/src/dcap_poll.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap_poll.c	2016-10-15 12:04:18.669573349 +0200
@@ -37,6 +37,7 @@
 #include "input_parser.h"
 #include "dcap.h"
 #include "dcap_poll.h"
+#include "dcap_functions.h"
 #include "dcap_interpreter.h"
 #include "dcap_str_util.h"
 #include "dcap_mqueue.h"
diff -ur dcap-2.47.10.orig/src/dcap_read.c dcap-2.47.10/src/dcap_read.c
--- dcap-2.47.10.orig/src/dcap_read.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap_read.c	2016-10-15 12:04:18.669573349 +0200
@@ -123,21 +123,21 @@
 	char *buff = vbuff;
 	int             tmp;
 	int32_t         readmsg[7]; /* keep one buffer for READ and SEEK_AND_READ*/
-	int              msglen;
-	int64_t         size;
+	int             msglen;
+	int64_t         size = 0;
 	int32_t         blocksize;
-    int32_t         lastBlockSize;
+	int32_t         lastBlockSize;
 	size_t          totsize;
 	char           *input_buffer;
-	int            use_ahead = 0;
-	ssize_t        nbytes, rest = 0;
-	size_t         ra_buffer = 0;
+	int             use_ahead = 0;
+	ssize_t         nbytes, rest = 0;
+	size_t          ra_buffer = 0;
 
 	int             loop = 0; /* workaround for looping bug */
-    int             errorState = 0;
+	int             errorState = 0;
 
 	/* reconnect */
-	int64_t readSize; /* number of bytes requested to read */
+	int64_t readSize = 0; /* number of bytes requested to read */
 
 
 	if( (node->ahead != NULL) && ( node->ahead->buffer == NULL) ) {
@@ -598,7 +598,6 @@
 
 	int v = 0; /* indes of current buffer */
 	int vPos = 0; /* position in current buffer */
-	int bPos = 0; /* position in current transfer block */
 
 	int vectorIndex = 0; /* offset of current vector */
 	int vectorCount; /* number of vectors to process */
@@ -642,7 +641,6 @@
 
 		v = vectorIndex; /* indes of current buffer */
 		vPos = 0; /* position in current buffer */
-		bPos = 0; /* position in current transfer block */
 		totalToRead = 0; /* byte to read in current chunk*/
 
 		vectorCount = ((count - vectorIndex) > IOV_MAX) ? IOV_MAX : (count - vectorIndex);
@@ -702,7 +700,6 @@
 
 			rc = readn(node->dataFd, (char *) &blocksize, sizeof(blocksize), NULL);
 			blocksize = ntohl(blocksize);
-			bPos = 0;
 			dc_debug(DC_IO, "dc_readv2: transfer blocksize %d", blocksize);
 
 			if(vector[v].len ==  vPos) {
diff -ur dcap-2.47.10.orig/src/dcap_stat.c dcap-2.47.10/src/dcap_stat.c
--- dcap-2.47.10.orig/src/dcap_stat.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap_stat.c	2016-10-15 12:04:18.670573357 +0200
@@ -359,7 +359,7 @@
 	struct vsp_node *node;
 	int rc;
 	char *path;
-	off64_t size;
+	off64_t size = 0;
 
 #ifdef DC_CALL_TRACE
 	showTraceBack();
diff -ur dcap-2.47.10.orig/src/dcap_test.c dcap-2.47.10/src/dcap_test.c
--- dcap-2.47.10.orig/src/dcap_test.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcap_test.c	2016-10-15 12:04:18.670573357 +0200
@@ -233,7 +233,7 @@
     off_t *read_order;
     size_t i, k;
 
-    printf( "Building list of %ld random read offsets (this may take a few seconds)...\n", (long)count);
+    printf( "Building list of %lu random read offsets (this may take a few seconds)...\n", (unsigned long)count);
 
     read_order = calloc( count, sizeof(off_t));
 
@@ -245,7 +245,7 @@
 	read_order[k] = i_th_item(i,item_size);
 
 	if( i % 10000000 == 0) {
-	    printf( "    %u of %u (%d%%)\n", i, count, (int)((double)i/count *100));
+	    printf( "    %lu of %lu (%d%%)\n", (unsigned long)i, (unsigned long)count, (int)((double)i/count * 100));
 	}
     }
 
@@ -383,7 +383,7 @@
     printf("st_ino:     %ld\n", s->st_ino);
     printf("st_dev:     %lu\n", (unsigned long) s->st_dev);
     printf("st_mode:    %s (0%o)\n", mode, s->st_mode);
-    printf("st_nlink:   %d\n", s->st_nlink);
+    printf("st_nlink:   %lu\n", (unsigned long) s->st_nlink);
     printf("st_uid:     %s (%d)\n", pw == NULL ? "unknown" : pw->pw_name,  s->st_uid);
     printf("st_gid:     %s (%d)\n", gr == NULL? "unknown": gr->gr_name, s->st_gid);
     printf("st_size:    %lu\n", (unsigned long) s->st_size);
diff -ur dcap-2.47.10.orig/src/dccp.c dcap-2.47.10/src/dccp.c
--- dcap-2.47.10.orig/src/dccp.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dccp.c	2016-10-15 12:04:18.671573364 +0200
@@ -409,7 +409,7 @@
 	if (rc != -1 )  {
 		copy_time = elapsed_transfer_time(ett_measure);
 		dc_bytes_as_size(formatted_size, size);
-		fprintf(stderr,"%llu bytes (%s) in %lu seconds",(off64_t)size, formatted_size, copy_time);
+		fprintf(stderr,"%lld bytes (%s) in %lu seconds", (long long)size, formatted_size, copy_time);
 		if ( copy_time > 0) {
 			dc_bytes_as_size(formatted_rate, (double)size / copy_time);
 			fprintf(stderr," (%s/s)\n", formatted_rate);
diff -ur dcap-2.47.10.orig/src/dcsuck.c dcap-2.47.10/src/dcsuck.c
--- dcap-2.47.10.orig/src/dcsuck.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/dcsuck.c	2016-10-15 12:04:18.671573364 +0200
@@ -96,7 +96,7 @@
 
 	data_len = dc_readTo(src, dest, sbuf.st_size);
 	if( data_len != sbuf.st_size) {
-		fprintf(stderr,"recived data (%lld) .NE. file size(%lld) \n", data_len, sbuf.st_size);
+		fprintf(stderr,"received data (%ld) .NE. file size(%llu) \n", (long)data_len, (unsigned long long)sbuf.st_size);
 		rc = -3;
 	}
 
diff -ur dcap-2.47.10.orig/src/io.c dcap-2.47.10/src/io.c
--- dcap-2.47.10.orig/src/io.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/io.c	2016-10-15 12:04:15.088547586 +0200
@@ -17,6 +17,7 @@
 
 #include <stdlib.h>
 #include "system_io.h"
+#include "socket_nio.h"
 #include "ioTunnel.h"
 #include <sys/socket.h>
 #include <netinet/in.h>
diff -ur dcap-2.47.10.orig/src/passive.c dcap-2.47.10/src/passive.c
--- dcap-2.47.10.orig/src/passive.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/passive.c	2016-10-15 12:04:15.088547586 +0200
@@ -25,6 +25,7 @@
 #include "dcap.h"
 #include "socket_nio.h"
 #include "node_plays.h"
+#include "io.h"
 #include "system_io.h"
 
 /*
diff -ur dcap-2.47.10.orig/src/readv_test.c dcap-2.47.10/src/readv_test.c
--- dcap-2.47.10.orig/src/readv_test.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/readv_test.c	2016-10-15 12:04:18.672573371 +0200
@@ -31,7 +31,7 @@
 
 	vector[0].buf = malloc(1024);
 	vector[1].buf = malloc(1024);
-	vector[2].buf = &tbuf[0];
+	vector[2].buf = (char*) &tbuf[0];
 
 	vector[0].len = 1024;
 	vector[1].len = 1024;
diff -ur dcap-2.47.10.orig/src/wdccp.c dcap-2.47.10/src/wdccp.c
--- dcap-2.47.10.orig/src/wdccp.c	2016-01-07 21:48:37.000000000 +0100
+++ dcap-2.47.10/src/wdccp.c	2016-10-15 12:04:18.672573371 +0200
@@ -119,7 +119,7 @@
 	int isStdout = 0;
 	struct stat sbuf;
 	char extracommand[128];
-	char *real_destination;
+	char *real_destination = NULL;
 	int isDir = 0;
 
 #ifdef WIN32
@@ -231,7 +231,7 @@
 
 	if (rc != -1 )  {
 		copy_time = endtime-starttime ;
-		fprintf(stderr,"%s => %s: %lld bytes in %lu seconds",source, destination, (off_t)size, copy_time);
+		fprintf(stderr,"%s => %s: %ld bytes in %lu seconds",source, destination, size, copy_time);
 		if ( copy_time > 0) {
 			fprintf(stderr," (%.2f KB/sec)\n",(double)size/(double)(1024*copy_time) );
 		}else{