From 247f7506fcfb7d0b8e6f27fea3a28e5cabfba066 Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Mon, 2 Dec 2013 16:29:22 +0100 Subject: [PATCH] Correctly set permission on the 'home' repo if enabled --- root/etc/e-smith/events/actions/pydio-user-rights | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/root/etc/e-smith/events/actions/pydio-user-rights b/root/etc/e-smith/events/actions/pydio-user-rights index 3613d72..9ce364d 100644 --- a/root/etc/e-smith/events/actions/pydio-user-rights +++ b/root/etc/e-smith/events/actions/pydio-user-rights @@ -37,6 +37,9 @@ unlink(); # Remove plugin cache unlink(); +my $pydio = $c->get('pydio') || die "Couldn't find pydio entry in ConfigDB\n"; +my $homedir = $pydio->prop('HomeDir') || 'none'; + foreach my $user (($a->users),$a->get('admin')){ my $name = $user->key; my $first = $user->prop('FirstName') || ''; @@ -86,6 +89,10 @@ foreach my $user (($a->users),$a->get('admin')){ # Special case: admin has access to everything $data->{"\0*\0acls"}->{$sharename} = 'rw' if ($name eq 'admin'); } + # Set ACL for the private homedir if enabled + if ($homedir eq 'enabled' || ($homedir eq 'users' && (($user->prop('PydioHomeDir') || 'disabled') eq 'enabled'))){ + $data->{"\0*\0acls"}->{'home'} = 'r'; + } # As we're here, lets update the email address and the display name # First, delete parameter if it's an array (meaning it's empty) delete $data->{"\0*\0parameters"} if (ref ($data->{"\0*\0parameters"})=~ m/ARRAY/i); @@ -101,9 +108,6 @@ foreach my $user (($a->users),$a->get('admin')){ chown '0', '102', "/var/lib/pydio/plugins/auth.serial/$name/role.ser"; } -my $pydio = $c->get('pydio') || die "Couldn't find pydio entry in ConfigDB\n"; -my $homedir = $pydio->prop('HomeDir') || 'none'; - if ($homedir eq 'enabled'){ foreach ($a->users){ my $name = $_->key;