Package: postfix-policyd
Version: 1.80-2.1

installing postfix-policyd fails if the mysql root user's password contains
a forward slash (i.e. /). A certain post-install script (unknown to me at
this time)  fails should this be the case.

$ sudo aptitude install postfix-policyd
Reading package lists... Done
Building dependency tree... Done
Reading extended state information
Initializing package states... Done
Reading task descriptions... Done
Building tag database... Done
No packages will be installed, upgraded, or removed.
0 packages upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B of archives. After unpacking 0B will be used.
Writing extended state information... Done
Setting up postfix-policyd (1.80-2.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/postfix-policyd.conf
sed: file /tmp/dbconfig-generate-include.sed.i13599 line 2: unterminated
address regex
granting access to database postfixpolicyd for [EMAIL PROTECTED]:
already exists.
creating database postfixpolicyd: already exists.
populating database via sql...  done.
dbconfig-common: flushing administrative password
Starting Postfix greylisting policy daemon: start-stop-daemon: --start needs
--exec or --startas
Try `start-stop-daemon --help' for more information.
invoke-rc.d: initscript postfix-policyd, action "start" failed.
dpkg: error processing postfix-policyd (--configure):
subprocess post-installation script returned error exit status 3
Errors were encountered while processing:
postfix-policyd
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install.  Trying to recover:
Setting up postfix-policyd (1.80-2.1) ...
dbconfig-common: writing config to /etc/dbconfig-common/postfix-policyd.conf
sed: file /tmp/dbconfig-generate-include.sed.X13818 line 2: unterminated
address regex
granting access to database postfixpolicyd for [EMAIL PROTECTED]:
already exists.
creating database postfixpolicyd: already exists.
populating database via sql...  done.
dbconfig-common: flushing administrative password
Starting Postfix greylisting policy daemon: start-stop-daemon: --start needs
--exec or --startas
Try `start-stop-daemon --help' for more information.
invoke-rc.d: initscript postfix-policyd, action "start" failed.
dpkg: error processing postfix-policyd (--configure):
subprocess post-installation script returned error exit status 3
Errors were encountered while processing:
postfix-policyd

$ sudo cat /tmp/dbconfig-generate-include.sed.i13599
s/^\(.*\)_DBC_DBUSER_/\1postfix-policyd/g
s/^\(.*\)_DBC_DBPASS_/\1.Password/258;/g
s/^\(.*\)_DBC_BASEPATH_/\1/g
s/^\(.*\)_DBC_DBNAME_/\1postfixpolicyd/g
s/^\(.*\)_DBC_DBSERVER_/\1/g
s/^\(.*\)_DBC_DBPORT_/\1/g
s/^\(.*\)_DBC_DBTYPE_/\1mysql/g

The password string (appropriately changed here) on line 2 is passed as-is
and unescaped, the unescaped forward slash (/) in the substitution string
causes sed to fail with an error "unterminated address regex".

The solution to the problem is quite simple, ensure that all strings input
here are properly escaped if need be.

$ sed --version | head -n 1
GNU sed version 4.1.5

$ bash --version | head -n 1
GNU bash, version 3.1.17(1)-release (i486-pc-linux-gnu)

$ uname -a
Linux condo 2.6.18-3-686 #1 SMP Mon Dec 4 16:41:14 UTC 2006 i686 GNU/Linux

$ cat /etc/issue
Debian GNU/Linux 4.0 \n \l

Reply via email to