From f88c65125b2286931ffcc161a9c9bb769fada06b Mon Sep 17 00:00:00 2001 From: Bernd Machenschalk Date: Tue, 26 Jul 2016 10:05:55 +0200 Subject: [PATCH 1/3] BOINC GAHP: escape paths for system("mv"), in case these contain blanks --- samples/condor/boinc_gahp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/condor/boinc_gahp.cpp b/samples/condor/boinc_gahp.cpp index eec33bdf3d..d499944d21 100644 --- a/samples/condor/boinc_gahp.cpp +++ b/samples/condor/boinc_gahp.cpp @@ -534,7 +534,7 @@ void handle_fetch_output(COMMAND& c) { } else { sprintf(dst_path, "%s/%s", req.dir, of.dest); } - sprintf(buf, "mv %s/%s %s", req.dir, of.src, dst_path); + sprintf(buf, "mv '%s/%s' '%s'", req.dir, of.src, dst_path); retval = system(buf); if (retval) { s = string("mv\\ failed"); From b4a0807c40e4d6352c50957e3a19642094c594b1 Mon Sep 17 00:00:00 2001 From: Bernd Machenschalk Date: Tue, 26 Jul 2016 13:36:48 +0200 Subject: [PATCH 2/3] BOINC GAHP: append to an existing stderr file instead of overwriting it --- samples/condor/boinc_gahp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/condor/boinc_gahp.cpp b/samples/condor/boinc_gahp.cpp index d499944d21..df02c04623 100644 --- a/samples/condor/boinc_gahp.cpp +++ b/samples/condor/boinc_gahp.cpp @@ -459,7 +459,7 @@ void handle_fetch_output(COMMAND& c) { } else { sprintf(path, "%s/%s", req.dir, req.stderr_filename.c_str()); } - FILE* f = fopen(path, "w"); + FILE* f = fopen(path, "a"); if (!f) { sprintf(buf, "can't\\ open\\ stderr\\ output\\ file\\ %s ", path); s = string(buf); From 9c15fd2183a24d347bc9ea77030e16400c4ed897 Mon Sep 17 00:00:00 2001 From: Bernd Machenschalk Date: Tue, 26 Jul 2016 08:24:40 +0200 Subject: [PATCH 3/3] BOINC GAHP: assign output files by order, if not found by matching name --- samples/condor/boinc_gahp.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/samples/condor/boinc_gahp.cpp b/samples/condor/boinc_gahp.cpp index df02c04623..2bd25b0620 100644 --- a/samples/condor/boinc_gahp.cpp +++ b/samples/condor/boinc_gahp.cpp @@ -505,9 +505,14 @@ void handle_fetch_output(COMMAND& c) { char* lname = req.file_descs[i].src; int j = output_file_index(td, lname); if (j < 0) { - sprintf(buf, "requested\\ file\\ %s\\ not\\ in\\ template", lname); - s = string(buf); - goto done; + if (i >= td.output_files.size()) { + sprintf(buf, "too\\ many\\ output\\ files\\ specified\\ submit:%d\\ template:%d", + i, td.output_files.size() + ); + s = string(buf); + goto done; + } + j = i; } sprintf(path, "%s/%s", req.dir, lname); retval = get_output_file(