changeset 2960:41a4ea8496d6 HEAD

Don't change login dir permissions if using external auth.
author Timo Sirainen <tss@iki.fi>
date Thu, 09 Dec 2004 00:06:41 +0200
parents b9d1e0262568
children 155386b3149d
files src/master/master-settings.c
diffstat 1 files changed, 10 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/master/master-settings.c	Wed Dec 08 19:22:42 2004 +0200
+++ b/src/master/master-settings.c	Thu Dec 09 00:06:41 2004 +0200
@@ -547,21 +547,23 @@
 			  set->base_dir);
 	}
 
-	/* wipe out contents of login directory, if it exists.
-	   except if we're using external authentication - then we would
-	   otherwise wipe existing auth sockets */
 	if (!settings_have_connect_sockets(set)) {
+		/* we are not using external authentication, so make sure the
+		   login directory exists with correct permissions and it's
+		   empty. with external auth we wouldn't want to delete
+		   existing sockets or break the permissions required by the
+		   auth server. */
 		if (unlink_directory(set->login_dir, FALSE) < 0) {
 			i_error("unlink_directory() failed for %s: %m",
 				set->login_dir);
 			return FALSE;
 		}
-	}
 
-	if (safe_mkdir(set->login_dir, 0750,
-		       master_uid, set->server->login_gid) == 0) {
-		i_warning("Corrected permissions for login directory %s",
-			  set->login_dir);
+		if (safe_mkdir(set->login_dir, 0750,
+			       master_uid, set->server->login_gid) == 0) {
+			i_warning("Corrected permissions for login directory "
+				  "%s", set->login_dir);
+		}
 	}
 
 	if (set->max_mail_processes < 1) {