http://bugzilla.moblin.org/show_bug.cgi?id=2425
--- Comment #6 from pohly <patrick.ohly(a)intel.com> 2010-03-05 09:12:32 PST ---
I noticed that our implementation of storing the servers map was faulty. It
didn't handle the case that the remote ID was an empty string. In that case,
SyncSourceAdmin::mapid2entry() generated a value of " 1". The leading space is
stripped when storing as value in a node, so then entry2mapid() mistakes the
"1" as the id and sets flags to zero.
The patch below fixes the problem, while preserving backwards compatibility to
existing map files. While looking at the two functions, I noticed that
mapid2entry() escapes the ID before adding it to the key, whereas entry2mapid()
unescapes the key, then extracts the ID. That doesn't look right. It should
first split at "-", then unescape the parts.
The key point is: what if the "-" separator is part of the ID?
Congwu, you touched that code last. Do you agree that there is something to be
fixed here? Also, any comments on the patch below?
commit 9b1ea5cb4fd8e6db40c61efeab9a36f3fd68c218
Author: Patrick Ohly <patrick.ohly(a)intel.com>
Date: Fri Mar 5 18:04:19 2010 +0100
SyncSourceAdmin: fixed storing of map item with no remote ID (MB #2425)
With our own server, the testInterruptRetryServerAdd case failed. It
turned out that SyncSourceAdmin::mapid2entry() was generating " 1" for
empty remote ID and flags == 1, which then was stored as "1" and
misinterpreted as remote ID "1" with flags == 0 by
SyncSourceAdmin::entry2mapid().
Our config nodes cannot store leading or trailing spaces. We could
quote empty strings, but that would lead to backward compatibility
problems. Therefore this patch treats a single word in the value as
the flags and explicitly creates such values, instead of relying on
the key/value store to do that implicitly.
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching someone on the CC list of the bug.