diff -Nur smeserver-shared-folders-0.1/createlinks smeserver-shared-folders-0.1_dump_ext_attr/createlinks --- smeserver-shared-folders-0.1/createlinks 2013-11-25 11:20:09.118697321 +0100 +++ smeserver-shared-folders-0.1_dump_ext_attr/createlinks 2013-11-25 11:39:50.764795331 +0100 @@ -30,6 +30,8 @@ event_link("share-modify", $event, "15"); } +event_link("share-dump-attributes", "pre-backup", "80"); + foreach my $event (qw(share-create share-modify share-delete share-modify-servers)){ templates2events("/etc/samba/smb.conf", $event); templates2events("/etc/httpd/conf/httpd.conf", $event); 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 --- smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-dump-attributes 1970-01-01 01:00:00.000000000 +0100 +++ 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 @@ -0,0 +1,16 @@ +#!/usr/bin/perl + +use strict; +use esmith::AccountsDB; + +my $a = esmith::AccountsDB->open_ro || + die "Couldn't open AccountsDB\n"; + +foreach my $share ( $a->get_all_by_prop( type => 'share' ) ){ + my $key = $share->key; + my $perm = $share->prop('ManualPermissions') || 'disabled'; + next unless ( $perm eq 'yes' || $perm eq 'enabled' || $perm eq 'ntacl' ); + # Dump posix ACL + system("/usr/bin/getfacl -R --physical --absolute-names -- /home/e-smith/files/shares/$key/ > /home/e-smith/db/shares/$key.acl"); + 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"); +}