- don't expect utf-8 usernames for face browser (bug 235351).

This commit is contained in:
Ray Strode 2007-04-05 15:53:24 +00:00
parent 678bde4b54
commit 2b7de6018b
2 changed files with 51 additions and 1 deletions

View File

@ -0,0 +1,44 @@
--- gdm-2.18.0/gui/greeter/greeter_item_ulist.c.dont-expect-utf8 2007-04-05 11:19:40.000000000 -0400
+++ gdm-2.18.0/gui/greeter/greeter_item_ulist.c 2007-04-05 11:39:06.000000000 -0400
@@ -168,6 +168,29 @@
&size_of_users, GDM_IS_LOCAL, !DOING_GDM_DEVELOPMENT);
}
+static gchar *
+greeter_string_to_escaped_utf8 (const gchar *raw_string)
+{
+ gchar *utf8_string, *escaped_string, *p;
+ const gchar *q;
+
+ utf8_string = g_strdup (raw_string);
+ p = utf8_string;
+ while ((*p != '\0') &&
+ !g_utf8_validate (p, -1, &q)) {
+ p = (gchar *) q;
+ *p = '?';
+ p++;
+ }
+
+ g_assert (g_utf8_validate (utf8_string, -1, NULL));
+
+ escaped_string = g_markup_escape_text (utf8_string, -1);
+ g_free (utf8_string);
+
+ return escaped_string;
+}
+
static void
greeter_populate_user_list (GtkTreeModel *tm)
{
@@ -181,9 +204,9 @@
gboolean active;
if (usr->gecos && strcmp (usr->gecos, "") != 0) {
- name = g_markup_escape_text (usr->gecos, -1);
+ name = greeter_string_to_escaped_utf8 (usr->gecos);
} else {
- name = g_markup_escape_text (usr->login, -1);
+ name = greeter_string_to_escaped_utf8 (usr->login);
}
if (g_hash_table_lookup (displays_hash, usr->login))

View File

@ -16,7 +16,7 @@
Summary: The GNOME Display Manager Summary: The GNOME Display Manager
Name: gdm Name: gdm
Version: 2.18.0 Version: 2.18.0
Release: 7%{?dist} Release: 8%{?dist}
Epoch: 1 Epoch: 1
License: LGPL/GPL License: LGPL/GPL
Group: User Interface/X Group: User Interface/X
@ -70,6 +70,8 @@ Patch34: gdm-2.18.0-add-lowres-fix.patch
# http://bugzilla.gnome.org/show_bug.cgi?id=424229 # http://bugzilla.gnome.org/show_bug.cgi?id=424229
Patch35: gdm-2.18.0-dont-strcpy-overlapping-strings.patch Patch35: gdm-2.18.0-dont-strcpy-overlapping-strings.patch
Patch36: gdm-2.18.0-dont-expect-utf8.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Prereq: /usr/sbin/useradd Prereq: /usr/sbin/useradd
@ -156,6 +158,7 @@ Extra icons / faces for the GNOME Display Manager.
%patch33 -p0 -b .pass-ats-to-session %patch33 -p0 -b .pass-ats-to-session
%patch34 -p1 -b .add-lowres-fix %patch34 -p1 -b .add-lowres-fix
%patch35 -p1 -b .dont-strcpy-overlapping-strings %patch35 -p1 -b .dont-strcpy-overlapping-strings
%patch36 -p1 -b .dont-expect-utf8
%build %build
cp -f %{SOURCE1} config/gdm cp -f %{SOURCE1} config/gdm
@ -376,6 +379,9 @@ fi
%{_datadir}/pixmaps/faces/extras/*.jpg %{_datadir}/pixmaps/faces/extras/*.jpg
%changelog %changelog
* Thu Apr 5 2007 Ray Strode <rstrode@redhat.com> - 1:2.18.0-8
- don't expect utf-8 usernames for face browser (bug 235351).
* Thu Mar 29 2007 Ray Strode <rstrode@redhat.com> - 1:2.18.0-7 * Thu Mar 29 2007 Ray Strode <rstrode@redhat.com> - 1:2.18.0-7
- don't strcpy overlapping strings (bug 208181). - don't strcpy overlapping strings (bug 208181).