Commit Diff
Diff:
f52f40f5aafd484bcc64172d14ace270665fc9a1
a9302bf00e2e87bd04f35e97660684a7d7570b98
Commit:
a9302bf00e2e87bd04f35e97660684a7d7570b98
Tree:
8616229fe9556ec480304c8b2d6837ce6f63e8fe
Author:
pjp <pjp@delphinusdns.org>
Committer:
pjp <pjp@delphinusdns.org>
Date:
Mon Jan 2 18:33:01 2017 UTC
Message:
This should make linux compile.
blob - 042c0f543ffd98d8d0b43aaaa019133f88416cf3
blob + 7361b9f22bc422a01f12ec96b8231055f787a8e1
--- Makefile.linux
+++ Makefile.linux
@@ -1,38 +1,75 @@
CC=gcc
#CFLAGS=-DDEBUG
CFLAGS=
-LDADD= -ldb -lresolv -lcrypto -lrt
+LDADD= -ldb -lresolv -lcrypto -lrt -lbsd
YACC=bison
AR=ar
+all: delphinusdnsd dd-convert
-build:
+delphinusdnsd: additional.o parse.o delphinusdnsd.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o
+ $(CC) $(CFLAGS) -o delphinusdnsd/delphinusdnsd additional.o delphinusdnsd.o parse.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o util.o $(LDADD)
+
+dd-convert: dd-convert.o util.o dnssec.o parse.o base64.o
+ $(CC) $(CFLAGS) -o dd-convert/dd-convert dd-convert.o util.o dnssec.o base64.o parse.o $(LDADD)
+
+
+dd-convert.o: dd-convert.c
+ $(CC) $(CFLAGS) -c dd-convert.c
+
+parse.o: parse.y
$(YACC) $(CFLAGS) -y -d parse.y
mv -f y.tab.c parse.c
- $(CC) $(CFLAGS) -c additional.c
- $(CC) $(CFLAGS) -c main.c
$(CC) $(CFLAGS) -c parse.c
+
+additional.o: additional.c
+ $(CC) $(CFLAGS) -c additional.c
+
+delphinusdnsd.o: delphinusdnsd.c
+ $(CC) $(CFLAGS) -c delphinusdnsd.c
+
+reply.o: reply.c
$(CC) $(CFLAGS) -c reply.c
+
+region.o: region.c
$(CC) $(CFLAGS) -c region.c
+
+log.o: log.c
$(CC) $(CFLAGS) -c log.c
+
+axfr.o: axfr.c
$(CC) $(CFLAGS) -c axfr.c
+
+filter.o: filter.c
$(CC) $(CFLAGS) -c filter.c
+
+ratelimit.o: ratelimit.c
$(CC) $(CFLAGS) -c ratelimit.c
+
+whitelist.o: whitelist.c
$(CC) $(CFLAGS) -c whitelist.c
+
+base64.o: base64.c
$(CC) $(CFLAGS) -c base64.c
+
+dnssec.o: dnssec.c
$(CC) $(CFLAGS) -c dnssec.c
- $(AR) -x libressllibcrypto.a arc4random.o
- $(AR) -x libressllibcrypto.a getentropy_linux.o
- $(AR) -x libressllibcrypto.a libcompatnoopt_la-explicit_bzero.o
- $(CC) $(CFLAGS) -o delphinusdnsd additional.o main.o parse.o reply.o region.o log.o axfr.o filter.o ratelimit.o whitelist.o base64.o dnssec.o arc4random.o getentropy_linux.o libcompatnoopt_la-explicit_bzero.o $(LDADD)
+util.o: util.c
+ $(CC) $(CFLAGS) -c util.c
-install:
- test -f delphinusdnsd && install -m 555 delphinusdnsd /usr/local/sbin/
+
+install: install-delphinusdnsd install-dd-convert
+
+install-dd-convert:
+ test -f dd-convert/dd-convert && install -m 555 dd-convert/dd-convert /usr/local/sbin/
+
+install-delphinusdnsd:
+ test -f delphinusdnsd/delphinusdnsd && install -m 555 delphinusdnsd/delphinusdnsd /usr/local/sbin/
mkdir -p /usr/local/man/man8 && install -m 444 delphinusdnsd.8 /usr/local/man/man8
mkdir -p /usr/local/man/man5 && install -m 444 delphinusdns.conf.5 /usr/local/man/man5
clean:
- rm -f *.o delphinusdnsd
+ rm -f *.o delphinusdnsd/delphinusdnsd dd-convert/dd-convert
blob - 8d7d82c8488864ae24b11e8bc352a1c293ad5d96
blob + 4ebc8b0efcfba69b426a90d7b3b364711b11912e
--- dd-convert.c
+++ dd-convert.c
@@ -1644,7 +1644,11 @@ sign_aaaa(DB *db, char *zonename, char *zsk_key, int e
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -3058,7 +3062,11 @@ sign_naptr(DB *db, char *zonename, char *zsk_key, int
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -3337,7 +3345,11 @@ sign_srv(DB *db, char *zonename, char *zsk_key, int ex
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -3614,7 +3626,11 @@ sign_sshfp(DB *db, char *zonename, char *zsk_key, int
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -3892,7 +3908,11 @@ sign_tlsa(DB *db, char *zonename, char *zsk_key, int e
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -4170,7 +4190,11 @@ sign_ds(DB *db, char *zonename, char *zsk_key, int exp
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -4442,7 +4466,11 @@ sign_ns(DB *db, char *zonename, char *zsk_key, int exp
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -4715,7 +4743,11 @@ sign_mx(DB *db, char *zonename, char *zsk_key, int exp
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -4987,7 +5019,11 @@ sign_a(DB *db, char *zonename, char *zsk_key, int expi
}
}
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -5450,7 +5486,11 @@ sign_dnskey(DB *db, char *zonename, char *zsk_key, cha
}
- TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
+ TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -5659,7 +5699,11 @@ sign_dnskey(DB *db, char *zonename, char *zsk_key, cha
}
}
- TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#ifdef __linux__
+ TAILQ_FOREACH(c2, &head, entries) {
+#else
+ TAILQ_FOREACH_SAFE(c2, &head, entries, cp) {
+#endif
pack(p, c2->data, c2->len);
p += c2->len;
@@ -5912,8 +5956,13 @@ read_private_key(char *zonename, int keyid, int algori
fclose(f);
+#if __linux__
+ memset(buf, 0, sizeof(buf));
+ memset(key, 0, sizeof(key));
+#else
explicit_bzero(buf, sizeof(buf));
explicit_bzero(key, sizeof(key));
+#endif
return (rsa);
repomaster@centroid.eu