changeset 3292:6448d35f8349 HEAD

Try to detect buggy NSS implementations.
author Timo Sirainen <tss@iki.fi>
date Sat, 16 Apr 2005 22:41:37 +0300
parents 611ae3edc1fe
children f8472ced34c0
files src/auth/userdb-passwd.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/auth/userdb-passwd.c	Sat Apr 16 22:31:21 2005 +0300
+++ b/src/auth/userdb-passwd.c	Sat Apr 16 22:41:37 2005 +0300
@@ -23,6 +23,14 @@
 		return;
 	}
 
+	if (strcasecmp(pw->pw_name, auth_request->user) != 0) {
+		/* try to catch broken NSS implementations (nss_ldap) */
+		i_fatal("BROKEN NSS IMPLEMENTATION: "
+			"getpwnam() lookup returned different user than was "
+			"requested (%s != %s).",
+			pw->pw_name, auth_request->user);
+	}
+
 	result = t_strdup_printf("%s\tsystem_user=%s\tuid=%s\tgid=%s\t"
 				 "home=%s", pw->pw_name, pw->pw_name,
 				 dec2str(pw->pw_uid), dec2str(pw->pw_gid),