Browse Source

Don't try to create or delete scan dir if no user has been passed

tags/ipasserelle-base-0.2.69-1
Daniel Berteaud 4 months ago
parent
commit
a3bfaa2126
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      root/etc/e-smith/events/actions/share-modify-scan

+ 2
- 2
root/etc/e-smith/events/actions/share-modify-scan View File

@@ -14,7 +14,7 @@ my $name = $ARGV [1];
14 14
 
15 15
 die "Event name missing\n" unless (defined $event);
16 16
 
17
-if ($event eq 'user-create'){
17
+if ($event eq 'user-create' and defined $name){
18 18
     mkpath "/home/e-smith/files/scan/$name";
19 19
     system ("$setfacl",
20 20
             '-m',
@@ -22,7 +22,7 @@ if ($event eq 'user-create'){
22 22
             '--',
23 23
             "/home/e-smith/files/scan/$name");
24 24
 }
25
-elsif ($event eq 'user-delete'){
25
+elsif ($event eq 'user-delete' and defined $name){
26 26
     rmtree "/home/e-smith/files/scan/$name";
27 27
 }
28 28
 else {

Loading…
Cancel
Save