/[smecontribs]/rpms/smeserver-usbdisksmanager/contribs9/smeserver-usbdisksmanager-1.2-bz10294-tidy-options.patch
ViewVC logotype

Contents of /rpms/smeserver-usbdisksmanager/contribs9/smeserver-usbdisksmanager-1.2-bz10294-tidy-options.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.2 - (show annotations) (download)
Fri Jan 25 01:16:18 2019 UTC (5 years, 10 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-usbdisksmanager-1_2-7_el6_sme, HEAD
Changes since 1.1: +1 -1 lines
Error occurred while calculating annotation data.
* Sun Jan 13 2019 Jean-Philipe Pialasse <tests@pialasse.com> 1.2-7.sme
- tidy mount options to remove managed and pamconsole options [SME: 10294]

1 diff -Nur smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/00openRW smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/00openRW
2 --- smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/00openRW 1969-12-31 19:00:00.000000000 -0500
3 +++ smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/00openRW 2019-01-13 23:14:26.433000000 -0500
4 @@ -0,0 +1,4 @@
5 +{
6 + $DB = esmith::ConfigDB->open(${DB_FILENAME});
7 +}
8 +
9 diff -Nur smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/10options smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/10options
10 --- smeserver-usbdisksmanager-1.2.old/root/etc/e-smith/db/confusbdisks/migrate/10options 1969-12-31 19:00:00.000000000 -0500
11 +++ smeserver-usbdisksmanager-1.2/root/etc/e-smith/db/confusbdisks/migrate/10options 2019-01-13 23:14:51.014000000 -0500
12 @@ -0,0 +1,27 @@
13 +{
14 + my @add = split(/[,; ]+/, '');
15 + my %remove = map { $_ => 1 } split(/[,; ]+/, 'managed,pamconsole');
16 +# options=pamconsole,exec,noauto,managed,gid=102,uid=101
17 +# options=pamconsole,exec,noauto,managed
18 + for my $repo ( $DB->get_all )
19 + {
20 + #warn $repo->key;
21 + my @options = split(/,/, $repo->prop('options') || '');
22 + push @options, @add;
23 + @options = grep(!defined $remove{$_} , @options);
24 +
25 + # remove duplicates
26 + undef %saw;
27 + @options = grep(!$saw{$_}++, @options);
28 +
29 + if ($#options >= 0)
30 + {
31 + $repo->set_prop('options', join(',', @options));
32 + }
33 + else
34 + {
35 + # $repo->delete('options');
36 + }
37 + }
38 +}
39 +

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed