diff --git a/COPYRIGHT b/COPYRIGHT index 73846be647..910d148100 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -31,7 +31,7 @@ // Copyright (c) 1996 - 2006, Daniel Stenberg, . // // -// OpenSSL & SSLaey +// OpenSSL & SSLeay // http://www.openssl.org/ // Source: http://www.openssl.org/ // Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved. @@ -43,4 +43,4 @@ // Source: http://www.zlib.org // Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler // -// \ No newline at end of file +// diff --git a/checkin_notes b/checkin_notes index d1c089db1d..7b00fccb49 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13180,3 +13180,29 @@ Rom 7 Dec 2006 clientgui/ SkinManager.cpp, .h + +David 7 Dec 2006 + - change sample_get_project_config.php so that it can be used + to get project status. Its reply will have + 1 + if the scheduler is disabled + (note: the project may have no work; no API tells you that) + 1 + if web access to the DB is disabled + (renamed project_is_stopped() to web_stopped() in util.inc; + some projects may need to update their home pages accordingly) + - core client: use vsnprintf() instead of vsprintf() + to protect against buffer overrun + + COPYRIGHT + client/ + cs_scheduler.C + html/ + inc/ + util.inc + xml.inc + user/ + sample_get_project_config.phhp + sample_index.php + lib/ + mfile.C diff --git a/client/cs_scheduler.C b/client/cs_scheduler.C index f6ad422dd4..fc16a192a7 100644 --- a/client/cs_scheduler.C +++ b/client/cs_scheduler.C @@ -1189,13 +1189,13 @@ int CLIENT_STATE::handle_scheduler_reply( // update records for ack'ed results // for (i=0; igot_server_ack = true; } else { diff --git a/doc/help_funcs.php b/doc/help_funcs.php index 41c061ab59..870020164e 100644 --- a/doc/help_funcs.php +++ b/doc/help_funcs.php @@ -25,7 +25,7 @@ function button_image($status) { function status_string($status) { if ($status==1) return "Offline"; if ($status==2) return "Online"; - if ($status==7) return "Skype Me!"; + if ($status==7) return "Skype Me!"; if ($status==3) return "Away"; if ($status==4) return "Not available"; if ($status==5) return "Do not disturb"; diff --git a/doc/projects.inc b/doc/projects.inc index 6bfa332a1c..c945ed66e6 100644 --- a/doc/projects.inc +++ b/doc/projects.inc @@ -73,14 +73,6 @@ $earth = array( "cpn_logo_world_1.jpg" ), - array( - "Seasonal Attribution Project", - "http://attribution.cpdn.org/", - "Oxford University", - "Earth sciences", - "To determine the extent to which extreme weather events like the United Kingdom floods of Autumn 2000 are attributable to human-induced climate change. We invite you to download and run high-resolution model simulations of the world\'s climate on your own computer. By comparing the results of these simulations, half of which will include the effects of human-induced climate change, and half of which will not, we will investigate the possible impact of human activity on extreme weather risk. This project has fairly high computing requirements, including 1GB RAM.", - "cpn_logo_world_1.jpg" - ), ), ); $astro_phys_chem = array( diff --git a/html/inc/util.inc b/html/inc/util.inc index 64287e24b4..e7a84acf22 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -9,7 +9,7 @@ require_once("../inc/translation.inc"); $generating_xml = false; function db_init() { - if (project_is_stopped()) { + if (web_stopped()) { page_head("Not available"); echo "This page requires database access. Our database server is temporarily shut down for maintenance. @@ -458,9 +458,12 @@ function format_credit($x) { return number_format($x, 2); } -function project_is_stopped() { - if (file_exists("../../stop_web")) return true; - return false; +function web_stopped() { + return file_exists("../../stop_web"); +} + +function sched_stopped() { + return file_exists("../../stop_sched"); } function user_links($user) { diff --git a/html/inc/xml.inc b/html/inc/xml.inc index 703678b281..b40ca6a01e 100644 --- a/html/inc/xml.inc +++ b/html/inc/xml.inc @@ -4,7 +4,7 @@ require_once("../inc/db.inc"); require_once("../inc/util.inc"); function db_init_xml() { - if (project_is_stopped()) { + if (web_stopped()) { return -183; } $retval = db_init_aux(); diff --git a/html/user/sample_get_project_config.php b/html/user/sample_get_project_config.php index 72c05428bf..6310e34cdb 100644 --- a/html/user/sample_get_project_config.php +++ b/html/user/sample_get_project_config.php @@ -17,9 +17,10 @@ echo " $long_name "; -if (project_is_stopped()) { +if (web_stopped()) { echo " -183 + 1 "; } else { if ($disable_account_creation || defined('INVITE_CODES')) { @@ -33,6 +34,11 @@ if (project_is_stopped()) { echo " $forum_version\n"; } } +if (sched_stopped()) { + echo " + 1 + "; +} echo " "; diff --git a/html/user/sample_index.php b/html/user/sample_index.php index 30b99d4acb..a18c7d4d51 100644 --- a/html/user/sample_index.php +++ b/html/user/sample_index.php @@ -53,7 +53,7 @@ if ($caching) { start_cache(INDEX_PAGE_TTL); } -$stopped = project_is_stopped(); +$stopped = web_stopped(); $rssname = PROJECT . " RSS 2.0" ; $rsslink = URL_BASE . "rss_main.php"; diff --git a/lib/mfile.C b/lib/mfile.C index e5768cac49..eeebac6efe 100644 --- a/lib/mfile.C +++ b/lib/mfile.C @@ -57,11 +57,17 @@ int MFILE::open(const char* path, const char* mode) { return 0; } +#define BUFSIZE 100000 + int MFILE::vprintf(const char* format, va_list ap) { - char buf2[65536]; + char buf2[BUFSIZE]; int n, k; - k = vsprintf(buf2, format, ap); + k = vsnprintf(buf2, BUFSIZE, format, ap); + if (k<1 || k>=BUFSIZE) { + fprintf(stderr, "ERROR: buffer too small in MFILE::vprintf()\n"); + return -1; + } n = (int)strlen(buf2); buf = (char*)realloc(buf, len+n+1); if (!buf) {