Changeset 1256
- Timestamp:
- 08/08/08 15:54:36 (2 years ago)
- Location:
- trunk/pdns/pdns
- Files:
-
- 1 added
- 5 modified
-
Makefile.am (modified) (4 diffs)
-
common_startup.cc (modified) (1 diff)
-
misc.hh (modified) (1 diff)
-
pdns_recursor.cc (modified) (2 diffs)
-
randomhelper.cc (added)
-
receiver.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/pdns/pdns/Makefile.am
r1177 r1256 1 AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ 1 AM_CXXFLAGS=-DSYSCONFDIR=\"@sysconfdir@\" -DLIBDIR=\"@libdir@\" -DLOCALSTATEDIR=\"@socketdir@\" -Ibackends/bind @THREADFLAGS@ # -I/usr/include/lua5.1 2 2 AM_CPPFLAGS=-Ibackends/bind @THREADFLAGS@ 3 3 … … 41 41 rcpgenerator.cc dnsparser.cc dns_random.hh aes/aescpp.h \ 42 42 aes/aescrypt.c aes/aes.h aes/aeskey.c aes/aes_modes.c aes/aesopt.h \ 43 aes/aestab.c aes/aestab.h aes/brg_endian.h aes/brg_types.h aes/dns_random.cc 43 aes/aestab.c aes/aestab.h aes/brg_endian.h aes/brg_types.h aes/dns_random.cc \ 44 randomhelper.cc 44 45 45 46 # … … 121 122 base64.cc base64.hh zoneparser-tng.cc zoneparser-tng.hh rec_channel.cc rec_channel.hh \ 122 123 rec_channel_rec.cc selectmplexer.cc epollmplexer.cc sillyrecords.cc htimer.cc htimer.hh \ 123 aes/dns_random.cc aes/aescrypt.c aes/aeskey.c aes/aestab.c aes/aes_modes.c 124 aes/dns_random.cc aes/aescrypt.c aes/aeskey.c aes/aestab.c aes/aes_modes.c \ 125 lua-pdns-recursor.cc lua-pdns-recursor.hh randomhelper.cc 124 126 125 127 if NEDMALLOC … … 129 131 #../modules/gmysqlbackend/smysql.cc 130 132 131 pdns_recursor_LDFLAGS= 133 pdns_recursor_LDFLAGS= # -llua5.1 132 134 pdns_recursor_LDADD= 133 135 -
trunk/pdns/pdns/common_startup.cc
r1246 r1256 126 126 127 127 ::arg().set("max-cache-entries", "Maximum number of cache entries")="1000000"; 128 ::arg().set("entropy-source", "If set, read entropy from this file")="/dev/urandom"; 128 129 } 129 130 -
trunk/pdns/pdns/misc.hh
r1246 r1256 384 384 385 385 string stripDot(const string& dom); 386 386 void seedRandom(const string& source); 387 387 #endif -
trunk/pdns/pdns/pdns_recursor.cc
r1252 r1256 1656 1656 } 1657 1657 1658 void seedRandom(const string& source); 1658 1659 1659 1660 1660 int serviceMain(int argc, char*argv[]) … … 1911 1911 #endif 1912 1912 1913 void seedRandom(const string& source)1914 {1915 L<<Logger::Warning<<"Reading random entropy from '"<<source<<"'"<<endl;1916 1917 int fd=open(source.c_str(), O_RDONLY);1918 if(fd < 0) {1919 L<<Logger::Error<<"Unable to open source of random '"<<source<<"': "<<stringerror()<<endl;1920 exit(EXIT_FAILURE);1921 }1922 char seed[16];1923 int ret;1924 int pos=0;1925 while(pos!=sizeof(seed)) {1926 ret = read(fd, seed+pos, sizeof(seed)-pos);1927 if(ret < 0) {1928 L<<Logger::Error<<"Unable to read random seed from "<<source<<": "<<stringerror()<<endl;1929 close(fd);1930 exit(EXIT_FAILURE);1931 }1932 if(!ret) {1933 L<<Logger::Error<<"Unable to read random seed from "<<source<<": end of file"<<endl;1934 close(fd);1935 exit(EXIT_FAILURE);1936 }1937 pos+=ret;1938 }1939 close(fd);1940 dns_random_init(seed);1941 }1942 1913 1943 1914 int main(int argc, char **argv) -
trunk/pdns/pdns/receiver.cc
r1246 r1256 459 459 // we really need to do work - either standalone or as an instance 460 460 461 seedRandom(::arg()["entropy-source"]); 462 461 463 loadModules(); 462 464 BackendMakers().launch(::arg()["launch"]); // vrooooom!