/[smecontribs]/rpms/smeserver-shared-folders/contribs9/smeserver-shared-folders-0.3-dump_acl_and_xattr_for_manual_perm.patch
ViewVC logotype

Contents of /rpms/smeserver-shared-folders/contribs9/smeserver-shared-folders-0.3-dump_acl_and_xattr_for_manual_perm.patch

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


Revision 1.1 - (show annotations) (download)
Mon Nov 25 11:51:51 2013 UTC (10 years, 5 months ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-shared-folders-0_3-4_el6_sme, smeserver-shared-folders-0_3-7_el6_sme, smeserver-shared-folders-0_3-9_el6_sme, smeserver-shared-folders-0_3-11_el6_sme, smeserver-shared-folders-0_3-8_el6_sme, smeserver-shared-folders-0_3-6_el6_sme, smeserver-shared-folders-0_3-5_el6_sme, smeserver-shared-folders-0_3-10_el6_sme, smeserver-shared-folders-0_3-3_el6_sme, HEAD
* Mon Nov 25 2013 Daniel Berteaud <daniel@firewall-services.com> 0.3-3.sme
- Dump ACL and extended attributes in /home/e-smith/db/shares if
  ManualPermissions is set

1 diff -Nur smeserver-shared-folders-0.3/createlinks smeserver-shared-folders-0.3_dump_xattr/createlinks
2 --- smeserver-shared-folders-0.3/createlinks 2013-11-25 12:48:18.303255031 +0100
3 +++ smeserver-shared-folders-0.3_dump_xattr/createlinks 2013-11-25 12:48:50.685233828 +0100
4 @@ -30,6 +30,8 @@
5 event_link("share-modify", $event, "15");
6 }
7
8 +event_link("share-dump-attributes", "pre-backup", "80");
9 +
10 foreach my $event (qw(share-create share-modify share-delete share-modify-servers)){
11 templates2events("/etc/samba/smb.conf", $event);
12 templates2events("/etc/httpd/conf/httpd.conf", $event);
13 diff -Nur smeserver-shared-folders-0.3/root/etc/e-smith/events/actions/share-dump-attributes smeserver-shared-folders-0.3_dump_xattr/root/etc/e-smith/events/actions/share-dump-attributes
14 --- smeserver-shared-folders-0.3/root/etc/e-smith/events/actions/share-dump-attributes 1970-01-01 01:00:00.000000000 +0100
15 +++ smeserver-shared-folders-0.3_dump_xattr/root/etc/e-smith/events/actions/share-dump-attributes 2013-11-25 12:48:50.685233828 +0100
16 @@ -0,0 +1,16 @@
17 +#!/usr/bin/perl
18 +
19 +use strict;
20 +use esmith::AccountsDB;
21 +
22 +my $a = esmith::AccountsDB->open_ro ||
23 + die "Couldn't open AccountsDB\n";
24 +
25 +foreach my $share ( $a->get_all_by_prop( type => 'share' ) ){
26 + my $key = $share->key;
27 + my $perm = $share->prop('ManualPermissions') || 'disabled';
28 + next unless ( $perm eq 'yes' || $perm eq 'enabled' || $perm eq 'ntacl' );
29 + # Dump posix ACL
30 + system("/usr/bin/getfacl -R --physical --absolute-names -- /home/e-smith/files/shares/$key/ > /home/e-smith/db/shares/$key.acl");
31 + system("/usr/bin/getfattr -R -d -m '.*' -e hex -P --absolute-names -- /home/e-smith/files/shares/$key/ > /home/e-smith/db/shares/$key.xattr");
32 +}

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