--- auth-request.c.orig	2007-12-09 19:14:26.000000000 +0100
+++ auth-request.c	2007-12-13 11:23:06.000000000 +0100
@@ -1151,26 +1151,28 @@
 	uid_t uid;
 	gid_t gid;
 
-	if (strcmp(name, "uid") == 0) {
-		uid = userdb_parse_uid(request, value);
-		if (uid == (uid_t)-1) {
-			request->userdb_lookup_failed = TRUE;
+	if (name != NULL) {
+		if (strcmp(name, "uid") == 0) {
+			uid = userdb_parse_uid(request, value);
+			if (uid == (uid_t)-1) {
+				request->userdb_lookup_failed = TRUE;
+				return;
+			}
+			value = dec2str(uid);
+		} else if (strcmp(name, "gid") == 0) {
+			gid = userdb_parse_gid(request, value);
+			if (gid == (gid_t)-1) {
+				request->userdb_lookup_failed = TRUE;
+				return;
+			}
+			value = dec2str(gid);
+		} else if (strcmp(name, "user") == 0) {
+			auth_request_change_userdb_user(request, value);
 			return;
-		}
-		value = dec2str(uid);
-	} else if (strcmp(name, "gid") == 0) {
-		gid = userdb_parse_gid(request, value);
-		if (gid == (gid_t)-1) {
-			request->userdb_lookup_failed = TRUE;
+		} else if (strcmp(name, "uidgid_file") == 0) {
+			auth_request_set_uidgid_file(request, value);
 			return;
 		}
-		value = dec2str(gid);
-	} else if (strcmp(name, "user") == 0) {
-		auth_request_change_userdb_user(request, value);
-		return;
-	} else if (strcmp(name, "uidgid_file") == 0) {
-		auth_request_set_uidgid_file(request, value);
-		return;
 	}
 
 	auth_stream_reply_add(request->userdb_reply, name, value);
