[OSM-dev] usernames, keys, and values

Matt Amos zerebubuth at gmail.com
Thu Oct 29 17:31:53 GMT 2009


On Wed, Oct 28, 2009 at 3:38 PM, Andy Allan <gravitystorm at gmail.com> wrote:
> On Wed, Oct 28, 2009 at 3:22 PM, Anthony <osm at inbox.org> wrote:
>> On Wed, Oct 28, 2009 at 10:21 AM, Frederik Ramm <frederik at remote.org> wrote:
>>> Hi,
>>>
>>> Anthony wrote:
>>>>
>>>> Just took a look at the planet dump code at
>>>> http://svn.openstreetmap.org/applications/utils/planet.osm/C/output_osm.c
>>>>
>>>> In xmlescape(): "} else if ((*in >= 0) && (*in < 32)) {
>>>> escape_tmp[len] = '?'; len++; } else {"
>>>
>>> The planet dump code decides what gets *out* (to the planet file), not what
>>> gets in (to the database) and neither what gets out over the API. If you
>>> want to look at code to answer your questions then you should look at the
>>> rails port (/sites/rails_port) which guards the API.
>>
>> My real question was "how can I parse the planet dump file".  :)
>>
>> I briefly skimmed through the rails_port, but not knowing ruby/rails I
>> didn't get very far.  I suppose if I care I'll make a few tests
>> through the dev server api.  But for now I'm content with adding "if
>> (buf[ptr]<32) { fail(buf, "unexpected character data"); }" to my dump
>> parser.
>>
>> If someone decides that's a bug in the dump code, and not a feature,
>> please let us know here.
>
> I would say that if the dump code and
> http://www.w3.org/TR/REC-xml/#NT-Char
> are in conflict, there's a bug in the dump code. But since I'm not
> going to fix it, maybe I'll keep my opinions quiet :-)
>
> As for the rails code, there is (AFAIK) no explicit character
> checking. The server implicitly relies on libxml to ensure the
> characters in the XML requests and responses are only those allowed by
> the XML spec above.

there is explicit checking in the potlatch API, as that doesn't go
through libxml:

http://trac.openstreetmap.org/browser/sites/rails_port/app/controllers/amf_controller.rb#L909

cheers,

matt




More information about the dev mailing list