/[smecontribs]/rpms/smeserver-shared-folders/contribs8/smeserver-shared-folders-0.1-dump_acl_and_xattr_for_manual_perm.patch
ViewVC logotype

Annotation of /rpms/smeserver-shared-folders/contribs8/smeserver-shared-folders-0.1-dump_acl_and_xattr_for_manual_perm.patch

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


Revision 1.1 - (hide annotations) (download)
Mon Nov 25 11:52:28 2013 UTC (10 years, 5 months ago) by vip-ire
Branch: MAIN
CVS Tags: smeserver-shared-folders-0_1-84_el5_sme, smeserver-shared-folders-0_1-87_el5_sme, smeserver-shared-folders-0_1-85_el5_sme, smeserver-shared-folders-0_1-86_el5_sme, HEAD
* Mon Nov 25 2013 Daniel Berteaud <daniel@firewall-services.com> 0.1-84.sme
- Dump ACL and extended attributes in /home/e-smith/db/shares if
  ManualPermissions is set

1 vip-ire 1.1 diff -Nur smeserver-shared-folders-0.1/createlinks smeserver-shared-folders-0.1_dump_ext_attr/createlinks
2     --- smeserver-shared-folders-0.1/createlinks 2013-11-25 11:20:09.118697321 +0100
3     +++ smeserver-shared-folders-0.1_dump_ext_attr/createlinks 2013-11-25 11:39:50.764795331 +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.1/root/etc/e-smith/events/actions/share-dump-attributes smeserver-shared-folders-0.1_dump_ext_attr/root/etc/e-smith/events/actions/share-dump-attributes
14     --- smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-dump-attributes 1970-01-01 01:00:00.000000000 +0100
15     +++ smeserver-shared-folders-0.1_dump_ext_attr/root/etc/e-smith/events/actions/share-dump-attributes 2013-11-25 11:38:44.064788868 +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