[Dovecot] version 1.2.11 creating symlink loop for config file
What is the following at the end of "main_init" in dovecot 1.2.11 (src/master/main.c) intended to accomplish?
base_config_path = t_strconcat(settings_root->defaults->base_dir,
"/"PACKAGE".conf", NULL);
(void)unlink(base_config_path);
if (symlink(configfile, base_config_path) < 0) {
i_error("symlink(%s, %s) failed: %m",
configfile, base_config_path);
}
}
With our compilation parameters and runtime setup it ends up removing the working base_config_path file and making it instead a symlink to itself. (I.e. a non-working loop). Strangely, the one instance of dovecot continues and seems to mostly work. But (for now) I need to put back the proper dovecot.conf before I can restart it.
I think that would be the expected result if strcmp(configfile, base_config_path) == 0. Is that in fact not expected to be the case? (See my initial question).
I did not expect self-modifying of configuration like this. (See my initial question).
Pattern matches (e.g. "config_path") find no apparent mention of this in recent postings.
Adrian Pepper Computer Science Computing Facility David R. Cheriton School of Computer Science University of Waterloo arpepper@uwaterloo.ca
After the bug has happened... services110.cs# servers/dovecot -n # 1.2.11: /software/imap-dovecot-1.2/data/etc/dovecot/dovecot.conf Error: Can't open configuration file /software/imap-dovecot-1.2/data/etc/dovecot/dovecot.conf: Number of symbolic links encountered during path name traversal exceeds MAXSYMLINKS Fatal: Invalid configuration in /software/imap-dovecot-1.2/data/etc/dovecot/dovecot.conf services110.cs#
services110.cs# servers/dovecot -n
# 1.2.11: /software/imap-dovecot-1.2/data/etc/dovecot/dovecot.conf
Warning: fd limit 256 is lower than what Dovecot can use under full load (more than 768). Either grow the limit or change login_max_processes_count and max_mail_processes settings
# OS: SunOS 5.8 sun4u
base_dir: /software/imap-dovecot-1.2/data/etc/dovecot/
protocols: imap imaps pop3 pop3s
ssl_cert_file: /software/sslCerts/config/certs/dovecot.pem
ssl_key_file: /software/sslCerts/config/certs/private/dovecot.key
disable_plaintext_auth: no
login_dir: /software/imap-dovecot-1.2/data/etc/dovecot/home/
login_executable(default): /software/imap-dovecot-1.2/libexec/dovecot/imap-login
login_executable(imap): /software/imap-dovecot-1.2/libexec/dovecot/imap-login
login_executable(pop3): /software/imap-dovecot-1.2/libexec/dovecot/pop3-login
first_valid_uid: 100
last_valid_uid: 65535
first_valid_gid: 100
last_valid_gid: 65535
mail_location: mbox:~:INDEX=~/.imap:INBOX=/var/mail/%u
mmap_disable: yes
dotlock_use_excl: no
mail_nfs_storage: yes
mail_nfs_index: yes
mail_executable(default): /software/imap-dovecot-1.2/libexec/dovecot/imap
mail_executable(imap): /software/imap-dovecot-1.2/libexec/dovecot/imap
mail_executable(pop3): /software/imap-dovecot-1.2/libexec/dovecot/pop3
mail_plugin_dir(default): /software/imap-dovecot-1.2/lib/dovecot/imap
mail_plugin_dir(imap): /software/imap-dovecot-1.2/lib/dovecot/imap
mail_plugin_dir(pop3): /software/imap-dovecot-1.2/lib/dovecot/pop3
namespace:
type: private
separator: /
prefix: maildir_mail/
location: maildir:~/.maildir
list: yes
subscriptions: yes
namespace:
type: private
separator: /
location: mbox:~/.:INBOX=/var/mail/%u:INDEX=~/.imap1
inbox: yes
list: yes
subscriptions: yes
namespace:
type: private
separator: /
prefix: mail/
location: mbox:~/mail:INDEX=~/.imap2
list: yes
subscriptions: yes
lda:
postmaster_address: postmaster@cs.uwaterloo.ca
hostname: cs.uwaterloo.ca
auth default:
verbose: yes
debug: yes
passdb:
driver: passwd-file
args: /etc/shadow
userdb:
driver: passwd
args: blocking=yes
services110.cs#
This is not a production setup; some/most configuration is experimental or speculative.
"dovecot -n" does not appear to remove the config file.
On Wed, 2010-04-14 at 13:25 -0400, Adrian Pepper wrote:
services110.cs# servers/dovecot -n # 1.2.11: /software/imap-dovecot-1.2/data/etc/dovecot/dovecot.conf Warning: fd limit 256 is lower than what Dovecot can use under full load (more than 768). Either grow the limit or change login_max_processes_count and max_mail_processes settings # OS: SunOS 5.8 sun4u
base_dir: /software/imap-dovecot-1.2/data/etc/dovecot/
base_dir really isn't meant to be under etc/. Why did you think of putting it there? Maybe the symlink loop is the only problem currently, but I can't promise other things won't break in future. The base_dir should point to somewhere that doesn't contain any other files, so Dovecot should be free to delete all files under it if it so chooses. Dovecot also doesn't need any files to permanently exist there, the whole directory could be deleted every time before startup.
Am 14.04.2010 20:33 schrieb Timo Sirainen:
base_dir really isn't meant to be under etc/. The base_dir should point to somewhere that doesn't contain any other files, so Dovecot should be free to delete all files under it if it so chooses. Dovecot also doesn't need any files to permanently exist there, the whole directory could be deleted every time before startup.
could you add this to http://wiki.dovecot.org/MainConfig?highlight=(base_dir) ?
-- Andreas Schulze Internetdienste | P532
DATEV eG 90329 Nürnberg | Telefon +49 911 319-0 | Telefax +49 911 319-3196 E-Mail info @datev.de | Internet www.datev.de Sitz: 90429 Nürnberg, Paumgartnerstr. 6-14 | Registergericht Nürnberg, GenReg Nr.70 Vorstand Prof. Dieter Kempf (Vorsitzender) Dipl.-Kfm. Wolfgang Stegmann (stellvertretender Vorsitzender) Dipl.-Kfm. Michael Leistenschneider Jörg Rabe v. Pappenheim Dipl.-Vw. Eckhard Schwarzer Vorsitzender des Aufsichtsrates: Reinhard Verholen
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Thu, 15 Apr 2010, Andreas Schulze wrote:
could you add this to http://wiki.dovecot.org/MainConfig?highlight=(base_dir) ?
IMHO: It is:
" base_dir = /var/run/dovecot/ "
/var/run contains runtime information for programs, often even located on a RAM disk. http://www.pathname.com/fhs/pub/fhs-2.3.html#VARRUNRUNTIMEVARIABLEDATA
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBS8a8HL+Vh58GPL/cAQKiPggAp+ZvZBbvelymEqb2hCf4c0+57WSv87wH f19h/kvIIZaOakQJQNVOlcPBwcatiTosbIgseVa3xZt33s4e5WSPr/9+ABIYZf0A PVHrqNOMw+0KufrlO7M9xTP87LfMJ5JPCQuWzMis+51r2z1PBJthX+CcxZLqKEQY 2vRsXefBRAgxajd29kyeJDMWkyRCzrfz7hHx0HwSqTgQvl8Jw8mPNMxDmw5lpt9L S74T6+/jLNI7G2GXjrS7Pj5CCkwXbPPrVB7fbeHbdwL/RR9ObOnHSgU1qvRFmYXZ o284S1oQxWNRndt/2ELBGba52X5OyUdxlPP57mVtGB1B9yAPZkrgYg== =yu0v -----END PGP SIGNATURE-----
participants (4)
-
Adrian Pepper
-
Andreas Schulze
-
Steffen Kaiser
-
Timo Sirainen