]> git.ipfire.org Git - people/ms/dma.git/commitdiff
Linux -Wall fixes
authorSimon Schubert <2@0x2c.org>
Sat, 17 Apr 2010 23:27:24 +0000 (01:27 +0200)
committerSimon Schubert <2@0x2c.org>
Sat, 17 Apr 2010 23:27:24 +0000 (01:27 +0200)
crypto.c
dfcompat.c
dfcompat.h
dma.c
dma.h
dns.c
net.c
spool.c
util.c

index 009de81190401e19a7fe230d44100d6e885a9ac3..15a9bac81c13734e5f5758448a284937f2c02bdf 100644 (file)
--- a/crypto.c
+++ b/crypto.c
@@ -176,7 +176,7 @@ smtp_init_crypto(int fd, int feature)
  */
 void
 hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
-    caddr_t digest)
+    unsigned char* digest)
 {
         MD5_CTX context;
         unsigned char k_ipad[65];    /* inner padding -
@@ -248,7 +248,8 @@ hmac_md5(unsigned char *text, int text_len, unsigned char *key, int key_len,
 int
 smtp_auth_md5(int fd, char *login, char *password)
 {
-       unsigned char buffer[BUF_SIZE], digest[BUF_SIZE], ascii_digest[33];
+       unsigned char digest[BUF_SIZE];
+       char buffer[BUF_SIZE], ascii_digest[33];
        char *temp;
        int len, i;
        static char hextab[] = "0123456789abcdef";
@@ -269,7 +270,8 @@ smtp_auth_md5(int fd, char *login, char *password)
 
        /* skip 3 char status + 1 char space */
        base64_decode(buffer + 4, temp);
-       hmac_md5(temp, strlen(temp), password, strlen(password), digest);
+       hmac_md5((unsigned char *)temp, strlen(temp),
+                (unsigned char *)password, strlen(password), digest);
        free(temp);
 
        ascii_digest[32] = 0;
index 1f4a38a88227d0b5e844d72b2269063d39345f65..8df906e96e33ce6f4d37ef85cef10c78310b9e73 100644 (file)
@@ -20,6 +20,8 @@
  * $DragonFly: src/lib/libc/string/strlcpy.c,v 1.4 2005/09/18 16:32:34 asmodai Exp $
  */
 
+#include "dfcompat.h"
+
 #include <sys/types.h>
 #include <string.h>
 
@@ -105,7 +107,6 @@ reallocf(void *ptr, size_t size)
 
 #ifdef __GLIBC__
 
-#define __USE_GNU
 #include <errno.h>
 
 const char *
index ea2363d970e642b2a10a9eef601c31945e06a39d..bb0a0bbd0d5e3658dbb0b89d718dfc592d12103e 100644 (file)
@@ -1,6 +1,8 @@
 #ifndef DFCOMPAT_H
 #define DFCOMPAT_H
 
+#define _GNU_SOURCE
+
 #include <sys/types.h>
 
 #ifndef __DECONST
diff --git a/dma.c b/dma.c
index 509744e2e7bff53dcf0f38af0ff35c7545dec809..1ddd980946d8ebcdb83d8f2314e3e6440e8595f2 100644 (file)
--- a/dma.c
+++ b/dma.c
  * SUCH DAMAGE.
  */
 
+#include "dfcompat.h"
+
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
+#include <sys/time.h>
 #include <sys/wait.h>
 
 #include <dirent.h>
diff --git a/dma.h b/dma.h
index 5d971c07ab73607207c166c057c0ec5438a389c9..ac70b12f062c9d41d7174e5ff059af877e433e4d 100644 (file)
--- a/dma.h
+++ b/dma.h
@@ -166,7 +166,7 @@ void parse_virtuser(const char *);
 void parse_authfile(const char *);
 
 /* crypto.c */
-void hmac_md5(unsigned char *, int, unsigned char *, int, caddr_t);
+void hmac_md5(unsigned char *, int, unsigned char *, int, unsigned char *);
 int smtp_auth_md5(int, char *, char *);
 int smtp_init_crypto(int, int);
 
diff --git a/dns.c b/dns.c
index 5a72dfef12b53e171c97fb240c4fd93429c90f7f..f62036d9e25fd5d050fc77e78ed6b0ec5ab338e3 100644 (file)
--- a/dns.c
+++ b/dns.c
@@ -120,8 +120,8 @@ dns_get_mx_list(const char *host, int port, struct mx_hostentry **he, int no_mx)
        ns_msg msg;
        ns_rr rr;
        const char *searchhost;
-       const char *cp;
-       char *ans;
+       const unsigned char *cp;
+       unsigned char *ans;
        struct mx_hostentry *hosts = NULL;
        size_t nhosts = 0;
        size_t anssz;
@@ -179,7 +179,7 @@ repeat:
                if (ns_parserr(&msg, ns_s_an, i, &rr))
                        goto transerr;
 
-               cp = (const char *)ns_rr_rdata(rr);
+               cp = ns_rr_rdata(rr);
 
                switch (ns_rr_type(rr)) {
                case ns_t_mx:
diff --git a/net.c b/net.c
index 55d06cf9590a3e968f9d398eca25581c9957a95d..3942d2e5fd1319500e93d1ec96b3416a6f0cd34b 100644 (file)
--- a/net.c
+++ b/net.c
@@ -33,6 +33,8 @@
  * SUCH DAMAGE.
  */
 
+#include "dfcompat.h"
+
 #include <sys/param.h>
 #include <sys/queue.h>
 #include <sys/stat.h>
diff --git a/spool.c b/spool.c
index b9235e7caee71437ab7ba712a6ee488a9223c5f4..c29b628d6782a74d583dd1bfb6beeb4bd75e1cdb 100644 (file)
--- a/spool.c
+++ b/spool.c
@@ -32,6 +32,9 @@
  * SUCH DAMAGE.
  */
 
+#include "dfcompat.h"
+
+#include <sys/file.h>
 #include <sys/stat.h>
 
 #include <ctype.h>
diff --git a/util.c b/util.c
index cf26acc60bba205e9075f61e047ed4afc5bb700c..7806e8b23ce5d3d4990d92b5d489ca7b7ec30b1a 100644 (file)
--- a/util.c
+++ b/util.c
@@ -33,6 +33,8 @@
  */
 
 #include <sys/param.h>
+#include <sys/file.h>
+
 #include <errno.h>
 #include <fcntl.h>
 #include <netdb.h>