This adds a compile flag TINY_BINARY that disables some features (some of Deadwood's newer anal parsing rules and filter_rfc1918) so that the Windows binary of Deadwood is 65,536 bytes in size. diff -ur deadwood-3.0.05/src/DwDnsStr.c deadwood-3.0.05-tiny_binary/src/DwDnsStr.c --- deadwood-3.0.05/src/DwDnsStr.c Wed Nov 9 13:39:14 2011 +++ deadwood-3.0.05-tiny_binary/src/DwDnsStr.c Sat Nov 12 03:52:48 2011 @@ -501,6 +501,7 @@ return 0; } +#ifndef TINY_BINARY /* Filter private IPs; see http://crypto.stanford.edu/dns/ for * why this improves security */ if(ip->len == 4 && key_n[DWM_N_filter_rfc1918] == 1) { @@ -530,6 +531,7 @@ return 1; } } +#endif /* TINY_BINARY */ if(blacklist_hash == 0) { return 0; diff -ur deadwood-3.0.05/src/DwMararc.c deadwood-3.0.05-tiny_binary/src/DwMararc.c --- deadwood-3.0.05/src/DwMararc.c Wed Nov 9 13:39:15 2011 +++ deadwood-3.0.05-tiny_binary/src/DwMararc.c Sat Nov 12 03:50:43 2011 @@ -569,13 +569,16 @@ if(key_d[num] == 0 && todo == 6) { /* Initialized with {} */ key_d[num] = dwd_init(); return; +#ifndef TINY_BINARY } else if(key_d[num] != 0 && todo == 6) { /* Only initialize once */ dwm_fatal("Dictionary variable already initialized"); +#endif /* TINY_BINARY */ } else if(key_d[num] == 0) { dwm_fatal("Uninitialized dictionary variable"); } if(todo != 4) { /* =, create new dictionary element */ +#ifndef TINY_BINARY check = dwd_fetch(key_d[num],key); if(check != 0) { dw_log_dwstr_str("Warning: Dictionary element \"", @@ -587,6 +590,7 @@ /*dw_fatal( "Dictionary elements must be defined only once");*/ } +#endif /* TINY_BINARY */ key_d[num] = dwd_add(key_d[num],key,value); return; } diff -ur deadwood-3.0.05/src/DwSocket.c deadwood-3.0.05-tiny_binary/src/DwSocket.c --- deadwood-3.0.05/src/DwSocket.c Wed Nov 9 13:39:14 2011 +++ deadwood-3.0.05-tiny_binary/src/DwSocket.c Sat Nov 12 03:47:13 2011 @@ -479,6 +479,7 @@ dw_fatal("Please fix this line"); } dw_put_u16(q, 65395, -1); /* NS refer private RR */ +#ifndef TINY_BINARY /* Forbid duplicate lines to minimize chance of user * confusion */ check = dwh_get(cache,q,1,1); @@ -487,6 +488,7 @@ "\"] (used in both root_servers and upstream_servers)",0); dw_fatal("Same entry can not be in both"); } +#endif /* TINY_BINARY */ dwh_add(cache,q,ns_refer,1,2); dw_destroy(q); dw_destroy(s); @@ -547,6 +549,7 @@ } set_ipmask_list(recursive_acl,r_acl); +#ifndef TINY_BINARY /* Harlan's issue: Make sure all bind addresses are in the recursive * ACL */ for(a = 0; a < DW_MAXIPS; a++) { @@ -563,6 +566,7 @@ if(DW_MAXIPS == a) { dw_fatal("Too many bind_address IPs"); } +#endif /* TINY_BINARY */ process_numeric_mararc_params();