summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Lebl <jirka@5z.com>2003-10-17 17:47:04 +0000
committerGeorge Lebl <jirka@src.gnome.org>2003-10-17 17:47:04 +0000
commit70be6b2519791ced3daae526cf1c4e4b97a5c830 (patch)
tree5ac607c6677824a634f437ff0ed4d3eea77fcf5b
parentf67e41aff62e56e997c0acf4297a3a0a41fe22cc (diff)
downloadgdm-70be6b2519791ced3daae526cf1c4e4b97a5c830.tar.gz
Apply patch from Frederic Crozat <fcrozat@mandrakesoft.com> to make gecos
Fri Oct 17 10:40:08 2003 George Lebl <jirka@5z.com> * gui/gdmlogin.c, gui/greeter/greeter_item_ulist.c: Apply patch from Frederic Crozat <fcrozat@mandrakesoft.com> to make gecos into utf8 before displaying it in the face browser. * daemon/auth.c: make sure that umask 077 before reopening the .Xauthority since apparently it can happen that the file doesn't exist then.
-rw-r--r--ChangeLog10
-rw-r--r--daemon/auth.c6
-rw-r--r--gui/gdmlogin.c5
-rw-r--r--gui/greeter/greeter_item_ulist.c5
4 files changed, 24 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index e477f490..5f22fe3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Fri Oct 17 10:40:08 2003 George Lebl <jirka@5z.com>
+
+ * gui/gdmlogin.c, gui/greeter/greeter_item_ulist.c: Apply patch
+ from Frederic Crozat <fcrozat@mandrakesoft.com> to make gecos
+ into utf8 before displaying it in the face browser.
+
+ * daemon/auth.c: make sure that umask 077 before reopening the
+ .Xauthority since apparently it can happen that the file doesn't
+ exist then.
+
Thu Oct 16 09:55:55 2003 George Lebl <jirka@5z.com>
* Release 2.4.4.4
diff --git a/daemon/auth.c b/daemon/auth.c
index d7800259..8bdfeb35 100644
--- a/daemon/auth.c
+++ b/daemon/auth.c
@@ -725,6 +725,7 @@ gdm_auth_user_remove (GdmDisplay *d, uid_t user)
FILE *af;
gchar *authfile;
gchar *authdir;
+ mode_t oldmode;
if G_UNLIKELY (!d || !d->userauth)
return;
@@ -784,7 +785,9 @@ gdm_auth_user_remove (GdmDisplay *d, uid_t user)
return;
}
+ oldmode = umask (077);
af = gdm_safe_fopen_ap (d->userauth);
+ umask (oldmode);
if G_UNLIKELY (af == NULL) {
XauUnlockAuth (d->userauth);
@@ -858,6 +861,7 @@ gdm_auth_purge (GdmDisplay *d, FILE *af, gboolean remove_when_empty)
{
Xauth *xa;
GSList *keep = NULL, *li;
+ mode_t oldmode;
int cnt;
if G_UNLIKELY (!d || !af)
@@ -904,7 +908,9 @@ gdm_auth_purge (GdmDisplay *d, FILE *af, gboolean remove_when_empty)
return NULL;
}
+ oldmode = umask (077);
af = gdm_safe_fopen_w (d->userauth);
+ umask (oldmode);
/* Write out remaining entries */
for (li = keep; li != NULL; li = li->next) {
diff --git a/gui/gdmlogin.c b/gui/gdmlogin.c
index 2a65f28c..4780d813 100644
--- a/gui/gdmlogin.c
+++ b/gui/gdmlogin.c
@@ -3087,7 +3087,10 @@ gdm_login_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
user->uid = uid;
user->login = g_strdup (logname);
- user->gecos = g_strdup (gecos);
+ if (!g_utf8_validate (gecos, -1, NULL))
+ user->gecos = ve_locale_to_utf8 (gecos);
+ else
+ user->gecos = g_strdup (gecos);
user->homedir = g_strdup (homedir);
if (defface != NULL)
user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));
diff --git a/gui/greeter/greeter_item_ulist.c b/gui/greeter/greeter_item_ulist.c
index c356701f..7c261bee 100644
--- a/gui/greeter/greeter_item_ulist.c
+++ b/gui/greeter/greeter_item_ulist.c
@@ -62,7 +62,10 @@ gdm_greeter_user_alloc (const gchar *logname, uid_t uid, const gchar *homedir,
user->uid = uid;
user->login = g_strdup (logname);
- user->gecos = g_strdup (gecos);
+ if (!g_utf8_validate (gecos, -1, NULL))
+ user->gecos = ve_locale_to_utf8 (gecos);
+ else
+ user->gecos = g_strdup (gecos);
user->homedir = g_strdup (homedir);
if (defface != NULL)
user->picture = (GdkPixbuf *)g_object_ref (G_OBJECT (defface));