sepinf-inc / IPED

IPED Digital Forensic Tool. It is an open source software that can be used to process and analyze digital evidence, often seized at crime scenes by law enforcement or in a corporate investigation by private examiners.
Other
893 stars 214 forks source link

Locale config loaded sooner #1980

Closed patrickdalla closed 8 months ago

patrickdalla commented 8 months ago

Closes #1979 Load config soon after object creation to avoid dependent code execution before it.

patrickdalla commented 8 months ago

PythonParser has some static fields loaded using iped.parsers.util.Messages. PythonTask access PythonParser, also at class loading. Messages get its location info from System properties only once, the first execution saving it internally. This locale System property is set on LocaleConfig object load method. So, before the comit, as the LocaleConfig wasn't loaded, taskinstaller loaded PythonTask that loaded PythonParser that called Messages initialization before locale info in LocaleConfig was set in SystemProperties.

lfcnassif commented 8 months ago

Thank you @patrickdalla. But if you can answer the questions I made on #1979 I would appreciate, so we can tag the issue properly.

patrickdalla commented 8 months ago

PythonParser has some static fields loaded using iped.parsers.util.Messages. PythonTask access PythonParser, also at class loading. Messages get its location info from System properties only once, the first execution saving it internally. This locale System property is set no LocaleConfig load. So, before the comit, as the LocaleConfig wasn't loaded, taskinstaller loaded PythonTask that loaded PythonParser that called Messages initialization before locale info in LocaleConfig was set in SystemProperties.

I detected that it was affecting parser Messages, i. e., only locale info used by classes on iped-parsers.

patrickdalla commented 8 months ago

Thank you @patrickdalla. But if you can answer the questions I made on #1979 I would appreciate, so we can tag the issue properly.

Right. I will check it tomorow. Maybe class loading order is different when running inside eclipse IDE.