Your message dated Mon, 17 Oct 2016 10:20:13 +0000
with message-id <e1bw51h-0002qu...@franck.debian.org>
and subject line Bug#840510: fixed in geoip 1.6.9-4
has caused the Debian Bug report #840510,
regarding geoip-generator-asn: broken ASN due to csv misparsing
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
840510: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=840510
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: geoip-bin
Version: 1.6.2-4
Severity: normal
Tags: patch

Dear Maintainer,

I noticed that some ASN looks mangled (first and last character cut off,
e.g. `geopiplookup 163.172.217.0|tail -1` -> 'GeoIP ASNum Edition: S1287' [it should've been 'GeoIP ASNum Edition: AS12876'])
and discovered that geoip-generator-asn misparses unquoted CSV fields.

This bug also affects geoip-database-extra in jessie-backports (and likely jessie too).

Patch attached (note: I only made minimal effort to make things work, this "CSV parser" is still incomplete and fails to handle full CSV syntax).

P.S. ASN/v6 change in patch is completely untested (it seems produces
mangled database [as before]).

-- System Information:
Debian Release: 8.6
  APT prefers stable-updates
APT policy: (500, 'stable-updates'), (500, 'stable'), (100, 'proposed-updates')
Architecture: i386 (x86_64)
Foreign Architectures: amd64

Kernel: Linux 3.16.0-4-amd64 (SMP w/2 CPU cores)
Locale: LANG=ru_RU.KOI8-R, LC_CTYPE=ru_RU.KOI8-R (charmap=KOI8-R)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages geoip-bin depends on:
ii  libc6       2.19-18+deb8u6
ii  libgcc1     1:4.9.2-10
ii  libgeoip1   1.6.2-4
ii  libstdc++6  4.9.2-10

geoip-bin recommends no packages.

geoip-bin suggests no packages.

-- no debconf information

--- geoip_1.6.7-2~bpo8+1/debian/src/geoip-asn-csv-to-dat.cpp.orig	2016-10-12 12:17:11.000000000 +0300
+++ geoip_1.6.7-2~bpo8+1/debian/src/geoip-asn-csv-to-dat.cpp	2016-10-12 12:28:38.000000000 +0300
@@ -480,7 +480,10 @@
 			fields.push_back(buf.substr(0,fs));
 			buf.erase(0,fs + 1);
 		}
+		if (buf[0] == '"' || buf[0] == '\'')
 		fields.push_back(buf.substr(1, buf.length() - 2));
+		else
+			fields.push_back(buf);
 	}
 
 	void
@@ -489,13 +492,16 @@
 		std::vector<std::string> & fields)
 	{
 		std::string buf(line);
-		std::string delim = ", ";
+		std::string delim = ",";
 		std::size_t fs;
 		for(int i = 0; i<3;++i) {
 			fs = buf.rfind(delim);
 			fields.push_back(buf.substr(fs+2, buf.length()));
 			buf.erase(fs,buf.length());
 		}
+		if (buf[0] == '"' || buf[0] == '\'')
+			fields.push_back(buf.substr(1, buf.length() - 2));
+		else
 		fields.push_back(buf.substr(0, buf.length()));
 	}
 


--- End Message ---
--- Begin Message ---
Source: geoip
Source-Version: 1.6.9-4

