summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2005-09-12 14:45:22 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2005-09-12 14:45:22 +0000
commit7ca5e7c6868857ea9236c5a5149b288e3c272295 (patch)
tree7e623221a3b2f53eb74601b933dd4cee04c04ecf
parent32aed8e9fe326dab458709fdea654c41ab1dd22a (diff)
downloaddrakx-7ca5e7c6868857ea9236c5a5149b288e3c272295.tar
drakx-7ca5e7c6868857ea9236c5a5149b288e3c272295.tar.gz
drakx-7ca5e7c6868857ea9236c5a5149b288e3c272295.tar.bz2
drakx-7ca5e7c6868857ea9236c5a5149b288e3c272295.tar.xz
drakx-7ca5e7c6868857ea9236c5a5149b288e3c272295.zip
(row_setting_dialog) ensure that both the user and the group are valid
-rwxr-xr-xperl-install/standalone/drakperm12
1 files changed, 10 insertions, 2 deletions
diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm
index 2536ba428..6082d4f97 100755
--- a/perl-install/standalone/drakperm
+++ b/perl-install/standalone/drakperm
@@ -280,11 +280,11 @@ sub row_setting_dialog {
my $alrd_exsts = defined $o_iter;
$file->set_text($model->get($o_iter, 1)) if $o_iter;
- my $users = Gtk2::ComboBox->new_with_strings([ get_user_or_group('users') ]);
+ my $users = Gtk2::ComboBox->new_with_strings([ my @users = get_user_or_group('users') ]);
$users->entry->set_text($model->get($o_iter, 2)) if $o_iter;
$users->set_wrap_width(3);
- my $groups = Gtk2::ComboBox->new_with_strings([ get_user_or_group('groups') ]);
+ my $groups = Gtk2::ComboBox->new_with_strings([ my @groups = get_user_or_group('groups') ]);
$groups->entry->set_text($model->get($o_iter, 3)) if $o_iter;
$groups->set_wrap_width(3);
@@ -386,6 +386,14 @@ sub row_setting_dialog {
} else {
$user = $users->entry->get_text;
$group = $groups->entry->get_text;
+ if (!member($user, @users) || !member($group, @groups)) {
+ warn_dialog(N("Warning"), join("\n", N("Both the username and the group must valid!"),
+ N("User: %s", $user),
+ N("Group: %s", $group),
+ )
+ );
+ return 1;
+ }
}
$perms = sprintf("%03o", eval(join('', "0b",
(map { $perms{$_}->get_active || 0 } reverse @bits),