diff -Nru gnome-system-tools-2.22.2/debian/changelog gnome-system-tools-2.22.2/debian/changelog --- gnome-system-tools-2.22.2/debian/changelog 2009-04-16 09:10:36.000000000 +0100 +++ gnome-system-tools-2.22.2/debian/changelog 2009-04-16 09:10:38.000000000 +0100 @@ -1,3 +1,13 @@ +gnome-system-tools (2.22.2-0ubuntu4) jaunty; urgency=low + + * Created: 86_disable_existing_group_for_new_username.patch - disables the + ability to create a new user whose name is owned by a perviously defined + group, which, if allowed to happen, would overwrite the old group. If this + happened to 'admin', for example, would render any system adminstration by + sudoers impossible (LP: #236305). + + -- Jonathan Davies Wed, 15 Apr 2009 17:56:27 +0100 + gnome-system-tools (2.22.2-0ubuntu3) jaunty; urgency=low * debian/patches/93_polkit_dbus_timeout.patch: diff -Nru gnome-system-tools-2.22.2/debian/patches/86_disable_existing_group_for_new_username.patch gnome-system-tools-2.22.2/debian/patches/86_disable_existing_group_for_new_username.patch --- gnome-system-tools-2.22.2/debian/patches/86_disable_existing_group_for_new_username.patch 1970-01-01 01:00:00.000000000 +0100 +++ gnome-system-tools-2.22.2/debian/patches/86_disable_existing_group_for_new_username.patch 2009-04-16 09:10:38.000000000 +0100 @@ -0,0 +1,47 @@ +--- ./src/users/user-settings.c 2009-04-15 23:54:30.105057142 +0100 ++++ ./src/users/user-settings.c 2009-04-15 23:53:22.752867854 +0100 +@@ -395,6 +395,35 @@ user_settings_dialog_new (OobsUser *user + return dialog; + } + ++/* FIXME: This function is duplicated in group-settings.c. */ ++static gboolean ++group_exists (const gchar *name) ++{ ++ OobsGroupsConfig *config; ++ OobsList *groups_list; ++ OobsListIter iter; ++ GObject *group; ++ gboolean valid; ++ const gchar *group_name; ++ ++ config = OOBS_GROUPS_CONFIG (GST_USERS_TOOL (tool)->groups_config); ++ groups_list = oobs_groups_config_get_groups (config); ++ valid = oobs_list_get_iter_first (groups_list, &iter); ++ ++ while (valid) { ++ group = oobs_list_get (groups_list, &iter); ++ group_name = oobs_group_get_name (OOBS_GROUP (group)); ++ g_object_unref (group); ++ ++ if (group_name && strcmp (name, group_name) == 0) ++ return TRUE; ++ ++ valid = oobs_list_iter_next (groups_list, &iter); ++ } ++ ++ return FALSE; ++} ++ + static gboolean + is_user_root (OobsUser *user) + { +@@ -479,7 +508,7 @@ check_login (gchar **primary_text, gchar + *secondary_text = g_strdup (_("Please set a valid user name consisting of " + "a lower case letter followed by lower case " + "letters and numbers.")); +- } else if (!user && login_exists (login)) { ++ } else if (!user && (login_exists (login) || group_exists (login))) { + *primary_text = g_strdup_printf (_("User name \"%s\" already exists"), login); + *secondary_text = g_strdup (_("Please select a different user name.")); + } diff -Nru gnome-system-tools-2.22.2/debian/patches/series gnome-system-tools-2.22.2/debian/patches/series --- gnome-system-tools-2.22.2/debian/patches/series 2009-04-16 09:10:36.000000000 +0100 +++ gnome-system-tools-2.22.2/debian/patches/series 2009-04-16 09:10:38.000000000 +0100 @@ -17,3 +17,4 @@ 92_postgresql_versions.patch 93_polkit_dbus_timeout.patch 98_automake.patch +86_disable_existing_group_for_new_username.patch