Index: greeter_item_pam.c
===================================================================
RCS file: /cvs/gnome/gdm2/gui/greeter/greeter_item_pam.c,v
retrieving revision 1.39
diff -u -r1.39 greeter_item_pam.c
--- greeter_item_pam.c	9 Jun 2006 21:07:42 -0000	1.39
+++ greeter_item_pam.c	17 Oct 2006 22:52:05 -0000
@@ -190,17 +190,25 @@
 gboolean
 greeter_item_pam_setup (void)
 {
-  GreeterItemInfo *entry_info;
+  GreeterItemInfo *entry_info        = greeter_lookup_id ("user-pw-entry");
+  GreeterItemInfo *conversation_info = greeter_lookup_id ("pam-prompt");
 
   greeter_item_pam_error_set (FALSE);
 
-  entry_info = greeter_lookup_id ("user-pw-entry");
   if (entry_info && entry_info->item &&
       GNOME_IS_CANVAS_WIDGET (entry_info->item) &&
       GTK_IS_ENTRY (GNOME_CANVAS_WIDGET (entry_info->item)->widget))
     {
-      GtkWidget *entry;
-      entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
+      GtkWidget *entry = GNOME_CANVAS_WIDGET (entry_info->item)->widget;
+      GtkWidget *label = GNOME_CANVAS_WIDGET (conversation_info->item)->widget;
+      AtkObject *entryAcc, *labelAcc;
+
+      /* Set up a11y relations */
+      entryAcc = gtk_widget_get_accessible (entry);
+      labelAcc = gtk_widget_get_accessible (label);
+      atk_object_add_relationship (labelAcc, ATK_RELATION_LABEL_FOR, entryAcc);
+      atk_object_add_relationship (entryAcc, ATK_RELATION_LABELLED_BY, labelAcc);
+
       gtk_widget_grab_focus (entry);
 
       if ( ! DOING_GDM_DEVELOPMENT)
@@ -230,12 +238,10 @@
 			 int         entry_len,
 			 gboolean    entry_visible)
 {
-  GreeterItemInfo *conversation_info;
-  GreeterItemInfo *entry_info;
+  GreeterItemInfo *entry_info        = greeter_lookup_id ("user-pw-entry");
+  GreeterItemInfo *conversation_info = greeter_lookup_id ("pam-prompt");
   GtkWidget *entry;
 
-  conversation_info = greeter_lookup_id ("pam-prompt");
-  entry_info = greeter_lookup_id ("user-pw-entry");
 
   if (conversation_info)
     {
