mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-03 20:29:21 +02:00
Don't treat the Win32 user name like a gecos field, and when extracting a
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de> * glib/gutils.c (g_get_any_init): Don't treat the Win32 user name like a gecos field, and when extracting a real name from a gecos field, replace '&' by the capitalized user name (a traditional passwd feature). (#118973, reported by Soeren Boll Overgaard)
This commit is contained in:
committed by
Matthias Clasen
parent
e2d5240179
commit
1107a9f41a
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -1,3 +1,11 @@
|
|||||||
|
Thu Jan 22 00:41:34 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
|
* glib/gutils.c (g_get_any_init): Don't treat the Win32
|
||||||
|
user name like a gecos field, and when extracting a real
|
||||||
|
name from a gecos field, replace '&' by the capitalized
|
||||||
|
user name (a traditional passwd feature).
|
||||||
|
(#118973, reported by Soeren Boll Overgaard)
|
||||||
|
|
||||||
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
Tue Jan 20 22:31:22 2004 Matthias Clasen <maclas@gmx.de>
|
||||||
|
|
||||||
* NEWS: Start of 2.3.2 section.
|
* NEWS: Start of 2.3.2 section.
|
||||||
|
@@ -957,8 +957,19 @@ g_get_any_init (void)
|
|||||||
}
|
}
|
||||||
if (pw)
|
if (pw)
|
||||||
{
|
{
|
||||||
g_user_name = g_strdup (pw->pw_name);
|
gchar **gecos_fields;
|
||||||
g_real_name = g_strdup (pw->pw_gecos);
|
gchar **name_parts;
|
||||||
|
|
||||||
|
g_user_name = g_strdup (pw->pw_name);
|
||||||
|
|
||||||
|
/* split the gecos field and substitute '&' */
|
||||||
|
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);
|
||||||
}
|
}
|
||||||
@@ -993,20 +1004,6 @@ g_get_any_init (void)
|
|||||||
g_user_name = g_strdup ("somebody");
|
g_user_name = g_strdup ("somebody");
|
||||||
if (!g_real_name)
|
if (!g_real_name)
|
||||||
g_real_name = g_strdup ("Unknown");
|
g_real_name = g_strdup ("Unknown");
|
||||||
else
|
|
||||||
{
|
|
||||||
gchar *p;
|
|
||||||
|
|
||||||
for (p = g_real_name; *p; p++)
|
|
||||||
if (*p == ',')
|
|
||||||
{
|
|
||||||
*p = 0;
|
|
||||||
p = g_strdup (g_real_name);
|
|
||||||
g_free (g_real_name);
|
|
||||||
g_real_name = p;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user