/[smecontribs]/rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace-0.1-actions.patch
ViewVC logotype

Diff of /rpms/smeserver-user-webspace/contribs8/smeserver-user-webspace-0.1-actions.patch

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

Revision 1.2 by unnilennium, Sat Nov 23 23:20:29 2013 UTC Revision 1.3 by unnilennium, Sun Nov 24 08:54:06 2013 UTC
# Line 136  diff -Nur smeserver-user-webspace-0.1-ol Line 136  diff -Nur smeserver-user-webspace-0.1-ol
136  +{  +{
137  +    die "$user is not a user account\n"  +    die "$user is not a user account\n"
138  +        unless ( grep /^$user$/, @users );  +        unless ( grep /^$user$/, @users );
139  +  +    next if $user eq "admin";
140  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");
141  +    +  
142  +    foreach my $dir (@dirs)  +    foreach my $dir (@dirs)
143  +    {  +    {
144  +        my $pre_existing = ( -d $dir );  +        my $pre_existing = ( -d $dir );
145  +      +    
146  +        $pre_existing || mkdir $dir, 710 || die "Couldn't create directory $dir\n";  +        $pre_existing || mkdir $dir, 750 || die "Couldn't create directory $dir\n";
147  +  +
148  +        chmod 0710, $dir;      # Remove setgid bit  +        chmod 0750, $dir;      # Remove setgid bit
149  +          +        
150  +        next if $pre_existing;  +        next if $pre_existing;
151  +       chmod 0710, "/home/e-smith/files/users/$user";  +       system("chmod", "0750", "/home/e-smith/files/users/$user");
152  +       chmod 2770, "/home/e-smith/files/users/$user/home/public_html";  +       system("chmod", "2770", "/home/e-smith/files/users/$user/home/public_html");
153  +       chmod 2770, "/home/e-smith/files/users/$user/tmp";  +       system("chmod", "2770", "/home/e-smith/files/users/$user/tmp");
154  +       system("/bin/chown", "$user:www", "-R" , "/home/e-smith/files/users/$user/home/public_html");  +       system("/bin/chown", "$user:www", "-R" , "/home/e-smith/files/users/$user/home/public_html");
155  +       system("/bin/chown", "$user:www", "/home/e-smith/files/users/$user");  +       system("/bin/chown", "$user:www", "/home/e-smith/files/users/$user");
156  +       system("/bin/chown", "$user:www", "-R" , "/home/e-smith/files/users/$user/tmp");  +       system("/bin/chown", "$user:www", "-R" , "/home/e-smith/files/users/$user/tmp");
# Line 215  diff -Nur smeserver-user-webspace-0.1-ol Line 215  diff -Nur smeserver-user-webspace-0.1-ol
215  +  +
216  +die "username argument missing" unless defined ($userName);  +die "username argument missing" unless defined ($userName);
217  +  +
218  +  +return if $userName eq "admin";
219  +chmod 0710, "/home/e-smith/files/users/$userName";  +system("chmod", "0750", "/home/e-smith/files/users/$userName");
220  +chmod 2770, "/home/e-smith/files/users/$userName/home/public_html";  +system("chmod", "2770", "/home/e-smith/files/users/$userName/home/public_html");
221  +chmod 2770, "/home/e-smith/files/users/$userName/tmp";  +system("chmod", "2770", "/home/e-smith/files/users/$userName/tmp");
222  +system("/bin/chown", "$userName:www", "-R",  "/home/e-smith/files/users/$userName/home/public_html");  +system("/bin/chown", "$userName:www", "-R",  "/home/e-smith/files/users/$userName/home/public_html");
223  +system("/bin/chown", "$userName:www", "/home/e-smith/files/users/$userName");  +system("/bin/chown", "$userName:www", "/home/e-smith/files/users/$userName");
224  +system("/bin/chown", "$userName:www", "-R", "/home/e-smith/files/users/$userName/tmp");  +system("/bin/chown", "$userName:www", "-R", "/home/e-smith/files/users/$userName/tmp");
# Line 259  diff -Nur smeserver-user-webspace-0.1-ol Line 259  diff -Nur smeserver-user-webspace-0.1-ol
259  +  +
260  +my @users = ('admin', map { $_->key } $adb->users);  +my @users = ('admin', map { $_->key } $adb->users);
261  +  +
262  +my @newusers = @user;  +my @newusers = @users;
263  +#($event eq "post-upgrade") ? @users : $ARGV[1] ;  +#($event eq "post-upgrade") ? @users : $ARGV[1] ;
264  +  +
265  +foreach my $user ( @newusers )  +foreach my $user ( @newusers )
# Line 268  diff -Nur smeserver-user-webspace-0.1-ol Line 268  diff -Nur smeserver-user-webspace-0.1-ol
268  +        unless ( grep /^$user$/, @users );  +        unless ( grep /^$user$/, @users );
269  +  +
270  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");
271  +    +   next if $user eq "admin";
272  +    foreach my $dir (@dirs)  +    foreach my $dir (@dirs)
273  +    {  +    {
274  +        my $pre_existing = ( -d $dir );  +        my $pre_existing = ( -d $dir );
275  +      +    
276  +        $pre_existing || mkdir $dir, 710 || die "Couldn't create directory $dir\n";  +        $pre_existing || mkdir $dir, 750 || die "Couldn't create directory $dir\n";
277  +  +
278  +        chmod 0710, $dir;      # Remove setgid bit  +        chmod 0750, $dir;      # Remove setgid bit
279  +          +        
280  +        #next if $pre_existing;  +        #next if $pre_existing;
281  +        system("mkdir -p /home/e-smith/files/users/$user/home/public_html");  +        system("mkdir -p /home/e-smith/files/users/$user/home/public_html");
282  +       system("mkdir -p /home/e-smith/files/users/$user/tmp");  +       system("mkdir -p /home/e-smith/files/users/$user/tmp");
283  +       chmod 0710, "/home/e-smith/files/users/$user";  +       system("chmod", "0750", "/home/e-smith/files/users/$user");
284  +       chmod 2770, "/home/e-smith/files/users/$user/home/public_html";  +       system("chmod", "2770", "/home/e-smith/files/users/$user/home/public_html");
285  +       chmod 2770, "/home/e-smith/files/users/$user/tmp";  +       system("chmod", "2770", "/home/e-smith/files/users/$user/tmp");
286  +       system("/bin/chown", "$user:www", "-R",  "/home/e-smith/files/users/$user/home/public_html");  +       system("/bin/chown", "$user:www", "-R",  "/home/e-smith/files/users/$user/home/public_html");
287  +       system("/bin/chown", "$user:www", "/home/e-smith/files/users/$user");  +       system("/bin/chown", "$user:www", "/home/e-smith/files/users/$user");
288  +       system("/bin/chown", "$user:www", "-R", "/home/e-smith/files/users/$user/tmp");  +       system("/bin/chown", "$user:www", "-R", "/home/e-smith/files/users/$user/tmp");
# Line 329  diff -Nur smeserver-user-webspace-0.1-ol Line 329  diff -Nur smeserver-user-webspace-0.1-ol
329  +  +
330  +my @users = ('admin', map { $_->key } $adb->users);  +my @users = ('admin', map { $_->key } $adb->users);
331  +  +
332  +my @newusers = @user;  +my @newusers = @users;
333  +#($event eq "post-upgrade") ? @users : $ARGV[1] ;  +#($event eq "post-upgrade") ? @users : $ARGV[1] ;
334  +  +
335  +foreach my $user ( @newusers )  +foreach my $user ( @newusers )
# Line 338  diff -Nur smeserver-user-webspace-0.1-ol Line 338  diff -Nur smeserver-user-webspace-0.1-ol
338  +        unless ( grep /^$user$/, @users );  +        unless ( grep /^$user$/, @users );
339  +  +
340  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");  +    my @dirs = ("/home/e-smith/files/samba/profiles/$user");
341  +    +   next if $user eq "admin";
342  +    foreach my $dir (@dirs)  +    foreach my $dir (@dirs)
343  +    {  +    {
344  +        my $pre_existing = ( -d $dir );  +        my $pre_existing = ( -d $dir );
# Line 349  diff -Nur smeserver-user-webspace-0.1-ol Line 349  diff -Nur smeserver-user-webspace-0.1-ol
349  +        +      
350  +        #next if $pre_existing;  +        #next if $pre_existing;
351  +       system("/bin/chown", "$user:$user", "-R",  "/home/e-smith/files/users/$user");  +       system("/bin/chown", "$user:$user", "-R",  "/home/e-smith/files/users/$user");
352  +  +       system("/bin/chmod", "0700",  "/home/e-smith/files/users/$user");
353  +        esmith::util::chownFile($user, $user, $dir) ||  +        esmith::util::chownFile($user, $user, $dir) ||
354  +            die "Couldn't change ownership of $dir\n";  +            die "Couldn't change ownership of $dir\n";
355  +    }  +    }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

admin@koozali.org
ViewVC Help
Powered by ViewVC 1.2.1 RSS 2.0 feed