[dovecot-cvs] dovecot/src/master mail-process.c,1.70,1.71

cras at dovecot.org cras at dovecot.org
Sat Feb 12 15:47:25 EET 2005


Update of /var/lib/cvs/dovecot/src/master
In directory talvi:/tmp/cvs-serv2986/master

Modified Files:
	mail-process.c 
Log Message:
userdb can now return extra parameters to master. Removed special handling
of home/mail wherever possible, they're just regular extra parameters now.
LDAP passdb and static userdb can return extra parameters now.



Index: mail-process.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/master/mail-process.c,v
retrieving revision 1.70
retrieving revision 1.71
diff -u -d -r1.70 -r1.71
--- mail-process.c	13 Jan 2005 20:33:41 -0000	1.70
+++ mail-process.c	12 Feb 2005 13:47:23 -0000	1.71
@@ -298,7 +298,7 @@
 {
 	struct settings *set = group->set;
 	const struct var_expand_table *var_expand_table;
-	const char *addr, *mail, *chroot_dir, *home_dir, *full_home_dir;
+	const char *p, *addr, *mail, *chroot_dir, *home_dir, *full_home_dir;
 	const char *system_user;
 	char title[1024];
 	struct log_io *log;
@@ -325,12 +325,23 @@
 			chroot_dir = *args + 7;
 		else if (strncmp(*args, "system_user=", 12) == 0)
 			system_user = *args + 12;
-		else if (strncmp(*args, "uid=", 4) == 0)
+		else if (strncmp(*args, "uid=", 4) == 0) {
+			if (uid != 0) {
+				i_error("uid specified multiple times for %s",
+					user);
+				return FALSE;
+			}
 			uid = (uid_t)strtoul(*args + 4, NULL, 10);
-		else if (strncmp(*args, "gid=", 4) == 0)
+		} else if (strncmp(*args, "gid=", 4) == 0)
 			gid = (gid_t)strtoul(*args + 4, NULL, 10);
 	}
 
+	if (*chroot_dir == '\0' && (p = strstr(home_dir, "/./")) != NULL) {
+		/* wu-ftpd like <chroot>/./<home> */
+		chroot_dir = t_strdup_until(home_dir, p);
+		home_dir = p + 3;
+	}
+
 	if (!validate_uid_gid(set, uid, gid, user))
 		return FALSE;
 



More information about the dovecot-cvs mailing list