/[smeserver]/rpms/e-smith-ibays/sme10/e-smith-ibays-2.6.0-create_tmp_folder_in_ibays.patch
ViewVC logotype

Annotation of /rpms/e-smith-ibays/sme10/e-smith-ibays-2.6.0-create_tmp_folder_in_ibays.patch

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


Revision 1.4 - (hide annotations) (download)
Thu Jul 7 02:42:09 2016 UTC (7 years, 10 months ago) by unnilennium
Branch: MAIN
CVS Tags: e-smith-ibays-2_6_0-11_el7_sme, e-smith-ibays-2_6_0-12_el7_sme, e-smith-ibays-2_6_0-17_el7_sme, e-smith-ibays-2_6_0-10_el7_sme, e-smith-ibays-2_6_0-15_el7_sme, e-smith-ibays-2_6_0-16_el7_sme, e-smith-ibays-2_6_0-20_el7_sme, e-smith-ibays-2_6_0-18_el7_sme, e-smith-ibays-2_6_0-13_el7_sme, e-smith-ibays-2_6_0-9_el7_sme, e-smith-ibays-2_6_0-7_el7_sme, e-smith-ibays-2_6_0-19_el7_sme, e-smith-ibays-2_6_0-14_el7_sme, e-smith-ibays-2_6_0-8_el7_sme, HEAD
Changes since 1.3: +0 -5 lines
* Wed Jul 06 2016 Jean-Philipe Pialasse <tests@pialasse.com> 2.6.0-7.sme
- fix typo thanks to Stephane de Labrusse [SME: 7011]
- ibay to ibays

1 unnilennium 1.1 diff -Nur e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/ibay-modify e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/ibay-modify
2     --- e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/ibay-modify 2013-01-31 22:31:37.000000000 +0100
3     +++ e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/ibay-modify 2015-01-03 22:24:18.806618131 +0100
4     @@ -158,6 +158,10 @@
5     #--------------------------------------------------
6     # main directory is writeable only by root
7     #--------------------------------------------------
8     +##create the upload_tmp_folder in the ibay if PHPTmpDir is set to 'enabled'
9     +my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled';
10 unnilennium 1.2 +$tmpdir = ('/var/cache/e-smith/files/ibays/' . $ibay->key . '/tmp') if $tmpdir eq 'enabled';
11 unnilennium 1.1 +mkdir $tmpdir unless (-d $tmpdir || $tmpdir eq "disabled");
12    
13     chdir "/home/e-smith/files/ibays/$ibayName"
14     or ( $x = 255, warn "Could not chdir to /home/e-smith/files/ibays/$ibayName" );
15     @@ -227,6 +231,13 @@
16     $experm |= $::fileperm;
17     chmod $experm, $_;
18     }
19 unnilennium 1.3 + ##chmod 0600 ; chown www:www if upload_tmp_folder exists
20 unnilennium 1.2 + my $tmpdirperm = (('/var/cache/e-smith/files/ibays/' . $ibay->key . '/tmp')||'');
21 unnilennium 1.1 + if ( -d $tmpdirperm)
22     + {
23     + system ('/bin/chown', '-R', 'www:www' , $tmpdirperm);
24 unnilennium 1.3 + system ('/bin/chmod', '0600' , $tmpdirperm );
25 unnilennium 1.1 + }
26     }
27     }
28    
29     diff -Nur e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/init-ibays e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/init-ibays
30     --- e-smith-ibays-2.4.0/root/etc/e-smith/events/actions/init-ibays 2015-01-04 15:42:23.594891869 +0100
31     +++ e-smith-ibays-2.4.0.bz7011/root/etc/e-smith/events/actions/init-ibays 2015-01-04 15:43:54.275788309 +0100
32     @@ -25,6 +25,7 @@
33     use strict;
34     use Errno;
35     use esmith::util;
36     +use esmith::AccountsDB;
37    
38     # Populate pre-defined Primary i-bay
39     # Start with top level owner/permissions
40     @@ -59,5 +60,27 @@
41     "/home/e-smith/files/ibays/Primary/html/index.htm");
42     }
43    
44     +#we want to create the folder tmp if enabled in all Ibays(enabled by default)
45     +#introduced by the bug [SME: 7011]
46     +my $accounts = esmith::AccountsDB->open_ro or warn "Could not open account database: $!";
47     +my @ibays = $accounts->ibays;
48     +my $uid = '102'; #or www
49     +my $gid = '102'; #or www
50     +
51     +foreach my $ibay (@ibays)
52     +{
53     + #Then we retrieve the name of the ebay
54     + my $key = $ibay->key;
55     + my $tmpdb = $ibay->prop('PHPTmpDir') || 'enabled';
56 unnilennium 1.2 + my $path = (('/var/cache/e-smith/files/ibays/') . $key . '/tmp');
57 unnilennium 1.1 +
58     + #we test the condition if /tmp exists or if it is disabled in the Ibay
59     + unless (-d $path || $tmpdb eq "disabled")
60     + {
61 unnilennium 1.3 + mkdir $path, 0600 or warn "Could not create dir $path: $!";
62 unnilennium 1.1 + chown $uid, $gid, $path or warn "Could not chown dir $path: $!";
63     + }
64     +}
65     +
66     exit (0);
67    

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