/[smeserver]/rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz11411-uniformizePhpProperties.patch
ViewVC logotype

Annotation of /rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz11411-uniformizePhpProperties.patch

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


Revision 1.1 - (hide annotations) (download)
Mon Mar 8 08:44:07 2021 UTC (3 years, 8 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-php-3_0_0-45_el7_sme, smeserver-php-3_0_0-48_el7_sme, smeserver-php-3_0_0-37_el7_sme, smeserver-php-3_0_0-38_el7_sme, smeserver-php-3_0_0-40_el7_sme, smeserver-php-3_0_0-43_el7_sme, smeserver-php-3_0_0-46_el7_sme, smeserver-php-3_0_0-41_el7_sme, smeserver-php-3_0_0-44_el7_sme, smeserver-php-3_0_0-47_el7_sme, smeserver-php-3_0_0-30_el7_sme, smeserver-php-3_0_0-29_el7_sme, smeserver-php-3_0_0-39_el7_sme, smeserver-php-3_0_0-42_el7_sme, smeserver-php-3_0_0-35_el7_sme, smeserver-php-3_0_0-36_el7_sme, smeserver-php-3_0_0-33_el7_sme, smeserver-php-3_0_0-34_el7_sme, smeserver-php-3_0_0-31_el7_sme, smeserver-php-3_0_0-32_el7_sme, HEAD
* Mon Mar 08 2021 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.0-29.sme
-  uniformize php related properties between ibays and php [SME: 11411]
   tidy fragments for php-fpm and ibays

1 jpp 1.1 diff -Nur --no-dereference smeserver-php-3.0.0.old/root/etc/e-smith/db/accounts/migrate/20ibay-php smeserver-php-3.0.0/root/etc/e-smith/db/accounts/migrate/20ibay-php
2     --- smeserver-php-3.0.0.old/root/etc/e-smith/db/accounts/migrate/20ibay-php 1969-12-31 19:00:00.000000000 -0500
3     +++ smeserver-php-3.0.0/root/etc/e-smith/db/accounts/migrate/20ibay-php 2021-03-08 03:35:18.218000000 -0500
4     @@ -0,0 +1,28 @@
5     +{
6     + my %old2new = (
7     + UpMaxFileSize => "UploadMaxFilesize",
8     + PHPUploadMaxFilesize => "UploadMaxFilesize",
9     + PHPPostMaxSize => "PostMaxSize",
10     + PHPMaxExecutionTime => "MaxExecutionTime",
11     + PHPMemoryLimit => "MemoryLimit",
12     + PHPAllowUrlFopen => "AllowUrlFopen",
13     + PHPFileUpload => "FileUpload",
14     + PHPDisabledFunctions => "DisabledFunctions",
15     + PHPAutoPrependFile => "AutoPrependFile",
16     + PHPCustomPool => "CustomPool",
17     + PHPMaxInputTime => "MaxInputTime",
18     + );
19     +
20     + foreach my $ibay ($DB->get_all_by_prop(type => 'ibay'))
21     + {
22     + for my $key (keys %old2new)
23     + {
24     + next unless (defined $ibay->prop($key));
25     + my $value = $DB->get_prop_and_delete($ibay->key, $key);
26     + next if (defined $ibay->prop($old2new{$key}) );
27     + $DB->set_prop($ibay->key, $old2new{$key}, $value);
28     + }
29     +
30     + }
31     +}
32     +
33     diff -Nur --no-dereference smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays smeserver-php-3.0.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays
34     --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2021-03-08 02:59:22.560000000 -0500
35     +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2021-03-08 03:25:56.753000000 -0500
36     @@ -6,6 +6,7 @@
37     my $adb = esmith::AccountsDB->open_ro();
38     foreach my $ibay ($adb->ibays)
39     {
40     + my %properties = $ibay->props;
41     my $key = $ibay->key;
42     local $dynamicContent = $ibay->prop('CgiBin') || 'disabled';
43     if ($dynamicContent eq 'enabled')
44     @@ -37,16 +38,26 @@
45     # the following block is only in case phpmodule is enabled.
46     if (exists $php{status} and $php{status} eq "enabled" and $phpModule eq "enabled")
47     {
48     + my $allowurlfopen = $properties{'AllowUrlfOpen'} || 'disabled';
49     + my $memoryLimit = $properties{'MemoryLimit'} || 'disabled';
50     + my $upmaxfileSize = $properties{'UploadMaxFilesize'} || 'disabled';
51     + my $postmaxSize = $properties{'PostMaxSize'} || 'disabled';
52     + my $maxexecutionTime = $properties{'MaxExecTime'} || 'disabled';
53     + $maxexecutionTime = '0' if $maxexecutionTime eq 'unlimited';
54     + $OUT .= " php_admin_flag allow_url_fopen on\n" if ($allowurlfopen eq 'enabled');
55     + $OUT .= " php_admin_value memory_limit $memoryLimit\n" if ($memoryLimit ne 'disabled');
56     + $OUT .= " php_admin_value upload_max_filesize $upmaxfileSize\n" if ($upmaxfileSize ne 'disabled');
57     + $OUT .= " php_admin_value post_max_size $postmaxSize\n" if ($postmaxSize ne 'disabled');
58     + $OUT .= " php_admin_value max_execution_time $maxexecutionTime\n" if ($maxexecutionTime ne 'disabled');
59     +
60     # Set upload_tmp_dir and sys_temp_dir where php can upload files or write tmp files
61     - my $tmpdir = $ibay->prop('PHPTmpDir') || 'enabled';
62     - $tmpdir = ("/var/cache/e-smith/files/ibays/$key/tmp") if $tmpdir eq 'enabled';
63     - $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n" unless ($tmpdir eq 'disabled' || ! -d $tmpdir);
64     - $OUT .= " php_admin_value sys_temp_dir $tmpdir\n" unless ($tmpdir eq 'disabled' || ! -d $tmpdir);
65     + $tmpdir= "/var/lib/php/$key/tmp";
66     + $OUT .= " php_admin_value upload_tmp_dir $tmpdir\n";
67     + $OUT .= " php_admin_value sys_temp_dir $tmpdir\n";
68    
69     # Set the session folder where php can store its session instead of in global dir
70     - my $sessdir = $ibay->prop('PHPSessionDir') || 'enabled';
71     - $sessdir = ("/var/cache/e-smith/files/ibays/$key/session") if $sessdir eq 'enabled';
72     - $OUT .= " php_admin_value session.save_path $sessdir\n" unless ($sessdir eq 'disabled' || ! -d $sessdir);
73     + $sessdir = "/var/lib/php/$key/session";
74     + $OUT .= " php_admin_value session.save_path $sessdir\n";
75    
76     # Set the sandbox within which PHP is confined to play
77     my $basedir = $ibay->prop('PHPBaseDir')
78     diff -Nur --no-dereference smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays
79     --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays 2021-03-08 02:59:22.556000000 -0500
80     +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays 2021-03-08 03:35:34.225000000 -0500
81     @@ -7,25 +7,25 @@
82     foreach my $ibay ($a->get_all_by_prop(type => 'ibay')){
83     my $version = PhpFpmVersionToUse($ibay);
84     my $dynamic = $ibay->prop('CgiBin') || 'disabled';
85     - my $custom = $ibay->prop('PHPCustomPool') || undef;
86     + my $custom = $ibay->prop('CustomPool') || undef;
87     next unless ($dynamic eq 'enabled' && $version eq $PHP_VERSION && !$custom);
88     my $key = $ibay->key;
89     my $name = lc $key;
90     my $pool_name = 'php' . $version . '-' . $name;
91     - my $memory_limit = $ibay->prop('PHPMemoryLimit') || '128M';
92     - my $max_execution_time = $ibay->prop('PHPMaxExecutionTime') || '30';
93     - my $max_input_time = $ibay->prop('PHPMaxInputTime') || '60';
94     - my $allow_url_fopen = $ibay->prop('PHPAllowUrlFopen') || 'disabled';
95     - my $post_max_size = $ibay->prop('PHPPostMaxSize') || '10M';
96     - my $upload_max_filesize = $ibay->prop('PHPUploadMaxFilesize') || '10M';
97     - my $file_upload = $ibay->prop('PHPFileUpload') || 'enabled';
98     + my $memory_limit = $ibay->prop('MemoryLimit') || '128M';
99     + my $max_execution_time = $ibay->prop('MaxExecutionTime') || '30';
100     + my $max_input_time = $ibay->prop('MaxInputTime') || '60';
101     + my $allow_url_fopen = $ibay->prop('AllowUrlFopen') || 'disabled';
102     + my $post_max_size = $ibay->prop('PostMaxSize') || '20M';
103     + my $upload_max_filesize = $ibay->prop('UploadMaxFilesize') || '10M';
104     + my $file_upload = $ibay->prop('FileUpload') || 'enabled';
105     my $open_basedir = $ibay->prop('PHPBaseDir') || '/home/e-smith/files/ibays/' . $key .
106     ':/var/lib/php/' . $key;
107     - my $disabled_functions = $ibay->prop('PHPDisabledFunctions') || 'system,show_source,' .
108     + my $disabled_functions = (defined $ibay->prop('DisabledFunctions')) ? $ibay->prop('DisabledFunctions') : 'system,show_source,' .
109     'symlink,exec,dl,shell_exec,' .
110     'passthru,phpinfo,' .
111     'escapeshellarg,escapeshellcmd';
112     - my $autoprepend = $ibay->prop('PHPAutoPrependFile') || 'enabled';
113     + my $autoprepend = $ibay->prop('AutoPrependFile') || 'enabled';
114     my $MailForceSender = $ibay->prop('MailForceSender') || "$name\@$DomainName"; # TODO => check ibay associated domains.
115     my $limitExtensions = ( ($ibay->prop('AllowPHTML') || 'disabled') eq 'enabled' ) ? "security.limit_extensions= .php .htm .html .phar .phtml .xml " : "";
116    

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