diff --git a/capplets/about-me/ChangeLog b/capplets/about-me/ChangeLog index 74222e0f7..93cd901e0 100644 --- a/capplets/about-me/ChangeLog +++ b/capplets/about-me/ChangeLog @@ -1,3 +1,10 @@ +2007-04-30 Bastien Nocera + + * gnome-about-me.c: (about_me_update_photo): Use g_file_set_contents + instead of a single fwrite to write the ~/.face image, also set the + default permission to be 0644, even if the umask is more permissive, + otherwise GDM won't show the icon in the chooser (Closes: #433898) + 2007-04-27 Rodrigo Moya * gnome-about-me.desktop.in.in: renamed Bugzilla product. diff --git a/capplets/about-me/gnome-about-me.c b/capplets/about-me/gnome-about-me.c index d8b2a082a..a9e8016dc 100644 --- a/capplets/about-me/gnome-about-me.c +++ b/capplets/about-me/gnome-about-me.c @@ -23,6 +23,7 @@ # include #endif +#include #include #include #include @@ -452,7 +453,7 @@ about_me_update_photo (GnomeAboutMe *me) GladeXML *dialog; EContactPhoto *photo; gchar *file; - FILE *fp; + GError *error; guchar *data; gsize length; @@ -515,12 +516,19 @@ about_me_update_photo (GnomeAboutMe *me) /* Save the image for GDM */ /* FIXME: I would have to read the default used by the gdmgreeter program */ - file = g_strdup_printf ("%s/.face", g_get_home_dir ()); - fp = fopen (file, "wb"); - fwrite (photo->data.inlined.data, 1, photo->data.inlined.length, fp); - fclose (fp); + error = NULL; + file = g_build_filename (g_get_home_dir (), ".face", NULL); + if (g_file_set_contents (file, + photo->data.inlined.data, + photo->data.inlined.length, + &error) != FALSE) { + g_chmod (file, 0644); + } else { + g_warning ("Could not create %s: %s", file, error->message); + g_error_free (error); + } - g_free (file); + g_free (file); e_contact_photo_free (photo);