|
|
|
@ -12,6 +12,8 @@ my $setfacl = "/usr/bin/setfacl"; |
|
|
|
|
my $event = $ARGV [0]; |
|
|
|
|
my $name = $ARGV [1]; |
|
|
|
|
|
|
|
|
|
die "Event name missing\n" unless (defined $event); |
|
|
|
|
|
|
|
|
|
if ($event eq 'user-create'){ |
|
|
|
|
mkpath "/home/e-smith/files/scan/$name"; |
|
|
|
|
system ("$setfacl", |
|
|
|
@ -32,9 +34,13 @@ else { |
|
|
|
|
"/home/e-smith/files/scan/"); |
|
|
|
|
|
|
|
|
|
foreach ($a->users,$a->get('admin')){ |
|
|
|
|
my $name = $_->key; |
|
|
|
|
mkdir "/home/e-smith/files/scan/$name", 0700 |
|
|
|
|
unless (-d "/home/e-smith/files/scan/$name"); |
|
|
|
|
$name = $_->key; |
|
|
|
|
if (-d "/home/e-smith/files/scan/$name"){ |
|
|
|
|
chmod 0700, "/home/e-smith/files/scan/$name"; |
|
|
|
|
} |
|
|
|
|
else { |
|
|
|
|
mkdir "/home/e-smith/files/scan/$name", 0700; |
|
|
|
|
} |
|
|
|
|
system ("$setfacl", |
|
|
|
|
'-m', |
|
|
|
|
"u:scanner:rwX,u:$name:rwX,d:u:$name:rwX", |
|
|
|
|