diff -ruNp gnome-keyring-2.30.0/pam/gkr-pam-client.c gnome-keyring-2.30.0.new/pam/gkr-pam-client.c
--- gnome-keyring-2.30.0/pam/gkr-pam-client.c	2009-12-22 14:30:53.000000000 +0100
+++ gnome-keyring-2.30.0.new/pam/gkr-pam-client.c	2010-04-13 08:42:15.000000000 +0200
@@ -145,16 +145,17 @@ write_credentials_byte (int sock)
 static int
 connect_to_daemon (const char *control)
 {
-	char path[MAXPATHLEN];
+	char *path;
 	struct sockaddr_un addr;
 	struct stat st;
 	int sock;
 
-	/* Build up the directory name */
-	if (strlen (control) + strlen ("/control") + 1 >= MAXPATHLEN) {
-		syslog (GKR_LOG_ERR, "The gnome keyring socket directory is too long");
+	path = malloc (strlen (control) + strlen ("/control") + 1);
+	if (!path) {
+		syslog (GKR_LOG_ERR, "gkr-pam: out of memory");
 		return -1;
 	}
+
 	strcpy (path, control);
 	strcat (path, "/control");
 
