Mageia Bugzilla – Attachment 3615 Details for
Bug 9195
parental control does not work, (acl is not added is the mounted partition)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
[patch]
Add acl option only for ext2/3 or reiserfs file systems
drakguard.patch (text/plain), 1.83 KB, created by
Derek Jennings
on 2013-03-15 13:49:32 CET
(
hide
)
Description:
Add acl option only for ext2/3 or reiserfs file systems
Filename:
MIME Type:
Creator:
Derek Jennings
Created:
2013-03-15 13:49:32 CET
Size:
1.83 KB
patch
obsolete
>--- /usr/sbin/drakguard 2011-04-04 00:39:21.000000000 +0100 >+++ drakguard 2013-03-15 12:32:40.000000000 +0000 >@@ -296,14 +296,16 @@ > ); > > $w->show; >-if ( (grep {$_ && !/acl/} chomp_(cat_($fstab_file)) && grep {$_ && m/ext/} chomp_(cat_($fstab_file)))) { >+#For ext2, ext3, and reiserfs the acl mount option is required >+#For ext4 and btrfs acl is implicit so does not need to be set. >+if ( (grep {$_ && !/^#|acl/} chomp_(cat_($fstab_file)) && grep {$_ && m/ext[23]|reiserfs/} chomp_(cat_($fstab_file)))) { > $acl_active = 1; > $in->ask_yesorno(N("Warning"), N("The support for Access Control Lists must be enabled in order to use the Block programs feature.\nDo you want to enable it now?", $acl_active = 1)) or $acl_active = 0; > if ($acl_active) { >- my @ext_lines = grep {$_ && m/ext/} chomp_(cat_($fstab_file)); >+ my @ext_lines = grep {$_ && m/^[^#].*ext[23]|reiserfs/} chomp_(cat_($fstab_file)); > foreach my $line (@ext_lines){ >- my ($id, $directory, $flag, $number) = $line=~ /^(.+)\s(.+)\s(ext(\w)\s(\w*))\s(.*)/ or next; >- $line =~ s/ext(\w)\s(\w*)\s/$flag,acl /g; >+ my ($id, $directory, $flag, $number) = $line=~ /^(.+)\s(.+)\s((ext[23]|reiserfs)\s(\w*))\s(.*)/ or next; >+ $line =~ s/(ext[23]|reiserfs)\s(\w*)\s/$flag,acl /g; > subst_config_line($fstab_file,"$line\n"); #adds ,acl in the fstab file in the first run > # remount filesystem with acl parameter > } >@@ -313,7 +315,7 @@ > } > else { > my @mount = `mount`; >- if (grep (/,acl/, @mount)) { >+ if (grep (/(ext[23]|reiserfs).*,acl/, @mount)) { > $acl_active = 1; > } else { > $in->ask_warn(N("Warning"), N("The support for Access Control Lists, required by the Block programs feature, is enabled, but not yet activated.") . N("It is necessary to restart your computer to activate it."), $acl_active = 0);}
--- /usr/sbin/drakguard 2011-04-04 00:39:21.000000000 +0100 +++ drakguard 2013-03-15 12:32:40.000000000 +0000 @@ -296,14 +296,16 @@ ); $w->show; -if ( (grep {$_ && !/acl/} chomp_(cat_($fstab_file)) && grep {$_ && m/ext/} chomp_(cat_($fstab_file)))) { +#For ext2, ext3, and reiserfs the acl mount option is required +#For ext4 and btrfs acl is implicit so does not need to be set. +if ( (grep {$_ && !/^#|acl/} chomp_(cat_($fstab_file)) && grep {$_ && m/ext[23]|reiserfs/} chomp_(cat_($fstab_file)))) { $acl_active = 1; $in->ask_yesorno(N("Warning"), N("The support for Access Control Lists must be enabled in order to use the Block programs feature.\nDo you want to enable it now?", $acl_active = 1)) or $acl_active = 0; if ($acl_active) { - my @ext_lines = grep {$_ && m/ext/} chomp_(cat_($fstab_file)); + my @ext_lines = grep {$_ && m/^[^#].*ext[23]|reiserfs/} chomp_(cat_($fstab_file)); foreach my $line (@ext_lines){ - my ($id, $directory, $flag, $number) = $line=~ /^(.+)\s(.+)\s(ext(\w)\s(\w*))\s(.*)/ or next; - $line =~ s/ext(\w)\s(\w*)\s/$flag,acl /g; + my ($id, $directory, $flag, $number) = $line=~ /^(.+)\s(.+)\s((ext[23]|reiserfs)\s(\w*))\s(.*)/ or next; + $line =~ s/(ext[23]|reiserfs)\s(\w*)\s/$flag,acl /g; subst_config_line($fstab_file,"$line\n"); #adds ,acl in the fstab file in the first run # remount filesystem with acl parameter } @@ -313,7 +315,7 @@ } else { my @mount = `mount`; - if (grep (/,acl/, @mount)) { + if (grep (/(ext[23]|reiserfs).*,acl/, @mount)) { $acl_active = 1; } else { $in->ask_warn(N("Warning"), N("The support for Access Control Lists, required by the Block programs feature, is enabled, but not yet activated.") . N("It is necessary to restart your computer to activate it."), $acl_active = 0);}
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 9195
:
3555
| 3615