[gdm] Escape user's name before adding to chooser



commit 7a6173d6032bd13647f55e94c85c293f7d2516ec
Author: Ray Strode <rstrode redhat com>
Date:   Tue Jul 20 14:35:46 2010 -0400

    Escape user's name before adding to chooser
    
    This is like commit 9d026c2b626c1eb9c1b257765d02a8fc925d82f3
    but more targeted to the user chooser.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=619588

 gui/simple-greeter/gdm-user-chooser-widget.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gui/simple-greeter/gdm-user-chooser-widget.c b/gui/simple-greeter/gdm-user-chooser-widget.c
index 48c1285..06799d1 100644
--- a/gui/simple-greeter/gdm-user-chooser-widget.c
+++ b/gui/simple-greeter/gdm-user-chooser-widget.c
@@ -460,6 +460,8 @@ add_user (GdmUserChooserWidget *widget,
         GdkPixbuf    *pixbuf;
         char         *tooltip;
         gboolean      is_logged_in;
+        char         *escaped_username;
+        char         *escaped_real_name;
 
         if (!widget->priv->show_normal_users) {
                 return;
@@ -472,16 +474,20 @@ add_user (GdmUserChooserWidget *widget,
 
         is_logged_in = gdm_user_is_logged_in (user);
 
+        escaped_username = g_markup_escape_text (gdm_user_get_user_name (user), -1);
+        escaped_real_name = g_markup_escape_text (gdm_user_get_real_name (user), -1);
         gdm_chooser_widget_add_item (GDM_CHOOSER_WIDGET (widget),
-                                     gdm_user_get_user_name (user),
+                                     escaped_username,
                                      pixbuf,
-                                     gdm_user_get_real_name (user),
+                                     escaped_real_name,
                                      tooltip,
                                      gdm_user_get_login_frequency (user),
                                      is_logged_in,
                                      FALSE,
                                      (GdmChooserWidgetItemLoadFunc) on_item_load,
                                      widget);
+        g_free (escaped_real_name);
+        g_free (escaped_username);
         g_free (tooltip);
 
         if (pixbuf != NULL) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]