Grant group write perm
This commit is contained in:
parent
7752f23771
commit
5e98fd3ad9
|
@ -56,22 +56,22 @@ sub set_acl {
|
||||||
my $user = shift;
|
my $user = shift;
|
||||||
die "Missing username\n" unless ($user);
|
die "Missing username\n" unless ($user);
|
||||||
die "Couldn't find $user"."'s home dir\n" unless (-e "/home/e-smith/files/users/$user");
|
die "Couldn't find $user"."'s home dir\n" unless (-e "/home/e-smith/files/users/$user");
|
||||||
|
find(\&dirperm, "/home/e-smith/files/users/$user/Maildir");
|
||||||
die "Error applying permissions to $user 's Maildir\n" unless (
|
die "Error applying permissions to $user 's Maildir\n" unless (
|
||||||
# sharedmailbox group needs read / write access on Maildir
|
# sharedmailbox group needs read / write access on Maildir
|
||||||
system('/usr/bin/setfacl',
|
system('/usr/bin/setfacl',
|
||||||
'-R',
|
'-R',
|
||||||
'-m',
|
'-m',
|
||||||
'g:sharedmailbox:rwX,d:g:sharedmailbox:rwX',
|
'u::rwX,g::rwX,g:sharedmailbox:rwX,d,u::rwX,d:g::rwX,d:g:sharedmailbox:rwX',
|
||||||
"/home/e-smith/files/users/$user/Maildir") == 0 &&
|
"/home/e-smith/files/users/$user/Maildir") == 0 &&
|
||||||
# Grant sharedmailbox group permission to go through
|
# Grant sharedmailbox group permission to go through
|
||||||
# the home dir so it can access the Maildir, but let it read
|
# the home dir so it can access the Maildir, but don't let it read
|
||||||
# anything else
|
# anything (except the Maildir)
|
||||||
system('/usr/bin/setfacl',
|
system('/usr/bin/setfacl',
|
||||||
'-m',
|
'-m',
|
||||||
'g:sharedmailbox:x',
|
'g:sharedmailbox:x',
|
||||||
"/home/e-smith/files/users/$user") == 0
|
"/home/e-smith/files/users/$user") == 0
|
||||||
);
|
);
|
||||||
find(\&sgid, "/home/e-smith/files/users/$user/Maildir");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# The kernel will handle group perms when a user
|
# The kernel will handle group perms when a user
|
||||||
|
@ -79,7 +79,7 @@ sub set_acl {
|
||||||
# This will prevent dovecot errors, see
|
# This will prevent dovecot errors, see
|
||||||
# http://wiki2.dovecot.org/SharedMailboxes/Permissions and
|
# http://wiki2.dovecot.org/SharedMailboxes/Permissions and
|
||||||
# http://wiki2.dovecot.org/Errors/ChgrpNoPerm
|
# http://wiki2.dovecot.org/Errors/ChgrpNoPerm
|
||||||
sub sgid {
|
sub dirperm {
|
||||||
system('/bin/chmod',
|
system('/bin/chmod',
|
||||||
'g+s',
|
'g+s',
|
||||||
"$_") if (-d);
|
"$_") if (-d);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%define version 0.1
|
%define version 0.1
|
||||||
%define release 0.beta26
|
%define release 0.beta28
|
||||||
%define name smeserver-dovecot
|
%define name smeserver-dovecot
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue