[dovecot-cvs] dovecot/src/auth checkpassword-reply.c,1.4,1.5

tss at dovecot.org tss at dovecot.org
Fri Feb 16 17:28:18 UTC 2007


Update of /var/lib/cvs/dovecot/src/auth
In directory talvi:/tmp/cvs-serv13741

Modified Files:
	checkpassword-reply.c 
Log Message:
If USER environment is set, return it in "user" field and not "userdb_user".
Also don't require that the USER environment exists.



Index: checkpassword-reply.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/auth/checkpassword-reply.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- checkpassword-reply.c	16 Feb 2007 17:13:07 -0000	1.4
+++ checkpassword-reply.c	16 Feb 2007 17:28:16 -0000	1.5
@@ -17,18 +17,14 @@
 	str = t_str_new(1024);
 
 	user = getenv("USER");
-	if (user == NULL)
-		i_fatal("checkpassword: USER environment missing");
-	if (strchr(user, '\t') != NULL) {
-		i_error("checkpassword: USER contains TAB");
-		return 1;
+	if (user != NULL) {
+		if (strchr(user, '\t') != NULL) {
+			i_error("checkpassword: USER contains TAB");
+			return 1;
+		}
+		str_printfa(str, "user=%s\t", user);
 	}
 
-	str_printfa(str, "userdb_user=%s\t"
-		    "userdb_uid=%s\t"
-		    "userdb_gid=%s\t",
-		    user, dec2str(getuid()), dec2str(getgid()));
-
 	home = getenv("HOME");
 	if (home != NULL) {
 		if (strchr(home, '\t') != NULL) {
@@ -38,6 +34,9 @@
 		str_printfa(str, "userdb_home=%s\t", home);
 	}
 
+	str_printfa(str, "userdb_uid=%s\tuserdb_gid=%s\t",
+		    dec2str(getuid()), dec2str(getgid()));
+
 	extra_env = getenv("EXTRA");
 	if (extra_env != NULL) {
 		for (tmp = t_strsplit(extra_env, " "); *tmp != NULL; tmp++) {



More information about the dovecot-cvs mailing list