/[smeserver]/rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz10904-pass-auth-token-to-fpm.patch
ViewVC logotype

Contents of /rpms/smeserver-php/sme10/smeserver-php-3.0.0-bz10904-pass-auth-token-to-fpm.patch

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


Revision 1.2 - (show annotations) (download)
Thu Mar 26 04:08:34 2020 UTC (4 years, 7 months ago) by jpp
Branch: MAIN
CVS Tags: smeserver-php-3_0_0-11_el7_sme, smeserver-php-3_0_0-10_el7_sme, smeserver-php-3_0_0-9_el7_sme
Changes since 1.1: +77 -16 lines
* Thu Mar 26 2020 Jean-Philipe Pialasse <tests@pialasse.com> 3.0.0-9.sme
- move auto_prepend_file from php.ini to php-fpm.d [SME: 10904]
  add /usr/share/php in open_basedir if dfined to allow execution of auto_prepend_file

1 diff -Nur 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
2 --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2020-03-24 22:47:45.360000000 -0400
3 +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/httpd/conf/httpd.conf/95AddType00PHP2ibays 2020-03-24 22:52:37.899000000 -0400
4 @@ -18,6 +18,7 @@
5 ($version) = $version =~ /([0-9]{2})/ unless $version eq '';
6 my $name = lc $key;
7 $OUT .=<<"_EOF";
8 + SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=\$1
9 <FilesMatch \.php\$>
10 SetHandler "proxy:unix:/var/run/php-fpm/php$version-$name.sock|fcgi://localhost"
11 </FilesMatch>
12 diff -Nur smeserver-php-3.0.0.old/root/usr/share/php/auth_translation.php smeserver-php-3.0.0/root/usr/share/php/auth_translation.php
13 --- smeserver-php-3.0.0.old/root/usr/share/php/auth_translation.php 1969-12-31 19:00:00.000000000 -0500
14 +++ smeserver-php-3.0.0/root/usr/share/php/auth_translation.php 2020-03-24 22:56:30.995000000 -0400
15 @@ -0,0 +1,13 @@
16 +<?php
17 +if (isset($_SERVER['REDIRECT_HTTP_AUTHORIZATION'])) {
18 + $hash = str_replace('Basic ', '', $_SERVER['REDIRECT_HTTP_AUTHORIZATION']);
19 + $hash = base64_decode($hash);
20 + $_SERVER['HTTP_AUTHORIZATION']=$_SERVER['REDIRECT_HTTP_AUTHORIZATION'];
21 + if (strpos($hash, ':') !== false) {
22 + list( $_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', $hash, 2);
23 + }
24 +}
25 +if (isset($_SERVER['REDIRECT_REMOTE_USER'])) {
26 + $_SERVER['REMOTE_USER']= $_SERVER['REDIRECT_REMOTE_USER'];
27 +}
28 +?>
29 diff -Nur smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All
30 --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All 2020-03-25 23:28:48.448000000 -0400
31 +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/custom.conf/10All 2020-03-25 23:51:42.755000000 -0400
32 @@ -28,14 +28,17 @@
33 my $max_children = $pool->prop('MaxChildren') || '15';
34 my $display_errors = $pool->prop('DisplayErrors') || 'disabled';
35 my $log_errors = $pool->prop('LogErrors') || 'disabled';
36 + my $autoprepend = $pool->prop('AutoPrependFile') || 'enabled';
37
38 # Format vars
39 + my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/pear/auth_translation.php";
40 + my $autoprepath = ( $autoprepend eq "disabled") ? "" : ",/usr/share/php/";
41 $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
42 $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
43 $display_errors = ($display_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
44 $log_errors = ($log_errors =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
45 $disabled_functions = join(', ', split /[,;:]/, $disabled_functions);
46 - $open_basedir = (defined $open_basedir) ? 'php_admin_value[open_basedir] = ' . join(':', split(/[,;:]/, $open_basedir)) :
47 + $open_basedir = (defined $open_basedir) ? 'php_admin_value[open_basedir] = ' . join(':', split(/[,;:]/, $open_basedir . $autoprepath)) :
48 '; open_basedir is not set';
49
50 $OUT .=<<"_EOF";
51 @@ -72,6 +75,7 @@
52 php_admin_flag[file_upload] = $file_upload
53 php_admin_flag[session.cookie_httponly] = on
54 php_admin_flag[allow_url_include] = off
55 +php_admin_value[auto_prepend_file] = $autoprep
56 php_admin_value[session.save_handler] = files
57 $open_basedir
58
59 diff -Nur 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
60 --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays 2020-03-25 23:28:48.448000000 -0400
61 +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/ibays.conf/10Ibays 2020-03-26 00:03:17.799000000 -0400
62 @@ -26,11 +26,15 @@
63 'symlink,exec,dl,shell_exec,' .
64 'passthru,phpinfo,' .
65 'escapeshellarg,escapeshellcmd';
66 - # Format vars
67 + my $autoprepend = $ibay->prop('PHPAutoPrependFile') || 'enabled';
68 +
69 + # Format vars
70 + my $autoprep = ( $autoprepend eq "disabled") ? "" : "/usr/share/pear/auth_translation.php";
71 + my $autoprepath = ( $autoprepend eq "disabled") ? "" : ",/usr/share/php/";
72 $file_upload = ($file_upload =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
73 $allow_url_fopen = ($allow_url_fopen =~ m/^1|yes|on|enabled$/) ? 'on' : 'off';
74 $disabled_functions = join(', ', split /[,;:]/, $disabled_functions);
75 - $open_basedir = join(':', split(/[,;:]/, $open_basedir));
76 + $open_basedir = join(':', split(/[,;:]/, $open_basedir . $autoprepath));
77
78 $OUT .=<<"_EOF" if ($version eq $PHP_VERSION);
79
80 @@ -67,6 +71,7 @@
81 php_admin_flag[session.cookie_httponly] = on
82 php_admin_flag[allow_url_include] = off
83 php_admin_value[session.save_handler] = files
84 +php_admin_value[auto_prepend_file] = $autoprep
85 php_admin_value[open_basedir] = $open_basedir
86
87 _EOF
88 diff -Nur smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings
89 --- smeserver-php-3.0.0.old/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings 2020-03-25 23:28:48.424000000 -0400
90 +++ smeserver-php-3.0.0/root/etc/e-smith/templates/etc/php-fpm.d/www.conf/00Default50Settings 2020-03-26 00:02:32.791000000 -0400
91 @@ -8,7 +8,7 @@
92 php_admin_value[max_input_time] = { $MaxInputTime }
93 {
94 if ($OpenBasedir){
95 - $OUT .= "php_admin_value[open_basedir] = " . join( ':', (split(/[;,:]/, $OpenBasedir)) ) . "\n";
96 + $OUT .= "php_admin_value[open_basedir] = " . join( ':', (split(/[;,:]/, "$OpenBasedir,/usr/share/php/")) ) . "\n";
97 }
98 if ($DisableFunctions){
99 $OUT .= "php_admin_value[disable_functions] = " . join( ', ', (split(/[;,:]/, $DisableFunctions)) ) . "\n";
100 @@ -18,4 +18,5 @@
101 php_admin_flag[file_upload] = { $FileUpload }
102 php_admin_flag[session.cookie_httponly] = on
103 php_admin_flag[allow_url_include] = off
104 +php_admin_value[auto_prepend_file] = /usr/share/pear/auth_translation.php
105 php_admin_value[session.save_handler] = files

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