We believe that the bug you reported is fixed in the latest version of
geoip, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 840...@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Patrick Matthäi <pmatth...@debian.org> (supplier of updated geoip package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmas...@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Mon, 17 Oct 2016 09:32:44 +0200
Source: geoip
Binary: libgeoip1 libgeoip-dev geoip-bin geoip-dbg
Architecture: source amd64
Version: 1.6.9-4
Distribution: unstable
Urgency: medium
Maintainer: Patrick Matthäi <pmatth...@debian.org>
Changed-By: Patrick Matthäi <pmatth...@debian.org>
Description:
 geoip-bin  - IP lookup command line tools that use the GeoIP library
 geoip-dbg  - debugging symbols for the GeoIP packages
 libgeoip-dev - Development files for the GeoIP library
 libgeoip1  - non-DNS IP-to-country resolver library
Closes: 840510
Changes:
 geoip (1.6.9-4) unstable; urgency=medium
 .
   * Add patch from Yuriy M. Kaminskiy to fix mangled ASN database output due to
     CSV missparsing.
     Closes: #840510
Checksums-Sha1:
 f35e3bf30a508036ab43052ddc1bb22b9c971c36 1885 geoip_1.6.9-4.dsc
 241a37662d00d9f24cecf17b5efa5c1eca10e4cd 22256 geoip_1.6.9-4.debian.tar.xz
 81bdb46cc47499f3f496ed640e1f3c56099c30d5 66368 geoip-bin_1.6.9-4_amd64.deb
 3874e91ab2e886a1d82a80def556ed3c55575e43 359346 geoip-dbg_1.6.9-4_amd64.deb
 e3f7c8224cda9a0718734bd38f4152a5f6809664 99750 libgeoip-dev_1.6.9-4_amd64.deb
 d1c98b164730c0c6ae7547fedf774b25480c493b 90510 libgeoip1_1.6.9-4_amd64.deb
Checksums-Sha256:
 79893cc7759efe042ab20af420d784422cea6f38d1123d8cff69b2a6d0192a02 1885 
geoip_1.6.9-4.dsc
 6bd311181cd7ad44ea78c9bce4d93e67f6f6aca07de93c1aeefcf44ed928d015 22256 
geoip_1.6.9-4.debian.tar.xz
 70f33b09402354aa1a898367e89d0dcf58078b0076bd48ce5e55450c8c428520 66368 
geoip-bin_1.6.9-4_amd64.deb
 8c0ff149830b3d7a9e41b74edcbf8cee778d42b8af1cc85868db8b9280d71a4e 359346 
geoip-dbg_1.6.9-4_amd64.deb
 06c42d81c8ea136adc255ed35757dd5d7d785806f0efbfe3fc10d6325e32b720 99750 
libgeoip-dev_1.6.9-4_amd64.deb
 0a04f25fe48856e32b9881eaf10cc0c97b9115b9a2080966d345adec2d1e3ae0 90510 
libgeoip1_1.6.9-4_amd64.deb
Files:
 c8d307aebf741fcb1d3175e0c0b7fecb 1885 net optional geoip_1.6.9-4.dsc
 d61150c1fc5050123055466e09eefafa 22256 net optional geoip_1.6.9-4.debian.tar.xz
 88246d280af3f400b3dd5d8b7ce70fdb 66368 net optional geoip-bin_1.6.9-4_amd64.deb
 de0b80d18727aedbc44c42cf7f6c2d99 359346 debug extra geoip-dbg_1.6.9-4_amd64.deb
 d94d2c6eeaad64b4531005760d510dcf 99750 libdevel optional 
libgeoip-dev_1.6.9-4_amd64.deb
 6ea27f098fd81b968ec6ff4078d4a628 90510 libs optional 
libgeoip1_1.6.9-4_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCAAGBQJYBI/mAAoJEBLZsEqQy9jkR1wQAI+a0Y0BUiIrjIMgOzcgd4mk
46T1y/gzQ7PBSihHrFGEuJKj2Gdn4HnEnPlfp3IYCExHH23Getzn+l5SLyvDP7D5
qg0x1gib4upVig6bb0F/Hdg5giSqlilBkQ5VNlUwXobVNK34RmSvwdVJmQzvF2Ko
LkmH3JNVFpJtiP0+qPu5APVdS5749wmyr6be5YTAorfHVGO/0xt0hhZ6ldsErzl/
ER+leIgeU/ho6d62T2FF2RQDofoAEPoq+ZNz/U8as1s5KJj2eGm1jkkkkMEO8tzK
qWHYMyd3Z9KuaMXprfZ0t4xRi4hqCDtY8AaLT+YachAJvzs4xz4nYOH5wLeCFTCZ
91RysuQIz9Kdn9lZnJ/afHWWx/tfoVOohbC5TdmBdBhgw4eKcfv0Kk4cuwKAUbfi
geojbBJkh7N+L2nJdrZ4+AALqvWzKal8DZTQ4f/4vVBKZ/T6TSPDZHgB9jKUJtJd
adamC7gYE5Pp/DlY4QNrFEgLK/MwrC80ILbUc8Row7WYXq45ZFQI6GufjaUtrg6Y
m8cZrlpa14D/TxMva7WijTjjXgaXCBHNwAcLfO1sqKLXDFoun+ACHIwPorgJvGBw
zjT1AjJu2ABhWcUgmLZwBkBg1WREaEkeypk4G4gbLqbWYv5BbuMoaoxVRJHB7bJE
jwCrS0XWkSMRHjJCeVPt
=V83B
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to