[gnome-system-tools/gnome-2-28] Set UID and GID range to [0; MAX_UINT32]
- From: Milan Bouchet-Valat <milanbv src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gnome-system-tools/gnome-2-28] Set UID and GID range to [0; MAX_UINT32]
- Date: Mon, 31 Aug 2009 16:19:23 +0000 (UTC)
commit 447d0b75acfa0e9ed0e7d167d478b834edaf61ee
Author: Milan Bouchet-Valat <nalimilan club fr>
Date: Mon Aug 31 17:21:40 2009 +0200
Set UID and GID range to [0;MAX_UINT32]
The valid range can go beyond max_uid (which is set for automated UID choice only). The backends D-Bus protocol use int32 to store it, so we should not go beyond. That's enough for now.
src/users/group-settings.c | 3 +--
src/users/user-settings.c | 8 ++++----
2 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/src/users/group-settings.c b/src/users/group-settings.c
index 02a434b..5d44aad 100644
--- a/src/users/group-settings.c
+++ b/src/users/group-settings.c
@@ -185,8 +185,7 @@ group_settings_dialog_new (OobsGroup *group)
gtk_widget_set_sensitive (widget, (name == NULL));
widget = gst_dialog_get_widget (tool->main_dialog, "group_settings_gid");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0
- GST_USERS_TOOL (tool)->maximum_gid);
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, G_MAXINT32);
group_members_table_set_from_group (group);
diff --git a/src/users/user-settings.c b/src/users/user-settings.c
index 6ce975d..92c1b3f 100644
--- a/src/users/user-settings.c
+++ b/src/users/user-settings.c
@@ -388,6 +388,10 @@ user_settings_dialog_new (OobsUser *user)
dialog = gst_dialog_get_widget (tool->main_dialog, "user_settings_dialog");
notice = gst_dialog_get_widget (tool->main_dialog, "user_settings_uid_disabled");
+ /* Set this before setting the UID so that it's not rejected */
+ widget = gst_dialog_get_widget (tool->main_dialog, "user_settings_uid");
+ gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0, G_MAXINT32);
+
if (!user) {
g_object_set_data (G_OBJECT (dialog), "user", NULL);
gtk_window_set_title (GTK_WINDOW (dialog), _("New user account"));
@@ -501,10 +505,6 @@ user_settings_dialog_new (OobsUser *user)
set_entry_text (widget, oobs_user_get_home_directory (user));
}
- widget = gst_dialog_get_widget (tool->main_dialog, "user_settings_uid");
- gtk_spin_button_set_range (GTK_SPIN_BUTTON (widget), 0
- GST_USERS_TOOL (tool)->maximum_uid);
-
return dialog;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]