summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/drakperm
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-12-22 14:56:58 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-12-22 14:56:58 +0000
commit822dfc7f8fd90d7131f4045c1df5f6ac37260ee9 (patch)
tree6188abbe506fe9fbab164ed510817e1eb494339d /perl-install/standalone/drakperm
parent9be1ade1b32d200dde18c35796d9bd18f72f46c8 (diff)
downloaddrakx-822dfc7f8fd90d7131f4045c1df5f6ac37260ee9.tar
drakx-822dfc7f8fd90d7131f4045c1df5f6ac37260ee9.tar.gz
drakx-822dfc7f8fd90d7131f4045c1df5f6ac37260ee9.tar.bz2
drakx-822dfc7f8fd90d7131f4045c1df5f6ac37260ee9.tar.xz
drakx-822dfc7f8fd90d7131f4045c1df5f6ac37260ee9.zip
- fix drakperm losing added entries on mode switch (eg custom+system filter =>
custom only filter) - make deletion robust (i do not understand how it has "tomber en marche" but indeed it worked)
Diffstat (limited to 'perl-install/standalone/drakperm')
-rwxr-xr-xperl-install/standalone/drakperm26
1 files changed, 16 insertions, 10 deletions
diff --git a/perl-install/standalone/drakperm b/perl-install/standalone/drakperm
index 9abba28b6..f88b3c989 100755
--- a/perl-install/standalone/drakperm
+++ b/perl-install/standalone/drakperm
@@ -48,6 +48,7 @@ each_index {
$permList->append_column($col);
} (N("Path"), N("User"), N("Group"), N("Permissions"));
+my $index = 0;
load_perms();
#- widgets settings
@@ -210,7 +211,6 @@ sub save_perm() {
}
sub load_perms() {
- my $index = 0;
foreach my $file (@perm_files{($default_perm_level, 'editable')}) {
local *F;
open F, $file;
@@ -315,19 +315,25 @@ sub row_setting_dialog {
});
my %perms;
$ok->signal_connect(clicked => sub {
+ my ($path, $user, $group, $perms, $idx);
# create new item if needed (that is when adding a new one) at end of list
- $iter ||= $model->append;
- $model->set($iter, 1 => $file->get_text);
+ $path = $file->get_text;
if ($usr_check->get_active) {
- $model->set($iter, 2 => 'current');
- $model->set($iter, 3 => '');
+ $user = 'current';
+ $group = '';
} else {
- $model->set($iter, 2 => $users->entry->get_text);
- $model->set($iter, 3 => $groups->entry->get_text);
+ $user = $users->entry->get_text;
+ $group = $groups->entry->get_text;
}
- $model->set($iter, 4 => sprintf("%o", eval(join('', "0b",
- (map { $perms{$_}->get_active || 0 } reverse @bits),
- (map { my $owner = $_;map_index { $perms{$owner}{$_}->get_active || 0 } @rights } @owners)))));
+ $perms = sprintf("%o", eval(join('', "0b",
+ (map { $perms{$_}->get_active || 0 } reverse @bits),
+ (map { my $owner = $_;map_index { $perms{$owner}{$_}->get_active || 0 } @rights } @owners))));
+ if (!$iter) {
+ $iter = $model->append;
+ push @rules, { path => $path, user => $user, group => $group, perms => $perms, index => $index };
+ $model->set($iter, 5 => $index++);
+ }
+ $model->set($iter, 1 => $path, 2 => $user, 3 => $group, 4 => $perms);
$dlg->destroy;
$modified++;
});