1 |
slords |
1.1 |
diff -up e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-create-profiledir.profile_V2 e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-create-profiledir |
2 |
|
|
--- e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-create-profiledir.profile_V2 2006-03-16 00:01:15.000000000 -0700 |
3 |
|
|
+++ e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-create-profiledir 2011-03-04 07:02:51.000000000 -0700 |
4 |
|
|
@@ -37,18 +37,21 @@ foreach my $user ( @newusers ) |
5 |
|
|
die "$user is not a user account\n" |
6 |
|
|
unless ( grep /^$user$/, @users ); |
7 |
|
|
|
8 |
|
|
- my $dir = "/home/e-smith/files/samba/profiles/$user"; |
9 |
|
|
+ my @dirs = ("/home/e-smith/files/samba/profiles/$user","/home/e-smith/files/samba/profiles/${user}.V2"); |
10 |
|
|
|
11 |
|
|
- my $pre_existing = ( -d $dir ); |
12 |
|
|
- |
13 |
|
|
- $pre_existing || mkdir $dir, 700 || die "Couldn't create directory $dir\n"; |
14 |
|
|
+ foreach my $dir (@dirs) |
15 |
|
|
+ { |
16 |
|
|
+ my $pre_existing = ( -d $dir ); |
17 |
|
|
+ |
18 |
|
|
+ $pre_existing || mkdir $dir, 700 || die "Couldn't create directory $dir\n"; |
19 |
|
|
|
20 |
|
|
- chmod 0700, $dir; # Remove setgid bit |
21 |
|
|
- |
22 |
|
|
- next if $pre_existing; |
23 |
|
|
+ chmod 0700, $dir; # Remove setgid bit |
24 |
|
|
+ |
25 |
|
|
+ next if $pre_existing; |
26 |
|
|
|
27 |
|
|
- esmith::util::chownFile($user, $user, $dir) || |
28 |
|
|
- die "Couldn't change ownership of $dir\n"; |
29 |
|
|
+ esmith::util::chownFile($user, $user, $dir) || |
30 |
|
|
+ die "Couldn't change ownership of $dir\n"; |
31 |
|
|
+ } |
32 |
|
|
} |
33 |
|
|
|
34 |
|
|
exit (0); |
35 |
|
|
diff -up e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-delete-profiledir.profile_V2 e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-delete-profiledir |
36 |
|
|
--- e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-delete-profiledir.profile_V2 2005-08-02 15:16:52.000000000 -0600 |
37 |
|
|
+++ e-smith-samba-2.0.0/root/etc/e-smith/events/actions/user-delete-profiledir 2011-03-04 07:02:51.000000000 -0700 |
38 |
|
|
@@ -36,10 +36,13 @@ unless ( defined $a && $a->prop('type') |
39 |
|
|
exit (0); |
40 |
|
|
} |
41 |
|
|
|
42 |
|
|
-my $dir = "/home/e-smith/files/samba/profiles/$account"; |
43 |
|
|
+my @dirs = ("/home/e-smith/files/samba/profiles/$account", "/home/e-smith/files/samba/profiles/$account.V2"); |
44 |
|
|
|
45 |
|
|
-exit 0 unless ( -d $dir ); |
46 |
|
|
+foreach (@dirs) { |
47 |
|
|
+ |
48 |
|
|
+ next unless -d $_; |
49 |
|
|
+ rmtree( $_ ) || die "Couldn't remove tree $_\n"; |
50 |
|
|
|
51 |
|
|
-rmtree( $dir ) || die "Couldn't remove tree $dir\n"; |
52 |
|
|
+} |
53 |
|
|
|
54 |
|
|
exit (0); |