From 0760461e931dd13ff50f0b9186e16eef11f89e53 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 21 Nov 2012 14:29:40 -0800 Subject: [PATCH 1/4] - Unix build: add configure option for minimal make output --- checkin_notes | 5 +++++ configure.ac | 1 + 2 files changed, 6 insertions(+) diff --git a/checkin_notes b/checkin_notes index f44ee6aa0c..b9eac95daa 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6982,3 +6982,8 @@ David 21 Nov 2012 Makefile job.xml wrapper.cpp + +David 21 Nov 2012 + - Unix build: add configure option for minimal make output + + configure.ac diff --git a/configure.ac b/configure.ac index 1649567cb1..0a2f4dc2a2 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,7 @@ AC_CANONICAL_TARGET dnl generate .tar.gz, .tar.bz2, .zip dnl AM_INIT_AUTOMAKE(dist-bzip2 dist-zip) AM_INIT_AUTOMAKE(dist-zip) +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_CONFIG_SRCDIR(lib/shmem.cpp) From 959aee51d0d78b141ee640dff7a2ff0b1d30cdf8 Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 22 Nov 2012 10:12:51 -0800 Subject: [PATCH 2/4] - client: if a project is anonymous platform, don't send list of alternate platforms in scheduler RPC. --- checkin_notes | 7 +++++++ client/cs_platforms.cpp | 25 +++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/checkin_notes b/checkin_notes index b9eac95daa..8463a6f524 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6987,3 +6987,10 @@ David 21 Nov 2012 - Unix build: add configure option for minimal make output configure.ac + +David 22 Nov 2012 + - client: if a project is anonymous platform, + don't send list of alternate platforms in scheduler RPC. + + client/ + cs_platforms.cpp diff --git a/client/cs_platforms.cpp b/client/cs_platforms.cpp index 085445b316..1312aa0cd9 100644 --- a/client/cs_platforms.cpp +++ b/client/cs_platforms.cpp @@ -316,20 +316,21 @@ void CLIENT_STATE::detect_platforms() { // write XML list of supported platforms // void CLIENT_STATE::write_platforms(PROJECT* p, MIOFILE& mf) { - - mf.printf( - " %s\n", - p->anonymous_platform ? "anonymous" : get_primary_platform() - ); - - for (unsigned int i=1; ianonymous_platform) { + mf.printf(" anonymous\n"); + } else { mf.printf( - " \n" - " %s\n" - " \n", - platform.name.c_str() + " %s\n", get_primary_platform() ); + for (unsigned int i=1; i\n" + " %s\n" + " \n", + platform.name.c_str() + ); + } } } From f31a63b0c84298dfb63f438e4d761bcd9384420b Mon Sep 17 00:00:00 2001 From: David Anderson Date: Thu, 22 Nov 2012 10:31:55 -0800 Subject: [PATCH 3/4] - scheduler: if primary platform is anonymous, ignore alternate platforms. --- checkin_notes | 6 ++++++ sched/handle_request.cpp | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/checkin_notes b/checkin_notes index 8463a6f524..12e85c7509 100644 --- a/checkin_notes +++ b/checkin_notes @@ -6994,3 +6994,9 @@ David 22 Nov 2012 client/ cs_platforms.cpp + +David 22 Nov 2012 + - scheduler: if primary platform is anonymous, ignore alternate platforms. + + sched/ + handle_request.cpp diff --git a/sched/handle_request.cpp b/sched/handle_request.cpp index c333cc2c76..f259f0970f 100644 --- a/sched/handle_request.cpp +++ b/sched/handle_request.cpp @@ -1236,9 +1236,14 @@ void process_request(char* code_sign_key) { // platform = ssp->lookup_platform(g_request->platform.name); if (platform) g_request->platforms.list.push_back(platform); - for (i=0; ialt_platforms.size(); i++) { - platform = ssp->lookup_platform(g_request->alt_platforms[i].name); - if (platform) g_request->platforms.list.push_back(platform); + + // if primary platform is anonymous, ignore alternate platforms + // + if (strcmp(g_request->platform.name, "anonymous")) { + for (i=0; ialt_platforms.size(); i++) { + platform = ssp->lookup_platform(g_request->alt_platforms[i].name); + if (platform) g_request->platforms.list.push_back(platform); + } } if (g_request->platforms.list.size() == 0) { sprintf(buf, "%s %s", From 016b11e522113c9c8fafe5eeba9f839a82ff806d Mon Sep 17 00:00:00 2001 From: David Anderson Date: Sat, 24 Nov 2012 01:28:46 -0800 Subject: [PATCH 4/4] - client: fix uninitialized vars in CPU feature detection (from RustyBSD) --- checkin_notes | 11 +++++++ client/hostinfo_unix.cpp | 17 +++++------ html/inc/submit.inc | 4 ++- html/user/sandbox.php | 62 ++++++++++++++++++++-------------------- 4 files changed, 54 insertions(+), 40 deletions(-) diff --git a/checkin_notes b/checkin_notes index 12e85c7509..5268b99d2a 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7000,3 +7000,14 @@ David 22 Nov 2012 sched/ handle_request.cpp + +David 23 Nov 2012 + - client: fix uninitialized vars in CPU feature detection (from RustyBSD) + + client/ + hostinfo_unix.cpp + html/ + inc/ + submit.inc + user/ + sandbox.php diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 081b5eada7..e89a7f1083 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -628,9 +628,10 @@ static void parse_cpuinfo_linux(HOST_INFO& host) { void use_cpuid(HOST_INFO& host) { u_int p[4]; - int hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow, has3DNowExt = 0; + int hasMMX, hasSSE, hasSSE2, hasSSE3, has3DNow, has3DNowExt; char capabilities[256]; + hasMMX = hasSSE = hasSSE2 = hasSSE3 = has3DNow = has3DNowExt = 0; do_cpuid(0x0, p); if (p[0] >= 0x1) { @@ -652,12 +653,12 @@ void use_cpuid(HOST_INFO& host) { } capabilities[0] = '\0'; - if (hasSSE) strncat(capabilities, "sse ", 4); - if (hasSSE2) strncat(capabilities, "sse2 ", 5); - if (hasSSE3) strncat(capabilities, "sse3 ", 5); - if (has3DNow) strncat(capabilities, "3dnow ", 6); - if (has3DNowExt) strncat(capabilities, "3dnowext ", 9); - if (hasMMX) strncat(capabilities, "mmx ", 4); + if (hasSSE) strcat(capabilities, "sse "); + if (hasSSE2) strcat(capabilities, "sse2 "); + if (hasSSE3) strcat(capabilities, "sse3 "); + if (has3DNow) strcat(capabilities, "3dnow "); + if (has3DNowExt) strcat(capabilities, "3dnowext "); + if (hasMMX) strcat(capabilities, "mmx "); strip_whitespace(capabilities); char buf[1024]; snprintf(buf, sizeof(buf), "%s [] [%s]", @@ -1338,7 +1339,7 @@ int HOST_INFO::get_host_info() { m_nbytes = (double)sysconf(_SC_PAGESIZE) * (double)sysconf(_SC_PHYS_PAGES); if (m_nbytes < 0) { msg_printf(NULL, MSG_INTERNAL_ERROR, - "RAM size not measured correctly: page size %d, #pages %d", + "RAM size not measured correctly: page size %ld, #pages %ld", sysconf(_SC_PAGESIZE), sysconf(_SC_PHYS_PAGES) ); } diff --git a/html/inc/submit.inc b/html/inc/submit.inc index 9a349d98b6..5e6ed7b2eb 100644 --- a/html/inc/submit.inc +++ b/html/inc/submit.inc @@ -57,6 +57,8 @@ function req_to_xml($req, $op) { $x .= " $file->mode\n"; switch ($file->mode) { case "remote": + $x .= " $file->source\n"; + break; case "local": $x .= " $file->path\n"; break; @@ -65,7 +67,7 @@ function req_to_xml($req, $op) { case "semilocal": $x .= " $file->url\n"; break; - $file->source + } $x .= " \n"; } $x .= " diff --git a/html/user/sandbox.php b/html/user/sandbox.php index 03a86c9841..6e1b8186f8 100644 --- a/html/user/sandbox.php +++ b/html/user/sandbox.php @@ -52,7 +52,7 @@ function list_files($user, $err_msg) {
"; - if(strcmp($err_msg,"")!=0){ + if (strcmp($err_msg,"")!=0){ echo "

$err_msg


"; } $files = array(); @@ -67,7 +67,7 @@ function list_files($user, $err_msg) { sort($files); start_table(); table_header("Name
(click to view)", "Modified", "Size (bytes)", "MD5", "Delete","Download"); - foreach($files as $f) { + foreach ($files as $f) { $path = "$dir/$f"; list($error, $size, $md5) = sandbox_parse_link_file($path); if ($error) { @@ -102,36 +102,36 @@ function list_files($user, $err_msg) { function upload_file($user) { $tmp_name = $_FILES['new_file']['tmp_name']; - if (is_uploaded_file($tmp_name)) { - $name = $_FILES['new_file']['name']; - if (strstr($name, "/")) { - error_page("no / allowed"); - } - $md5 = md5_file($tmp_name); - $s = stat($tmp_name); - $size = $s['size']; - list($exist,$elf) = sandbox_lf_exist($user,$md5); - if ($exist){ - $notice = "Notice: Invalid Upload
"; - $notice .= "You are trying to upload file $name
"; - $notice .= "Another file $elf with the same content(md5: $md5) already exist!
"; - list_files($user,$notice); - return; - } else{ - // move file to download dir - // - $phys_path = sandbox_physical_path($user, $md5); - rename($tmp_name, $phys_path); + if (!is_uploaded_file($tmp_name)) { + error_page("$tmp_name is not uploaded file"); + } + $name = $_FILES['new_file']['name']; + if (strstr($name, "/")) { + error_page("no / allowed"); + } + $md5 = md5_file($tmp_name); + $s = stat($tmp_name); + $size = $s['size']; + list($exist, $elf) = sandbox_lf_exist($user, $md5); + if ($exist){ + $notice = "Notice: Invalid Upload
"; + $notice .= "You are trying to upload file $name
"; + $notice .= "Another file $elf with the same content(md5: $md5) already exist!
"; + } else{ + // move file to download dir + // + $phys_path = sandbox_physical_path($user, $md5); + rename($tmp_name, $phys_path); - // write link file - // - $dir = sandbox_dir($user); - $link_path = "$dir/$name"; - sandbox_write_link_file($link_path, $size, $md5); + // write link file + // + $dir = sandbox_dir($user); + $link_path = "$dir/$name"; + sandbox_write_link_file($link_path, $size, $md5); $notice = "Successfully uploaded file $name!
"; - list_files($user,$notice); } } + list_files($user, $notice); } function delete_file($user) { @@ -145,7 +145,7 @@ function delete_file($user) { if (!is_file($p)) { error_page("no such physical file"); } - $bused = sandbox_file_in_use($user,$name); + $bused = sandbox_file_in_use($user, $name); if ($bused){ $notice = "$name is being used by batch(es), you can not delete it now!
"; } else{ @@ -161,14 +161,14 @@ function download_file($user) { $name = get_str('name'); $dir = sandbox_dir($user); list($err, $size, $md5) = sandbox_parse_link_file("$dir/$name"); - if($err) { + if ($err) { error_page("can't parse link file"); } $p = sandbox_physical_path($user, $md5); if (!is_file($p)) { error_page("$p does not exist!"); } - do_download($p,$name); + do_download($p, $name); } function view_file($user) { $name = get_str('name');