mirror of https://github.com/BOINC/boinc.git
- client and server: the client includes global_prefs.xml
in scheduler request messages, without checking its contents. One user had apparently edited global_prefs.xml with an XML editor; it had an <?xml tag at the start, and had been collapsed into a single line with no newlines, and no newline at the end. This caused all scheduler requests from that client to get "Incomplete request" responses. The long-term fix is for the client to verify global_prefs.xml, and for the scheduler to parse it with XML_PARSER. As a short-term fix, I made these changes: - If the scheduler reads a line that's too long, it ignores it. - The scheduler ignores <?xml svn path=/trunk/boinc/; revision=15543
This commit is contained in:
parent
540513fc7e
commit
c478b9f9e0
|
@ -5406,3 +5406,22 @@ David 2 July 2008
|
|||
|
||||
tools/
|
||||
make_project
|
||||
|
||||
David 2 July 2008
|
||||
- client and server: the client includes global_prefs.xml
|
||||
in scheduler request messages, without checking its contents.
|
||||
One user had apparently edited global_prefs.xml with an XML editor;
|
||||
it had an <?xml tag at the start,
|
||||
and had been collapsed into a single line with no newlines,
|
||||
and no newline at the end.
|
||||
This caused all scheduler requests from that client to get
|
||||
"Incomplete request" responses.
|
||||
|
||||
The long-term fix is for the client to verify global_prefs.xml,
|
||||
and for the scheduler to parse it with XML_PARSER.
|
||||
As a short-term fix, I made these changes:
|
||||
- If the scheduler reads a line that's too long, it ignores it.
|
||||
- The scheduler ignores <?xml
|
||||
|
||||
sched/
|
||||
server_types.C
|
||||
|
|
|
@ -167,6 +167,17 @@ const char* SCHEDULER_REQUEST::parse(FILE* fin) {
|
|||
fgets(buf, sizeof(buf), fin);
|
||||
if (!match_tag(buf, "<scheduler_request>")) return "no start tag";
|
||||
while (fgets(buf, sizeof(buf), fin)) {
|
||||
// If a line is too long, ignore it.
|
||||
// This can happen e.g. if the client has bad global_prefs.xml
|
||||
// This won't be necessary if we rewrite this using XML_PARSER
|
||||
//
|
||||
if (!strchr(buf, '\n')) {
|
||||
while (fgets(buf, sizeof(buf), fin)) {
|
||||
if (strchr(buf, '\n')) break;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (match_tag(buf, "</scheduler_request>")) return NULL;
|
||||
if (parse_str(buf, "<authenticator>", authenticator, sizeof(authenticator))) {
|
||||
remove_quotes(authenticator);
|
||||
|
@ -340,6 +351,9 @@ const char* SCHEDULER_REQUEST::parse(FILE* fin) {
|
|||
if (match_tag(buf, "<resource_share>")) continue;
|
||||
if (match_tag(buf, "<scheduler_url>")) continue;
|
||||
if (match_tag(buf, "</project>")) continue;
|
||||
if (match_tag(buf, "<?xml")) continue;
|
||||
strip_whitespace(buf);
|
||||
if (!strlen(buf)) continue;
|
||||
|
||||
log_messages.printf(MSG_NORMAL,
|
||||
"SCHEDULER_REQUEST::parse(): unrecognized: %s\n", buf
|
||||
|
|
Loading…
Reference in New Issue