changeset 10538:6f67d3ce4ac4 HEAD

master: Log warning if unix_listener begins with base_dir's path.
author Timo Sirainen <tss@iki.fi>
date Wed, 23 Dec 2009 17:35:20 -0500
parents 263068802498
children 0462fcfb809a
files src/master/master-settings.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/master-settings.c	Wed Dec 23 17:25:23 2009 -0500
+++ b/src/master/master-settings.c	Wed Dec 23 17:35:20 2009 -0500
@@ -233,6 +233,7 @@
 				    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 @@
 		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);
 	}