1
--- maradns-1.2.06-orig/server/MaraDNS.c 2006-03-10 00:33:28.000000000 -0800
2
+++ maradns-1.2.06/server/MaraDNS.c 2006-03-10 00:45:13.000000000 -0800
4
return synth_soa_serial;
7
+/* Define log_lock(); and log_unlock(); for authonly use */
11
+#endif /* AUTHONLY */
13
/* Debug routine that shows an IP in dotted decimal format on the
18
/* Signal handler for SIGPIPE, so we don't terminate */
19
void handle_sigpipe() {
23
printf("%s%s",L_CAUGHT_PIPE,L_N); /* "Caught SIGPIPE" */
31
/* Signal handler for other signals */
32
void handle_signal() {
36
printf("%s%s",L_CAUGHT_SIG,L_N); /* "Caught Signal" */
48
printf("%s%s%s",L_LOG,logmessage,L_N);
49
/* "Log: ", logmessage, "\n" */
51
/* Unbuffered output */
62
printf("%s",L_LOG); /* "Log: " */
63
ret = show_esc_stdout(logmessage);
64
printf("%s",L_N); /* "\n" */
66
/* Unbuffered output */
77
printf("%s%s",L_LOG,left); /* "Log: ", left */
78
ret = show_esc_stdout(right);
79
printf("%s",L_N); /* "\n" */
81
/* Unbuffered output */
88
if(compress_data(most,ar) == JS_ERROR) {
89
/* This is a bit of a kludge to work around the news.com.com
90
problem for the 1.0.00 release */
92
- printf("%s",L_COMPRESS_ERROR);
93
- /* Compress error */
94
- show_esc_stdout(most);
99
+ printf("%s",L_COMPRESS_ERROR);
100
+ /* Compress error */
101
+ show_esc_stdout(most);
105
if(js_copy(most,ar) == JS_ERROR) {
108
@@ -1812,7 +1834,7 @@
112
- printf("point %d length %d\n",point,length);
113
+ /* printf("point %d length %d\n",point,length); */
115
if(point > dname_they_wanted->unit_count) {
117
@@ -3232,7 +3254,9 @@
118
js_dealloc(query_string);
119
if(result_code == JS_SUCCESS) {
120
log_level = new_verbose_level;
122
printf("Verbose_level remotely set to %d\n",new_verbose_level);
125
init_rlog_level(new_verbose_level);
127
@@ -4675,6 +4699,7 @@
129
#endif /* __CYGWIN__ */
133
printf("%s ","Query from");
135
@@ -4692,14 +4717,17 @@
136
printf("has decompression error: ");
137
show_esc_stdout(incoming);
146
printf("Decompressed packet: ");
147
show_esc_stdout(uncomp);
151
if(log_level >= 3 && uncomp->unit_count > 12) {
152
/* Show them the query */
153
@@ -4715,6 +4743,7 @@
155
hname_translate(incoming,value);
156
/* Yes, I know, put these in the "to localize" header file */
159
printf("%s: ","Query from");
161
@@ -4732,6 +4761,7 @@
163
js_show_stdout(incoming);
168
/* Delay the processing the request, as needed */
169
--- maradns-1.2.06-orig/server/recursive.c 2006-03-10 00:33:28.000000000 -0800
170
+++ maradns-1.2.06/server/recursive.c 2006-03-10 00:51:41.000000000 -0800
172
/* The locks used for multithreaded purposes */
173
pthread_mutex_t big_lock = PTHREAD_MUTEX_INITIALIZER;
175
-pthread_mutex_t log_lock = PTHREAD_MUTEX_INITIALIZER;
176
+pthread_mutex_t logwrite_lock = PTHREAD_MUTEX_INITIALIZER;
177
pthread_mutex_t rng_lock = PTHREAD_MUTEX_INITIALIZER;
178
pthread_mutex_t thr_lock = PTHREAD_MUTEX_INITIALIZER;
180
@@ -176,12 +176,12 @@
181
/* A list of spam-friendly DNS servers (e.g. azmalink.net, etc.) */
182
ipv4pair spammers[512];
184
-void logwrite_lock() {
185
- pthread_mutex_lock(&log_lock);
187
+ pthread_mutex_lock(&logwrite_lock);
190
-void logwrite_unlock() {
191
- pthread_mutex_unlock(&log_lock);
193
+ pthread_mutex_unlock(&logwrite_lock);
197
@@ -191,10 +191,10 @@
200
if(in_big_lock != 1) {
204
printf("WARNING: Attempting to unlock when not locked\n");
210
@@ -469,12 +469,12 @@
213
if(rlog_level >= 4) {
217
printf("Custodian is zapping record ");
218
show_esc_stdout(zap->hash_point);
219
printf(" at %p\n",zap->record);
224
/* Remove the pointer to this hash element */
225
@@ -631,10 +631,10 @@
228
if(rlog_level >= 4) {
232
printf(" unlinking depth exceeded\n");
236
return JS_ERROR; /* Maximum allowed depth is 32 */
238
@@ -642,11 +642,11 @@
241
if(rlog_level >= 4) {
245
printf("Unlinking RR at %p, depth %d, next %p\n",fatma,depth,
252
@@ -655,18 +655,18 @@
253
/* We normally do not destroy fatma->query because that js string
254
object has normally already been destroyed */
255
if(rlog_level >= 4) {
259
printf("Destroying data at %p\n",fatma->data);
263
js_destroy(fatma->data);
264
if(fatma->ptr != 0) {
265
if(rlog_level >= 4) {
269
printf("Destroying ptr at %p\n",fatma->ptr);
273
js_destroy(fatma->ptr);
275
@@ -674,10 +674,10 @@
276
separate js_string object that also needs to be nuked */
277
if(fatma->zap == NULL && depth >= 1) {
278
if(rlog_level >= 4) {
282
printf("Destroying query at %p\n",fatma->query);
286
js_destroy(fatma->query);
288
@@ -693,10 +693,10 @@
291
if(rlog_level >= 4) {
295
printf("Destroying remember at %p\n",remember);
300
js_dealloc(remember);
301
@@ -1082,12 +1082,12 @@
304
if(rlog_level >= 4) {
308
printf("Adding RR/psudo-NXDOMAIN ");
309
show_esc_stdout(query);
310
printf(" to cache at %p\n",data);
315
/* First, clear out all the fields */
316
@@ -1224,11 +1224,11 @@
318
if(action == OVERWRITE || spot_data.datatype == MARA_DNS_NS) {
319
if(rlog_level >= 4) {
323
printf("Element already in hash at %p, zapping\n",
330
@@ -1258,11 +1258,11 @@
332
else if(action == 2) { /* Append */
333
if(rlog_level >= 4) {
337
printf("Appending element in hash at %p\n",
342
point = spot_data.value;
343
while(point->next != NULL)
344
@@ -1302,12 +1302,12 @@
345
data->zap = new_fila(data,0,zap_query,2);
347
if(rlog_level >= 4) {
351
printf("Sucessfully added ");
352
show_esc_stdout(query);
353
printf(" to cache at %p\n",data);
359
@@ -1498,12 +1498,12 @@
360
if(remote_ip == 0xffffffff || remote_ip == 0) { /* 255.255.255.255
362
if(rlog_level >= 4) {
366
printf("Invalid ip ");
367
debug_show_ip(remote_ip);
368
printf(" rejected\n");
374
@@ -1511,7 +1511,7 @@
375
/* End variable declaration, begin code */
377
if(rlog_level >= 4) {
381
printf("Querying DNS server with ip ");
382
debug_show_ip(remote_ip);
383
@@ -1520,7 +1520,7 @@
384
printf(" with bailiwick ");
385
show_esc_stdout(bailiwick);
391
/* Make sure they are not a spammer. If they are, return an error */
392
@@ -1529,11 +1529,11 @@
393
if((remote_ip & (spammers[counter]).mask) ==
394
((spammers[counter]).ip & (spammers[counter]).mask)) {
395
if(rlog_level >= 4) {
399
debug_show_ip(remote_ip);
400
printf(" is a DNS server we won't talk to\n");
404
return JS_ERROR; /* We do not welcome replies from spam-friendly
406
@@ -1548,29 +1548,29 @@
407
/* Allocate memory for some strings */
408
if((indata = js_create(512,1)) == 0) {
409
if(rlog_level >= 4) {
413
printf("Unable to allocate indata string\n");
419
if((uindata = js_create(2048,1)) == 0) {
420
if(rlog_level >= 4) {
424
printf("Unable to allocate uindata string\n");
431
if((outdata = js_create(512,1)) == 0) {
432
if(rlog_level >= 4) {
436
printf("Unable to allocate outdata string\n");
442
@@ -1583,10 +1583,10 @@
443
server.sin_port = htons(53);
444
if((server.sin_addr.s_addr = htonl(remote_ip)) == INADDR_NONE) {
445
if(rlog_level >= 4) {
449
printf("Failure running htonl\n");
455
@@ -1624,28 +1624,28 @@
456
/* Make a beginning of a DNS query from that header */
457
if(make_hdr(&header,outdata) == JS_ERROR) {
458
if(rlog_level >= 4) {
462
printf("Failure running make_hdr\n");
468
if(js_append(query,outdata) == JS_ERROR) {
469
if(rlog_level >= 4) {
473
printf("Failure running js_append\n");
479
if(js_adduint16(outdata,1) == JS_ERROR) { /* Adding class to query */
480
if(rlog_level >= 4) {
484
printf("Failure running js_adduint16\n");
490
@@ -1659,10 +1659,10 @@
491
/* Create a UDP client socket */
492
if((s = socket(AF_INET,SOCK_DGRAM,0)) == -1) {
493
if(rlog_level >= 2) {
497
printf("WARNING: Failure creating socket\n");
503
@@ -1673,10 +1673,10 @@
504
/* Try 10 times just in case the port is already bound */
506
if(rlog_level >= 4 && counter > 0) {
510
printf("Bind failed, trying again\n");
514
/* XXX read some kvars which determine the range of this
516
@@ -1688,10 +1688,10 @@
519
if(rlog_level >= 4) {
523
printf("Failure binding, giving up\n");
529
@@ -1705,10 +1705,10 @@
532
if(rlog_level >= 4) {
536
printf("Sendto failure\n");
542
@@ -1724,10 +1724,10 @@
544
if(n == -1) /* select error */ {
545
if(rlog_level >= 4) {
549
printf("Select error\n");
555
@@ -1735,10 +1735,10 @@
556
if(n == 0) /* Timeout */ {
558
if(rlog_level >= 4) {
562
printf("Timeout contacting remote nameserver\n");
568
@@ -1754,10 +1754,10 @@
569
(socklen_t *)&len_inet)) < 0) {
571
if(rlog_level >= 4) {
575
printf("recvfrom error\n");
581
@@ -1767,29 +1767,29 @@
582
indata->unit_count = count;
583
if(decompress_data(indata,uindata) == JS_ERROR) {
584
if(rlog_level >= 4) {
588
printf("Decompress failure: ");
589
show_esc_stdout(indata);
596
if(rlog_level >= 5) {
600
printf("Decompressed packet: ");
601
show_esc_stdout(uindata);
606
if(read_hdr(uindata,&header) == JS_ERROR) {
607
if(rlog_level >= 4) {
611
printf("read_hdr failure\n");
617
@@ -1816,10 +1816,10 @@
619
if(header.id != sid) {
620
if(rlog_level >= 4) {
624
printf("Bad id from remote server (possible spoof attempt)\n");
630
@@ -1829,10 +1829,10 @@
631
keen on resolving macslash.net */
632
if(header.rcode != 0 && header.rcode != 3) {
633
if(rlog_level >= 4) {
637
printf("Bad rcode from remote server\n");
643
@@ -1844,10 +1844,10 @@
644
len = dlabel_length(uindata,offset);
645
if(len == JS_ERROR) {
646
if(rlog_level >= 4) {
650
printf("Bad dlabel_length\n");
656
@@ -1874,10 +1874,10 @@
657
len = dlabel_length(uindata,offset);
658
if(len == JS_ERROR) {
659
if(rlog_level >= 4) {
663
printf("Bad dlabel_length\n");
669
@@ -1889,10 +1889,10 @@
670
substring_issame_case(uindata,offset,len,query);
671
if(return_code_check == JS_ERROR) {
672
if(rlog_level >= 4) {
676
printf("Bad return_code_check\n");
682
@@ -1903,28 +1903,28 @@
683
cname_original_record = get_rtype(query);
684
if(cname_original_record == JS_ERROR) {
685
if(rlog_level >= 4) {
689
printf("Bad cname_original_record\n");
695
if(change_rtype(query,RR_CNAME) == JS_ERROR) {
696
if(rlog_level >= 4) {
700
printf("change_rtype problem\n");
706
if(substring_issame_case(uindata,offset,len,query) != 1) {
707
if(rlog_level >= 4) {
711
printf("substring_issame_case problem\n");
717
@@ -1944,10 +1944,10 @@
719
if(ttl == JS_ERROR) {
720
if(rlog_level >= 4) {
730
@@ -1967,10 +1967,10 @@
731
rdlength = js_readuint16(uindata,offset);
732
if(rdlength == JS_ERROR) {
733
if(rlog_level >= 4) {
737
printf("bad rdlength\n");
743
@@ -1984,10 +1984,10 @@
744
/* Determine the IP that the CNAME record points to */
745
if((jsip = js_create(256,1)) == 0) {
746
if(rlog_level >= 4) {
750
printf("bad jsip\n");
756
@@ -2008,10 +2008,10 @@
757
the A record attached to the CNAME */
758
if(js_copy(spot->data,jsip) == JS_ERROR) {
759
if(rlog_level >= 4) {
763
printf("bad js_copy\n");
769
@@ -2024,10 +2024,10 @@
770
if(is_arpa_address == 1) {
771
if(js_adduint16(jsip,RR_PTR) == JS_ERROR) {
772
if(rlog_level >= 4) {
776
printf("bad js_adduint16 RR_PTR\n");
782
@@ -2035,12 +2035,12 @@
785
if(rlog_level >= 4) {
789
printf("About to recursively chase ptr ");
790
show_esc_stdout(jsip);
795
if(recurse_call(0,0,dummy,jsip,0,0,0,ptrq) ==
797
@@ -2052,10 +2052,10 @@
799
if(js_adduint16(jsip,RR_A) == JS_ERROR) {
800
if(rlog_level >= 4) {
804
printf("bad js_adduint16 RR_A\n");
810
@@ -2092,10 +2092,10 @@
811
if(cname_original_record != 0) {
812
if(change_rtype(query,cname_original_record) == JS_ERROR) {
813
if(rlog_level >= 4) {
817
printf("bad change_rtype return code\n");
823
@@ -2556,13 +2556,13 @@
826
if(rlog_level >= 4) {
831
printf("In thread; ready to begin recursion; Threads in use: %d\n",
832
num_of_threads_running);
839
@@ -2571,13 +2571,13 @@
842
if(rlog_level >= 4) {
847
printf("Ready to terminate thread; threads in use %d\n",
848
num_of_threads_running);
854
js_destroy(req->query);
855
@@ -2626,11 +2626,11 @@
856
if(queries_sent > max_queries_total ||
857
glueless_level > max_glueless_level) {
858
if(rlog_level >= 4) {
862
show_esc_stdout(query);
863
printf(" queries_total/glueless_level exceeded\n");
869
@@ -2654,11 +2654,11 @@
870
qtype = get_rtype(query);
871
if(qtype == RR_ANY) {
872
if(rlog_level >= 4) {
876
show_esc_stdout(query);
877
printf(" is an ANY query\n");
881
/* Make sure the RR_A and RR_NS are placed in the dns cache */
882
change_rtype(query,RR_A);
883
@@ -2703,12 +2703,12 @@
885
/* Look for query in cache */
886
if(rlog_level >= 4) {
890
printf("Looking for ");
891
show_esc_stdout(lower);
892
printf(" in cache\n");
896
spot_data = mhash_get(dnscache,lower);
898
@@ -2716,11 +2716,11 @@
900
if(spot_data.value != 0 && spot_data.datatype == MARA_DNS_NEG) {
901
if(rlog_level >= 4) {
905
show_esc_stdout(lower);
906
printf(" found in cache (psudo-NXDOMAIN) at %p\n",spot_data.value);
910
if(give_answer(spot_data.value,spot_data.datatype,spot_data.point,
911
ipret,ptrret,query,lower,id,sock,client,queries_sent,
912
@@ -2732,11 +2732,11 @@
913
/* Return cached data if found */
914
if(spot_data.value != 0 && spot_data.datatype == MARA_DNSRR) {
915
if(rlog_level >= 4) {
919
show_esc_stdout(lower);
920
printf(" found in cache (RR) at %p\n",spot_data.value);
924
if(give_answer(spot_data.value,spot_data.datatype,spot_data.point,
925
ipret,ptrret,query,lower,id,sock,client,queries_sent,
926
@@ -2753,11 +2753,11 @@
927
spot_data = mhash_get(dnscache,copy);
928
if(spot_data.value != 0 && spot_data.datatype == MARA_DNSRR) {
929
if(rlog_level >= 4) {
933
show_esc_stdout(lower);
934
printf(" found in cache (CNAME RR) at %p\n",spot_data.value);
938
if(give_answer(spot_data.value,spot_data.datatype,spot_data.point,
940
@@ -2769,11 +2769,11 @@
943
if(rlog_level >= 4) {
947
show_esc_stdout(lower);
948
printf(" not found in cache\n");
953
/* If we still haven't found something, perhaps a lower-case version of
954
@@ -2782,12 +2782,12 @@
955
/* If we could fold the case, look for a lower-case version of the same */
956
if(case_folded == 1) {
957
if(rlog_level >= 4) {
961
printf("Looking for ");
962
show_esc_stdout(lower);
963
printf(" (lowercase)\n");
967
spot_data = mhash_get(dnscache,lower);
969
@@ -2795,12 +2795,12 @@
971
if(spot_data.value != 0 && spot_data.datatype == MARA_DNS_NEG) {
972
if(rlog_level >= 4) {
976
show_esc_stdout(lower);
977
printf(" found (lowercase psudo-NXDOMAIN) at %p\n",
982
if(give_answer(spot_data.value,spot_data.datatype,
983
spot_data.point,ipret,ptrret,query,
984
@@ -2813,11 +2813,11 @@
985
/* Return cached data if found */
986
if(spot_data.value != 0 && spot_data.datatype == MARA_DNSRR) {
987
if(rlog_level >= 4) {
991
show_esc_stdout(lower);
992
printf(" found (lowercase RR) at %p\n",spot_data.value);
996
if(give_answer(spot_data.value,spot_data.datatype,
997
spot_data.point,ipret,ptrret,query,
998
@@ -2836,11 +2836,11 @@
999
spot_data = mhash_get(dnscache,copy);
1000
if(spot_data.value != 0 && spot_data.datatype == MARA_DNSRR) {
1001
if(rlog_level >= 4) {
1005
show_esc_stdout(lower);
1006
printf(" found (CNAME lowercase RR) at %p\n",spot_data.value);
1007
- logwrite_unlock();
1010
if(give_answer(spot_data.value,spot_data.datatype,spot_data.point,
1011
ipret,ptrret,query,copy,id,sock,client,queries_sent,
1012
@@ -2850,11 +2850,11 @@
1015
if(rlog_level >= 4) {
1019
show_esc_stdout(lower);
1020
printf(" not found in cache either\n");
1021
- logwrite_unlock();
1026
@@ -2872,12 +2872,12 @@
1027
the data we are seeking */
1029
if(rlog_level >= 4) {
1033
printf("Looking for ");
1034
show_esc_stdout(copy);
1035
printf(" in cache (NS referral)\n");
1036
- logwrite_unlock();
1040
spot_data = mhash_get(dnscache,copy);
1041
@@ -2889,12 +2889,12 @@
1042
js_copy(copy,lower);
1043
if(fold_case(lower) == JS_SUCCESS) { /* If we can fold the case */
1044
if(rlog_level >= 4) {
1048
printf("Looking for ");
1049
show_esc_stdout(lower);
1050
printf(" in cache (lowercase NS ref)\n");
1051
- logwrite_unlock();
1054
spot_data = mhash_get(dnscache,lower);
1055
if(spot_data.value != 0 && spot_data.datatype == MARA_DNS_NS)
1056
@@ -2906,14 +2906,14 @@
1057
if(spot_data.value != 0 && spot_data.datatype == MARA_DNS_NS) {
1058
cpoint = spot_data.value;
1059
if(rlog_level >= 4) {
1063
if(case_folded_found == 1)
1064
show_esc_stdout(lower);
1066
show_esc_stdout(copy);
1067
printf(" found at %p\n",spot_data.value);
1068
- logwrite_unlock();
1071
move_to_top(cpoint->zap);
1072
/* If the data expires (is not 0), and the data has expired... */
1073
@@ -2922,14 +2922,14 @@
1074
/* Make the read-only lock a read-write lock */
1076
if(rlog_level >= 4) {
1080
if(case_folded_found == 1)
1081
show_esc_stdout(lower);
1083
show_esc_stdout(copy);
1084
printf(" at %p has expired, zapping\n",spot_data.value);
1085
- logwrite_unlock();
1089
if(case_folded_found == 0)
1090
@@ -2950,7 +2950,7 @@
1093
if(rlog_level >= 4) {
1097
printf("Making cpoint copy of ");
1098
if(case_folded_found == 1)
1099
@@ -2958,7 +2958,7 @@
1101
show_esc_stdout(copy);
1102
printf(" at %p\n",spot_data.value);
1103
- logwrite_unlock();
1107
if((local_c = js_alloc(1,sizeof(closer))) == 0)
1108
@@ -3217,22 +3217,22 @@
1109
set up and launch a thread. */
1111
if(rlog_level >= 4) {
1115
printf("Looking for ");
1116
show_esc_stdout(query);
1117
printf(" in DNS cache\n");
1118
- logwrite_unlock();
1121
spot_data = mhash_get(dnscache,query);
1122
if(spot_data.value != 0 && (spot_data.datatype == MARA_DNSRR ||
1123
spot_data.datatype == MARA_DNS_NEG)) {
1124
if(rlog_level >= 4) {
1128
show_esc_stdout(query);
1129
printf(" found at %p\n",spot_data.value);
1130
- logwrite_unlock();
1133
lookatrr = spot_data.value;
1134
move_to_top(lookatrr->zap);
1135
@@ -3244,20 +3244,20 @@
1136
INCOMPLETE_CNAME_LIFETIME))) {
1137
/* Do almost nothing */
1138
if(rlog_level >= 4) {
1142
show_esc_stdout(query);
1143
printf(" has expired at %p\n",spot_data.value);
1144
- logwrite_unlock();
1148
else if(spot_data.datatype == MARA_DNS_NEG) {
1149
if(rlog_level >= 4) {
1153
show_esc_stdout(query);
1154
printf(" is a psudo-NXDOMAIN at %p\n",spot_data.value);
1155
- logwrite_unlock();
1158
udpnotfound(lookatrr,id,sock,&client,query,0,1,0,1);
1160
@@ -3265,11 +3265,11 @@
1163
if(rlog_level >= 4) {
1167
show_esc_stdout(query);
1168
printf(" is an RR at %p\n",spot_data.value);
1169
- logwrite_unlock();
1172
udpsuccess(spot_data.value,id,sock,&client,query,
1173
spot_data.point,0,1,0);
1174
@@ -3279,11 +3279,11 @@
1177
if(rlog_level >= 4) {
1181
show_esc_stdout(query);
1182
printf(" not found in cache\n");
1183
- logwrite_unlock();
1188
@@ -3301,12 +3301,12 @@
1191
if(rlog_level >= 4) {
1195
printf("Looking for ");
1196
show_esc_stdout(query);
1197
printf(" in DNS cache (CNAME lookup)\n");
1198
- logwrite_unlock();
1201
spot_data = mhash_get(dnscache,query);
1202
if(spot_data.value != 0 && (spot_data.datatype == MARA_DNSRR ||
1203
@@ -3321,21 +3321,21 @@
1204
INCOMPLETE_CNAME_LIFETIME))) {
1205
/* Do almost nothing */
1206
if(rlog_level >= 4) {
1210
show_esc_stdout(query);
1211
printf(" has expired (CNAME) at %p\n",spot_data.value);
1212
- logwrite_unlock();
1216
else if(spot_data.datatype == MARA_DNS_NEG) {
1217
if(rlog_level >= 4) {
1221
show_esc_stdout(query);
1222
printf(" is a psudo-NXDOMAIN (CNAME) at %p\n",
1224
- logwrite_unlock();
1227
udpnotfound(lookatrr,id,sock,&client,query,0,1,0,1);
1229
@@ -3343,11 +3343,11 @@
1232
if(rlog_level >= 4) {
1236
show_esc_stdout(query);
1237
printf(" is an RR (CNAME) at %p\n",spot_data.value);
1238
- logwrite_unlock();
1241
if(change_rtype(query,original_rtype) == JS_ERROR) {
1243
@@ -3365,11 +3365,11 @@
1246
if(rlog_level >= 4) {
1250
show_esc_stdout(query);
1251
printf(" not found in cache (CNAME)\n");
1252
- logwrite_unlock();
1257
@@ -3379,10 +3379,10 @@
1260
if(rlog_level >= 4) {
1264
printf("initializing thread\n");
1265
- logwrite_unlock();
1269
/* We need to create some thread-safe data structures.
1270
@@ -3418,10 +3418,10 @@
1272
js_dealloc(req); js_destroy(copy);
1273
if(rlog_level >= 4) {
1277
printf("too many threads running\n");
1278
- logwrite_unlock();
1281
/* Return a "server fail" error message if we can not spawn
1282
a thread. We need to synthesize a header to do this */
1283
@@ -3444,10 +3444,10 @@
1284
recurse_thread(req);
1286
if(rlog_level >= 4) {
1290
printf("About to launch thread...\n");
1291
- logwrite_unlock();
1294
/* Set up the attributes for the thread. Make this a detached
1295
thread because we don't look at the return value (the thread
1296
@@ -3535,12 +3535,12 @@
1297
/* Add the data to the hash */
1299
if(rlog_level >= 4) {
1304
show_esc_stdout(zone);
1305
printf(" to cache at %p (jsddip)\n",close);
1306
- logwrite_unlock();
1310
/* See if the data is already there. If so, act based on the value
1311
@@ -3576,10 +3576,10 @@
1312
point = point->next;
1313
point->next = close;
1314
if(rlog_level >= 4) {
1318
printf("That's an append\n");
1319
- logwrite_unlock();
1324
@@ -3651,12 +3651,12 @@
1325
/* Add the data to the hash */
1327
if(rlog_level >= 4) {
1332
show_esc_stdout(zone);
1333
printf(" to cache at %p (ipv4pair)\n",close);
1334
- logwrite_unlock();
1338
/* See if the data is already there. If so, act based on the value
1339
@@ -3692,10 +3692,10 @@
1340
point = point->next;
1341
point->next = close;
1342
if(rlog_level >= 4) {
1346
printf("That's an append\n");
1347
- logwrite_unlock();
1351
/* XXX to do: mask */
1352
@@ -3772,12 +3772,12 @@
1355
if(rlog_level >= 4) {
1360
show_esc_stdout(zone);
1361
printf(" to cache at %p (js)\n",close);
1362
- logwrite_unlock();
1366
/* Add the data to the hash */
1367
@@ -3805,10 +3805,10 @@
1368
point = point->next;
1369
point->next = close;
1370
if(rlog_level >= 4) {
1374
printf("That's an append\n");
1375
- logwrite_unlock();
1378
js_destroy(zone_copy);
1380
@@ -3996,12 +3996,12 @@
1383
if(rlog_level >= 4) {
1388
show_esc_stdout(zone);
1389
printf(" to cache at %p (jsip)\n",close);
1390
- logwrite_unlock();
1394
/* Add the data to the hash */
1395
--- maradns-1.2.06.orig/server/functions_server.h 2006-03-10 00:53:39.000000000 -0800
1396
+++ maradns-1.2.06/server/functions_server.h 2006-03-10 00:56:26.000000000 -0800
1397
@@ -273,3 +273,10 @@
1399
int init_handle_noreply(int value);
1402
+/* Lock the writing of log messages */
1405
+#endif /* AUTHONLY */