changeset 7179:e1a45bbd63d9 HEAD

If base_dir is set, use it as the default auth-master socket directory.
author Timo Sirainen <tss@iki.fi>
date Sun, 20 Jan 2008 14:07:25 +0200
parents d8f8b5ab2b8f
children 1869c4827e86
files src/deliver/deliver.c
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/deliver/deliver.c	Sun Jan 20 14:05:26 2008 +0200
+++ b/src/deliver/deliver.c	Sun Jan 20 14:07:25 2008 +0200
@@ -41,7 +41,6 @@
 #include <syslog.h>
 
 #define DEFAULT_CONFIG_FILE SYSCONFDIR"/dovecot.conf"
-#define DEFAULT_AUTH_SOCKET_PATH PKG_RUNDIR"/auth-master"
 #define DEFAULT_SENDMAIL_PATH "/usr/lib/sendmail"
 #define DEFAULT_ENVELOPE_SENDER "MAILER-DAEMON"
 
@@ -844,8 +843,13 @@
 	t_array_init(&extra_fields, 64);
 	if (user_auth) {
 		auth_socket = getenv("AUTH_SOCKET_PATH");
-		if (auth_socket == NULL)
-			auth_socket = DEFAULT_AUTH_SOCKET_PATH;
+		if (auth_socket == NULL) {
+			const char *base_dir = getenv("BASE_DIR");
+			if (base_dir == NULL)
+				base_dir = PKG_RUNDIR;
+			auth_socket = t_strconcat(base_dir, "/auth-master",
+						  NULL);
+		}
 
 		ret = auth_client_lookup_and_restrict(ioloop, auth_socket,
 						      user, process_euid,