From e28540630692cc7b9c5226e8c5ef58c2b801ba7e Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 10 Nov 2004 21:09:54 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4511 --- checkin_notes | 14 ++++++++++++++ client/net_xfer.C | 2 +- doc/projects.php | 6 ++++++ html/user/forum_text_search_action.php | 9 ++++++++- lib/crypt_prog.C | 22 ++++++++++++++++++++++ 5 files changed, 51 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index d56ef94316..5b01a3ded6 100755 --- a/checkin_notes +++ b/checkin_notes @@ -19216,3 +19216,17 @@ Rom 9 Nov 2004 readme.txt win_build/installerv2/redist/Windows/x86/ dbghelp.dll + +David 10 Nov 2004 + - put brackets around hostname in "can't resolve" error msg + - handle "next N" correctly in forum text search + (from Volker Hatzenberger) + - add RNG code for Windows (in case we ever need to + generate true random bits there) + + client/ + net_xfer.C + html/user/ + forum_text_search_action.php + lib/ + crypt_prog.C diff --git a/client/net_xfer.C b/client/net_xfer.C index 74210f5d1f..25bd64fd7c 100644 --- a/client/net_xfer.C +++ b/client/net_xfer.C @@ -130,7 +130,7 @@ int NET_XFER::get_ip_addr(char *hostname, int &ip_addr) { char msg[256]; int n; - n = sprintf(msg, "Can't resolve hostname %s ", hostname); + n = sprintf(msg, "Can't resolve hostname [%s] ", hostname); #ifdef WIN32 switch (WSAGetLastError()) { diff --git a/doc/projects.php b/doc/projects.php index 462d7820a1..82a60e8c80 100644 --- a/doc/projects.php +++ b/doc/projects.php @@ -31,6 +31,12 @@ you should consider the following questions: or will they belong to a for-profit business? +

+Some BOINC projects may make their application's source code available. +For such projects, BOINC's +anonymous platform mechanism +lets you participate without running downloaded executables: +you can examine and compile the source code yourself, "; page_tail(); ?> diff --git a/html/user/forum_text_search_action.php b/html/user/forum_text_search_action.php index 5e5a901096..c99bd7ca66 100644 --- a/html/user/forum_text_search_action.php +++ b/html/user/forum_text_search_action.php @@ -7,8 +7,10 @@ $search_string = $_GET['search_string']; $offset = $_GET['offset']; if (!$offset) $offset=0; $count = 10; +$what = ''; if ($_GET['titles']) { + $what = 'titles=1'; page_head("Titles containing '$search_string'"); $q = "select * from thread where match(title) against ('$search_string') limit $offset,$count"; $result = mysql_query($q); @@ -27,6 +29,11 @@ if ($_GET['titles']) { } if ($_GET['bodies']) { + if (! empty ($what)) { + $what .= '&'; + } + $what .= 'bodies=1'; + page_head("Messages containing '$search_string'"); $q = "select * from post where match(content) against ('$search_string') limit $offset,$count"; $result = mysql_query($q); @@ -47,7 +54,7 @@ if ($n==$count) { $s = urlencode($search_string); $offset += $count; echo " - Next $count + Next $count "; } diff --git a/lib/crypt_prog.C b/lib/crypt_prog.C index f5fdb62ca3..4bf919be41 100644 --- a/lib/crypt_prog.C +++ b/lib/crypt_prog.C @@ -44,6 +44,28 @@ void die(char* p) { } void better_random_create(R_RANDOM_STRUCT* r) { +#ifdef __WINDOWS__ + // in case we ever need this on Win + try { + HCRYPTPROV hCryptProv; + + if(! CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)) { + throw except("cannot acquire crypt context"); + } + + if(! CryptGenRandom(hCryptProv, (DWORD) size, (BYTE *) buf_ptr)) { + CryptReleaseContext(hCryptProv, 0); + + throw except("cannot generate random data"); + } + + CryptReleaseContext(hCryptProv, 0); + } + + catch (except &e) { + throw except(e, "cannot get random data"); + } +#endif FILE* f = fopen("/dev/random", "r"); if (!f) { fprintf(stderr, "can't open /dev/random\n");