From aa4276602ee2e011e8e05840d2ed930804013d5c Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Wed, 18 Jul 2012 05:19:59 +0000 Subject: [PATCH] 4538: security - information disclosure: export with 'restrict data on living people'on leaks first names when patronymic is present svn: r20025 --- src/gen/proxy/living.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gen/proxy/living.py b/src/gen/proxy/living.py index a1a7143d8..ebe578c54 100644 --- a/src/gen/proxy/living.py +++ b/src/gen/proxy/living.py @@ -37,7 +37,7 @@ from itertools import ifilter # #------------------------------------------------------------------------- from proxybase import ProxyDbBase -from gen.lib import Date, Person, Name, Surname +from gen.lib import Date, Person, Name, Surname, NameOriginType from gen.utils.alive import probably_alive from gen.config import config @@ -266,16 +266,19 @@ class LivingProxyDb(ProxyDbBase): new_name.set_type(old_name.get_type()) if self.mode == self.MODE_INCLUDE_LAST_NAME_ONLY: new_name.set_first_name(config.get('preferences.private-given-text')) + new_name.set_title("") else: # self.mode == self.MODE_INCLUDE_FULL_NAME_ONLY new_name.set_first_name(old_name.get_first_name()) new_name.set_suffix(old_name.get_suffix()) new_name.set_title(old_name.get_title()) surnlst = [] for surn in old_name.get_surname_list(): - surnlst.append(Surname(source=surn)) + surname = Surname(source=surn) + if int(surname.origintype) in [NameOriginType.PATRONYMIC, + NameOriginType.MATRONYMIC]: + surname.set_surname(config.get('preferences.private-surname-text')) + surnlst.append(surname) new_name.set_surname_list(surnlst) - new_name.set_privacy(old_name.get_privacy()) - new_person.set_primary_name(new_name) new_person.set_privacy(person.get_privacy()) new_person.set_gender(person.get_gender())