Our Perl app which is compiled as exe do following:
- read lot of params from ini file (including dbname+username+password)
- connect to db with specified params and do some maintenance work
Problem: when recently admin changed password on server and new password contains “;” (semicolon) char. That make Perl app always fail on attempt to connect DB2 database.
So, it looks a bit weird – shell scripts works fine, win32 app works fine with new password. But only this Perl executable always fail to connect db2 db.
I made a small experiment – set the same password on our local staging environment and I see exactly the same effect – shell scripts and win32 app works fine but only Perl app fail.
Then I replaced semicolon in password with “-” and now all Perl app works fine (all other also works fine).
Thus, it looks like problem is exactly with “;” char in password!
Info about Perl app:
- this is Windows platform (and Db2 is 11.1.47)
- This is perl, v5.8.8 built for MSWin32-x86-multi-thread
- PerlApp 6.0.2 build 203380
- used packages:
- Config::IniFiles 2.52 – http://search.cpan.org/dist/Config-IniFiles-2.52/
- DBI 1.58 – http://search.cpan.org/dist/DBI-1.58/
- DBD::DB2 1.79 – http://search.cpan.org/dist/DBD-DB2-1.79/
Please note: I added debug output to our Perl app and I confirm that password string passed into a call to DBI-connect is 100% valid. So, value with semicolon was correctly loaded from ini-file and seems it fail somewhere inside DBI-connect.
Questions are:
- Is it possible to mask semicolon char in ini file to make DBI (or DBD::DB2 ?) module connect db2 database correctly even with semicolon in a password?
- In a theory – what could be wrong with a string with semicolon inside a function like DBI-connect(…) ?
- What other characters in a string value could cause problems when calling Perl functions?