<p></p>
<p>Let's assume I've created some Overpass extract which doesn't include metadata (i.e. <code>out;</code> instead of <code>out meta;</code> ). With GDPR in mind, this could also mean that some metadata fields like user, uid and changeset may be missing in the future.</p>
<p>Now, when processing such a file via osm2pgsql with extra attributes enabled, a mapper (!) can control the metadata fields due to the logic in taglist_t::add_attributes. This way, random values can be written to the metadata fields. Even worse, setting some special purpose keys to invalid values can abort osm2pgsql altogether.</p>
<p>Example test data:</p>
<pre><code><?xml version="1.0" encoding="UTF-8"?>
<osm version="0.6" generator="Overpass API 0.7.56.3 eb200aeb">
<node id="25477618" lat="49.1837670" lon="-122.9572343">
<tag k="highway" v="traffic_signals"/>
<tag k="osm_uid" v="x"/>
</node>
</osm>
</code></pre>
<p>Result: Osm2pgsql failed due to ERROR: illegal user id: 'x'</p>
<p>./osm2pgsql ---create --slim -O flex -S ../flex-config/simple.lua demo.osm -x</p>
<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/openstreetmap/osm2pgsql/issues/1170">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AA6353XEVMAGBN4PXNG4GYLRR6G6HANCNFSM4NDILGSQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AA6353TFNCRD3ER25LFJT7DRR6G6HA5CNFSM4NDILGS2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4JHO23YA.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/openstreetmap/osm2pgsql/issues/1170",
"url": "https://github.com/openstreetmap/osm2pgsql/issues/1170",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>