From ecbd2945d0b927627d7d7df0ce09064f1037b94c Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 11 Aug 2004 09:42:29 +0000 Subject: [PATCH] *** empty log message *** svn path=/trunk/boinc/; revision=4038 --- checkin_notes | 11 +++++++++++ client/client_types.C | 13 +++++++------ client/client_types.h | 5 +++++ 3 files changed, 23 insertions(+), 6 deletions(-) diff --git a/checkin_notes b/checkin_notes index 6f12844a79..59c4556abc 100755 --- a/checkin_notes +++ b/checkin_notes @@ -16132,3 +16132,14 @@ Karl 2004-08-10 tools/ add.C (removed - obsolete) + +David 11 Aug 2004 + - FILE_INFO::write(): don't write signed_xml if it's not relevant + (i.e. if there's no xml_signature) + This caused an XML syntax error in client_state.xml + + NOTE: this looks similar to Rom's bug fix yesterday. + Two fixes are better than one, hopefully. + + client/ + client_types.C,h diff --git a/client/client_types.C b/client/client_types.C index d25562f4d2..a3d47c11a2 100644 --- a/client/client_types.C +++ b/client/client_types.C @@ -725,7 +725,7 @@ int FILE_INFO::write(MIOFILE& out, bool to_server) { if (upload_when_present) out.printf(" \n"); if (sticky) out.printf(" \n"); if (signature_required) out.printf(" \n"); - if (file_signature) out.printf(" \n%s\n", file_signature); + if (strlen(file_signature)) out.printf(" \n%s\n", file_signature); if (time_last_used) out.printf(" %d\n", time_last_used); if (priority) out.printf(" %d\n", priority); if (exp_date) out.printf(" %ld\n", exp_date); @@ -738,11 +738,12 @@ int FILE_INFO::write(MIOFILE& out, bool to_server) { if (retval) return retval; } if (!to_server) { - if (strlen(signed_xml)) { - out.printf(" \n%s \n", signed_xml); - } - if (strlen(xml_signature)) { - out.printf(" \n%s \n", xml_signature); + if (strlen(signed_xml) && strlen(xml_signature)) { + out.printf( + " \n%s \n" + " \n%s \n", + signed_xml, xml_signature + ); } } if (!error_msg.empty()) { diff --git a/client/client_types.h b/client/client_types.h index b70f782d0f..112644a823 100644 --- a/client/client_types.h +++ b/client/client_types.h @@ -77,8 +77,13 @@ public: int start_url; int current_url; char signed_xml[MAX_BLOB_LEN]; + // if the file_info is signed (for uploadable files) + // this is the text that is signed char xml_signature[MAX_BLOB_LEN]; + // ... and this is the signature char file_signature[MAX_BLOB_LEN]; + // if the file itself is signed (for executable files) + // this is the signature int priority; time_t time_last_used; // time of last use of FILE_INFO, update during parsing, writing, or application usage time_t exp_date;