/[smecontribs]/rpms/phpki-ng/contribs10/phpki-ng-0.84-fix-html-directory-check.patch
ViewVC logotype

Contents of /rpms/phpki-ng/contribs10/phpki-ng-0.84-fix-html-directory-check.patch

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


Revision 1.1 - (show annotations) (download)
Thu Mar 18 12:16:09 2021 UTC (3 years, 8 months ago) by jcrisp
Branch: MAIN
CVS Tags: phpki-ng-0_84-15_el7_sme, phpki-ng-0_84-11_el7_sme, phpki-ng-0_84-14_el7_sme, phpki-ng-0_84-13_el7_sme, phpki-ng-0_84-16_el7_sme, phpki-ng-0_84-10_el7_sme, phpki-ng-0_84-12_el7_sme, phpki-ng-0_84-7_el7_sme, phpki-ng-0_84-6_el7_sme, phpki-ng-0_84-9_el7_sme, phpki-ng-0_84-8_el7_sme, HEAD
Error occurred while calculating annotation data.
* Thu Mar 18 2021 John Crisp <jcrisp@safeandsoundit.co.uk> 0.84-6.sme
- Update html header info
- Remove obsolete align
- Remove accidentally duplicated html
- Fix typo
- Fix directory check
- move function flush_exec to functions file

1 diff -ruN phpki-ng.old/phpki-ng-0.84/include/common.php phpki-ng/phpki-ng-0.84/include/common.php
2 --- phpki-ng.old/phpki-ng-0.84/include/common.php 2021-03-18 13:01:29.070643552 +0100
3 +++ phpki-ng/phpki-ng-0.84/include/common.php 2021-03-18 13:01:57.166094491 +0100
4 @@ -38,7 +38,7 @@
5 ?>
6 <!DOCTYPE html>
7 <head>
8 - <meta charset="utf-8">
9 + <meta http-equiv="content-type" content="text/html; charset=utf-8" />
10 <title>PHPki: <?php echo $title?> </title>
11 <link rel="stylesheet" type="text/css" href="<?php echo $style_css?>">
12 <script type="text/javascript" language="javascript">
13 @@ -130,7 +130,7 @@
14 <?php
15 }
16
17 - ?><hr style="width:99%; align:left; color:#99caff;" /><?php
18 + ?><hr style="width:99%; color:#99caff;" /><?php
19 }
20
21
22 diff -ruN phpki-ng.old/phpki-ng-0.84/include/my_functions.php phpki-ng/phpki-ng-0.84/include/my_functions.php
23 --- phpki-ng.old/phpki-ng-0.84/include/my_functions.php 2021-03-18 13:01:29.113644244 +0100
24 +++ phpki-ng/phpki-ng-0.84/include/my_functions.php 2021-03-18 13:01:57.166094491 +0100
25 @@ -305,3 +305,27 @@
26 return null;
27 }
28 }
29 +
30 +# Used in setup
31 +function flush_exec($command, $line_length = 200)
32 +{
33 + $handle = popen("$command 2>&1", 'r');
34 +
35 + $line = '';
36 + while (! feof($handle)) {
37 + $chr = fread($handle, 1);
38 + $line .= $chr;
39 + if ($chr == "\n") {
40 + print str_replace("\n", "<br>\n", $line);
41 + $line = '';
42 + flush();
43 + } elseif (strlen($line) > $line_length) {
44 + print $line."<br>\n";
45 + $line = '';
46 + flush();
47 + }
48 + }
49 + print $line."<br>\n";
50 + flush();
51 + return;
52 +}
53 diff -ruN phpki-ng.old/phpki-ng-0.84/setup.php-presetup phpki-ng/phpki-ng-0.84/setup.php-presetup
54 --- phpki-ng.old/phpki-ng-0.84/setup.php-presetup 2021-03-18 13:01:29.116644288 +0100
55 +++ phpki-ng/phpki-ng-0.84/setup.php-presetup 2021-03-18 13:01:57.166094491 +0100
56 @@ -3,29 +3,6 @@
57 include('./include/my_functions.php');
58 include('./include/common.php');
59
60 -function flush_exec($command, $line_length = 200)
61 -{
62 - $handle = popen("$command 2>&1", 'r');
63 -
64 - $line = '';
65 - while (! feof($handle)) {
66 - $chr = fread($handle, 1);
67 - $line .= $chr;
68 - if ($chr == "\n") {
69 - print str_replace("\n", "<br>\n", $line);
70 - $line = '';
71 - flush();
72 - } elseif (strlen($line) > $line_length) {
73 - print $line."<br>\n";
74 - $line = '';
75 - flush();
76 - }
77 - }
78 - print $line."<br>\n";
79 - flush();
80 - return;
81 -}
82 -
83 $version = PHPKI_VERSION;
84
85 # Who does the webserver run as (apache,www-data,etc)?
86 @@ -161,12 +138,16 @@
87 $er .= 'E-mail address ('. htvar($contact) . ') may be invalid.<br>';
88 }
89
90 - if (strpos($store_dir, $_SERVER['DOCUMENT_ROOT']) === 0) {
91 - $er .= 'Store directory must exist somewhere outside of DOCUMENT_ROOT ('.$_SERVER['DOCUMENT_ROOT'].').<br>';
92 + // reetp this was the wrong way round - swapped
93 + // strpos ($haystack, $needle)
94 + if (strpos($_SERVER['DOCUMENT_ROOT'], $store_dir) === 0) {
95 + $er .= 'Store directory ('.$store_dir.') must exist somewhere outside of DOCUMENT_ROOT ('.$_SERVER['DOCUMENT_ROOT'].').<br>';
96 }
97
98 - if (strpos($store_dir, dirname($_SERVER['SCRIPT_FILENAME'])) === 0) {
99 - $er .= 'Store directory cannot exist within the PHPki installation directory ('.dirname($_SERVER['SCRIPT_FILENAME']).').<br>';
100 + // reetp this was the wrong way round - swapped
101 + // strpos ($haystack, $needle)
102 + if (strpos(dirname($_SERVER['SCRIPT_FILENAME']), $store_dir) === 0) {
103 + $er .= 'Store directory ('.$store_dir.') cannot exist within the PHPki installation directory ('.dirname($_SERVER['SCRIPT_FILENAME']).').<br>';
104 }
105
106 if (! $er) {
107 @@ -184,10 +165,10 @@
108 $er .= "The store directory \"$store_dir\" is not readable by the web server user \"$uname\"<br>";
109 }
110 if (! is_writeable($store_dir)) {
111 - $er .= "The store directory \"$store_dir\: is not writeable by the web server user \"$uname\"<br>";
112 + $er .= "The store directory \"$store_dir\: is not writable by the web server user \"$uname\"<br>";
113 }
114 } else {
115 - $er .= "Store directory \"$store_dir\" does not exist. You will have to manually create it as desribed in the setup form.<br>";
116 + $er .= "Store directory \"$store_dir\" does not exist. You will have to manually create it as described in the setup form.<br>";
117 }
118 }
119
120 @@ -1227,9 +1208,6 @@
121 This may take a few minutes. Please do not interrupt the process.....</center>
122 </p>
123
124 - <p><center><font color=red>Please click the Submit button ONCE and be patient.</font><br />
125 - This may take a few minutes. Please do not interrupt the process.....</center>
126 - </p>
127 <p>
128 <center><input style="border: 1px solid red; padding: 10px;" type=submit name=submit value=Submit></center>
129 <input type=hidden name=stage value='validate'>

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