From: Timo Sirainen Date: Wed, 23 Dec 2009 22:35:20 +0000 (-0500) Subject: master: Log warning if unix_listener begins with base_dir's path. X-Git-Tag: 2.0.beta2~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3cc0e94bfb460b23367f90545d082e0fd6a20a4d;p=thirdparty%2Fdovecot%2Fcore.git master: Log warning if unix_listener begins with base_dir's path. --HG-- branch : HEAD --- diff --git a/src/master/master-settings.c b/src/master/master-settings.c index ef673d0217..ad82589db4 100644 --- a/src/master/master-settings.c +++ b/src/master/master-settings.c @@ -233,6 +233,7 @@ static void fix_file_listener_paths(ARRAY_TYPE(file_listener_settings) *l, ARRAY_TYPE(const_string) *all_listeners) { struct file_listener_settings *const *sets; + unsigned int base_dir_len = strlen(base_dir); if (!array_is_created(l)) return; @@ -243,6 +244,10 @@ static void fix_file_listener_paths(ARRAY_TYPE(file_listener_settings) *l, if (*set->path != '/') { set->path = p_strconcat(pool, base_dir, "/", set->path, NULL); + } else if (strncmp(set->path, base_dir, base_dir_len) == 0 && + set->path[base_dir_len] == '/') { + i_warning("You should remove base_dir prefix from " + "unix_listener: %s", set->path); } array_append(all_listeners, &set->path, 1); }