mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-25 21:46:14 +01:00
Protect against pw->pw_gecos being NULL.
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de> * glib/gutils.c (g_get_any_init): Protect against pw->pw_gecos being NULL.
This commit is contained in:
parent
a1012e5405
commit
6726db0afb
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 22 20:50:55 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Protect against
|
||||||
|
pw->pw_gecos being NULL.
|
||||||
|
|
||||||
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
@ -957,18 +957,21 @@ g_get_any_init (void)
|
|||||||
}
|
}
|
||||||
if (pw)
|
if (pw)
|
||||||
{
|
{
|
||||||
gchar **gecos_fields;
|
|
||||||
gchar **name_parts;
|
|
||||||
|
|
||||||
g_user_name = g_strdup (pw->pw_name);
|
g_user_name = g_strdup (pw->pw_name);
|
||||||
|
|
||||||
/* split the gecos field and substitute '&' */
|
if (pw->pw_gecos)
|
||||||
gecos_fields = g_strsplit (pw->pw_gecos, ",", 0);
|
{
|
||||||
name_parts = g_strsplit (gecos_fields[0], "&", 0);
|
gchar **gecos_fields;
|
||||||
pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]);
|
gchar **name_parts;
|
||||||
g_real_name = g_strjoinv (pw->pw_name, name_parts);
|
|
||||||
g_strfreev (gecos_fields);
|
/* split the gecos field and substitute '&' */
|
||||||
g_strfreev (name_parts);
|
gecos_fields = g_strsplit (pw->pw_gecos, ",", 0);
|
||||||
|
name_parts = g_strsplit (gecos_fields[0], "&", 0);
|
||||||
|
pw->pw_name[0] = g_ascii_toupper (pw->pw_name[0]);
|
||||||
|
g_real_name = g_strjoinv (pw->pw_name, name_parts);
|
||||||
|
g_strfreev (gecos_fields);
|
||||||
|
g_strfreev (name_parts);
|
||||||
|
}
|
||||||
|
|
||||||
if (!g_home_dir)
|
if (!g_home_dir)
|
||||||
g_home_dir = g_strdup (pw->pw_dir);
|
g_home_dir = g_strdup (pw->pw_dir);
|
||||||
|
Loading…
Reference in New Issue
Block a user