dovecot-common postinst fails for multiple ssl certs
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
dovecot (Ubuntu) |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Binary package hint: dovecot-common
The post-inst script for dovecot does not take into account having multiple ssl certs in the configuration. If there are, the script fails as follows:
*******
Unpacking replacement dovecot-common ...
Setting up dovecot-common (1:1.0.
[: 75: /etc/ssl/
Creating generic self-signed certificate: /etc/ssl/
/etc/ssl/
/etc/ssl/
(replace with hand-crafted or authorized one if needed).
Warning : Bad SSL config, can't generate certificate.
[: 75: /etc/ssl/
Setting up dovecot-pop3d (1:1.0.
* Restarting IMAP/POP3 mail server dovecot [ OK ]
Setting up dovecot-imapd (1:1.0.
* Restarting IMAP/POP3 mail server dovecot
*******
This appears to be the fault of the following grep not accounting for multiple occurances in postinst:
## SSL Certs
# Certs and key file
SSL_CERT=$( (grep "ssl_cert_file" /etc/dovecot/
SSL_KEY=$( (grep "ssl_key_file" /etc/dovecot/
I would recommend adding -m 1 to the grep to limit the number of hits returned to one. This wouldn't help if a random one of multiple certs was missing, but it would avoid breakage and serve the same purpose it was intended to serve now.
## SSL Certs
# Certs and key file
SSL_CERT=$( (grep -m 1 "ssl_cert_file" /etc/dovecot/
SSL_KEY=$( (grep -m 1 "ssl_key_file" /etc/dovecot/
Related branches
Changed in dovecot: | |
importance: | Undecided → Medium |
status: | New → Triaged |
Attaching debdiff with the suggestions.