diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/createlinks mezzanine_patched_smeserver-shared-folders-0.1/createlinks --- smeserver-shared-folders-0.1/createlinks 2012-02-23 22:45:01.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/createlinks 2012-02-23 21:51:35.000000000 +0100 @@ -26,17 +26,17 @@ event_link("share-delete", $event, "15"); -foreach my $event (qw(share-create share-modify share-modify-files)) -{ +foreach my $event (qw(share-create share-modify share-modify-files)){ event_link("share-modify", $event, "15"); } -foreach my $event (qw(share-create share-modify share-delete share-modify-servers)) -{ +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); + templates2events("/etc/rsyncd.conf", $event); safe_symlink("sighup", "root/etc/e-smith/events/$event/services2adjust/smbd"); safe_symlink("sigusr1", "root/etc/e-smith/events/$event/services2adjust/httpd-e-smith"); + safe_symlink("restart", "root/etc/e-smith/events/$event/services2adjust/rsyncd"); } #-------------------------------------------------- @@ -52,3 +52,13 @@ safe_touch("root/etc/e-smith/templates/etc/smb.conf/shares/template-begin"); +safe_touch("root/var/service/rsyncd/down"); +service_link_enhanced("rsyncd", "S95", "7"); +service_link_enhanced("rsyncd", "K05", "6"); +service_link_enhanced("rsyncd", "K05", "0"); +safe_symlink("../daemontools" , 'root/etc/rc.d/init.d/supervise/rsyncd'); +safe_symlink("/var/service/rsyncd" , 'root/service/rsyncd'); + +templates2events("/etc/rsyncd.conf", "bootstrap-console-save"); +templates2events("/etc/rsyncd.conf", "remoteaccess-update"); + diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/access mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/access --- smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/access 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/access 2012-02-23 21:47:56.000000000 +0100 @@ -0,0 +1 @@ +private diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/status mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/status --- smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/status 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/status 2012-02-23 21:47:56.000000000 +0100 @@ -0,0 +1 @@ +enabled diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/TCPPort mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/TCPPort --- smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/TCPPort 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/TCPPort 2012-02-23 21:47:56.000000000 +0100 @@ -0,0 +1 @@ +873 diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/type mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/type --- smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/type 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/db/configuration/defaults/rsyncd/type 2012-02-23 21:47:56.000000000 +0100 @@ -0,0 +1 @@ +service diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify --- smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify 2012-02-23 22:45:01.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/events/actions/share-modify 2012-02-23 22:22:31.000000000 +0100 @@ -94,6 +94,7 @@ my @readgroups = split(/[;,]/,($properties {'ReadGroups'} || 'admin')); my @writeusers = split(/[;,]/,($properties {'WriteUsers'} || '')); my @readusers = split(/[;,]/,($properties {'ReadUsers'} || '')); +my $rsync = $properties{'rsyncAccess'} || 'none'; # Don't reset permissions if ManualPermissions is set to 'yes' @@ -125,6 +126,7 @@ foreach my $user (@readusers){ $acl .= 'u:'.$user.':rX,'; } + $acl .= 'u:rsync:rX,' if ($rsync =~ /^local|global$/); # Set the effective ACLs system($setfacl, @@ -158,6 +160,7 @@ foreach my $user (@writeusers,@readusers){ $acl .= 'u:'.$user.':rX,'; } + $acl .= 'u:rsync:rX,' if ($rsync =~ /^local|global$/); system($setfacl, '-m', diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/10global mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/10global --- smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/10global 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/10global 2012-02-23 21:47:56.000000000 +0100 @@ -0,0 +1 @@ +port = {$rsyncd{'TCPPort'} || '873'} diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/20shares mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/20shares --- smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/20shares 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/etc/e-smith/templates/etc/rsyncd.conf/20shares 2012-02-23 22:36:50.000000000 +0100 @@ -0,0 +1,39 @@ +{ + +use esmith::AccountsDB; +my $a = esmith::AccountsDB->open_ro(); +my $n = esmith::NetworksDB->open_ro(); + +my $local = ''; +foreach my $net ($n->networks){ + my $addr = $net->key; + my $mask = $net->prop('Mask'); + $local .= "$addr/$mask " +} +foreach (split /[;,]/, (${'httpd-admin'}{'ValidFrom'} || '')){ + $local .= "$_ "; +} + +foreach my $share ($a->get_all_by_prop(type=>'share')){ + my $name = $share->key; + my $access = $share->prop('rsyncAccess') || 'none'; + next unless ($access =~ /^global|local$/); + my $desc = $share->prop('Name') || $name; + $OUT .=<<"EOF"; + +[$name] +comment = $desc +path = /home/e-smith/files/shares/$name/files +uid = rsync +gid = rsync +use chroot = true +log file = /dev/stdout +EOF + $OUT .= "auth users = *\nsecrets file = /home/e-smith/files/shares/$name/rsyncd.secrets\n" + if ( -e "/home/e-smith/files/shares/$name/rsyncd.secrets" ); + if ($access eq 'local'){ + my $hosts = $local; + $OUT .= "hosts allow = $local"; + } +} +} diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/var/service/rsyncd/log/run mezzanine_patched_smeserver-shared-folders-0.1/root/var/service/rsyncd/log/run --- smeserver-shared-folders-0.1/root/var/service/rsyncd/log/run 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/var/service/rsyncd/log/run 2012-02-23 22:33:42.000000000 +0100 @@ -0,0 +1,6 @@ +#!/bin/sh + +exec \ + /usr/local/bin/setuidgid smelog \ + /usr/local/bin/multilog t s5000000 \ + /var/log/rsyncd diff -Nur -x '*.orig' -x '*.rej' smeserver-shared-folders-0.1/root/var/service/rsyncd/run mezzanine_patched_smeserver-shared-folders-0.1/root/var/service/rsyncd/run --- smeserver-shared-folders-0.1/root/var/service/rsyncd/run 1970-01-01 01:00:00.000000000 +0100 +++ mezzanine_patched_smeserver-shared-folders-0.1/root/var/service/rsyncd/run 2012-02-22 21:57:36.000000000 +0100 @@ -0,0 +1,5 @@ +#!/bin/sh + +exec 2>&1 + +exec /usr/bin/rsync --daemon --no-detach