@@ -2196,50 +2196,49 @@ function getinitcommand($servicename, $action, $init_script_directory = '', $che
21962196 }
21972197 }
21982198
2199- function getopensslversion ($ get_minor = false ) {
2200- global $ app ;
2201- if ($ this ->is_installed ('openssl ' )) $ cmd = 'openssl version ' ;
2202- else {
2199+ function getopensslversion ($ get_minor = false ) {
2200+ global $ app ;
2201+ if ($ this ->is_installed ('openssl ' )) $ cmd = 'openssl version ' ;
2202+ else {
22032203 $ app ->log ("Could not check OpenSSL version, openssl not found. " , LOGLEVEL_DEBUG );
2204- return '1.0.1 ' ;
2205- }
2204+ return '1.0.1 ' ;
2205+ }
22062206
22072207 exec ($ cmd , $ output , $ return_var );
2208- if ($ return_var != 0 || !$ output [0 ]) {
2208+ if ($ return_var != 0 || !$ output [0 ]) {
22092209 $ app ->log ("Could not check OpenSSL version, openssl did not return any data. " , LOGLEVEL_WARN );
2210- return '1.0.1 ' ;
2211- }
2212- if (preg_match ('/OpenSSL\s*(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i ' , $ output [0 ], $ matches )) {
2210+ return '1.0.1 ' ;
2211+ }
2212+ if (preg_match ('/OpenSSL\s*(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i ' , $ output [0 ], $ matches )) {
22132213 return $ matches [1 ] . (isset ($ matches [3 ]) ? '. ' . $ matches [3 ] : '' ) . (isset ($ matches [5 ]) && $ get_minor == true ? '. ' . $ matches [5 ] : '' );
2214- } else {
2214+ } else {
22152215 $ app ->log ("Could not check OpenSSL version, did not find version string in openssl output. " , LOGLEVEL_WARN );
22162216 return '1.0.1 ' ;
2217- }
2218-
2217+ }
22192218 }
22202219
22212220 function getnginxversion ($ get_minor = false ) {
22222221 global $ app ;
22232222
22242223 if ($ this ->is_installed ('nginx ' )) $ cmd = 'nginx -v 2>&1 ' ;
22252224 else {
2226- $ app ->log ("Could not check Nginx version, nginx not found. " , LOGLEVEL_DEBUG );
2227- return false ;
2228- }
2225+ $ app ->log ("Could not check Nginx version, nginx not found. " , LOGLEVEL_DEBUG );
2226+ return false ;
2227+ }
22292228
22302229 exec ($ cmd , $ output , $ return_var );
22312230
22322231 if ($ return_var != 0 || !$ output [0 ]) {
2233- $ app ->log ("Could not check Nginx version, nginx did not return any data. " , LOGLEVEL_WARN );
2234- return false ;
2232+ $ app ->log ("Could not check Nginx version, nginx did not return any data. " , LOGLEVEL_WARN );
2233+ return false ;
22352234 }
22362235
22372236 if (preg_match ('/nginx version: nginx\/\s*(\d+)(\.(\d+)(\.(\d+))*)?(\D|$)/i ' , $ output [0 ], $ matches )) {
22382237 return $ matches [1 ] . (isset ($ matches [3 ]) ? '. ' . $ matches [3 ] : '' ) . (isset ($ matches [5 ]) && $ get_minor == true ? '. ' . $ matches [5 ] : '' );
2239- } else {
2240- $ app ->log ("Could not check Nginx version, did not find version string in nginx output. " , LOGLEVEL_WARN );
2241- return false ;
2242- }
2238+ } else {
2239+ $ app ->log ("Could not check Nginx version, did not find version string in nginx output. " , LOGLEVEL_WARN );
2240+ return false ;
2241+ }
22432242 }
22442243
22452244 function getapacheversion ($ get_minor = false ) {
@@ -2497,7 +2496,7 @@ public function create_jailkit_user($username, $home_dir, $user_home_dir, $shell
24972496
24982497 public function create_jailkit_chroot ($ home_dir , $ app_sections = array (), $ options = array ()) {
24992498 global $ app ;
2500- $ app ->log ("create_jailkit_chroot: called for home_dir $ home_dir with options: " . print_r ($ options , true ), LOGLEVEL_DEBUG );
2499+ $ app ->log ("create_jailkit_chroot: called for home_dir $ home_dir with options: " . print_r ($ options , true ), LOGLEVEL_DEBUG );
25012500
25022501 // Disallow operating on root directory
25032502 if (realpath ($ home_dir ) == '/ ' ) {
@@ -2574,7 +2573,7 @@ public function create_jailkit_chroot($home_dir, $app_sections = array(), $optio
25742573
25752574 public function create_jailkit_programs ($ home_dir , $ programs = array (), $ options = array ()) {
25762575 global $ app ;
2577- $ app ->log ("create_jailkit_programs: called for home_dir $ home_dir with options: " . print_r ($ options , true ), LOGLEVEL_DEBUG );
2576+ $ app ->log ("create_jailkit_programs: called for home_dir $ home_dir with options: " . print_r ($ options , true ), LOGLEVEL_DEBUG );
25782577
25792578 // Disallow operating on root directory
25802579 if (realpath ($ home_dir ) == '/ ' ) {
@@ -2652,7 +2651,7 @@ public function create_jailkit_programs($home_dir, $programs = array(), $options
26522651 public function update_jailkit_chroot ($ home_dir , $ sections = array (), $ programs = array (), $ options = array ()) {
26532652 global $ app ;
26542653
2655- $ app ->log ("update_jailkit_chroot called for $ home_dir with options " .print_r ($ options , true ), LOGLEVEL_DEBUG );
2654+ $ app ->log ("update_jailkit_chroot called for $ home_dir with options " .print_r ($ options , true ), LOGLEVEL_DEBUG );
26562655 $ app ->uses ('ini_parser ' );
26572656
26582657 // Disallow operating on root directory
@@ -2735,7 +2734,7 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
27352734
27362735 // save list of hardlinked files
27372736 if (!(in_array ('hardlink ' , $ opts ) || in_array ('allow_hardlink ' , $ options ))) {
2738- $ app ->log ("update_jailkit_chroot: searching for hardlinks in $ jail_dir " , LOGLEVEL_DEBUG );
2737+ $ app ->log ("update_jailkit_chroot: searching for hardlinks in $ jail_dir " , LOGLEVEL_DEBUG );
27392738 $ find_multiple_links = function ( $ path ) use ( &$ find_multiple_links ) {
27402739 $ found = array ();
27412740 if (is_dir ($ path ) && !is_link ($ path )) {
@@ -2762,8 +2761,9 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
27622761
27632762 // remove broken symlinks a second time after hardlink cleanup
27642763 $ this ->remove_broken_symlinks ($ jail_dir , true );
2764+ } else {
2765+ $ app ->log ("update_jailkit_chroot: NOT searching for hardlinks in $ jail_dir, options: " .print_r ($ options , true ), LOGLEVEL_DEBUG );
27652766 }
2766- else { $ app ->log ("update_jailkit_chroot: NOT searching for hardlinks in $ jail_dir, options: " .print_r ($ options , true ), LOGLEVEL_DEBUG ); }
27672767 }
27682768
27692769 foreach ($ multiple_links as $ file ) {
@@ -2773,7 +2773,7 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
27732773
27742774 $ cmd = 'jk_update --jail=? ' . $ jk_update_args . $ skips ;
27752775 $ this ->exec_safe ($ cmd , $ home_dir );
2776- $ app ->log ('jk_update returned: ' .print_r ($ this ->_last_exec_out , true ), LOGLEVEL_DEBUG );
2776+ $ app ->log ('jk_update returned: ' .print_r ($ this ->_last_exec_out , true ), LOGLEVEL_DEBUG );
27772777 # handle jk_update output
27782778 foreach ($ this ->_last_exec_out as $ line ) {
27792779 # jk_update sample output:
@@ -2791,10 +2791,10 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
27912791 if (preg_match ('@^(?:[^ ]+ ){6}(?:.+)( ' .preg_quote ($ home_dir , '@ ' ).'.+)@ ' , $ line , $ matches )) {
27922792 # remove deprecated files that jk_update failed to remove
27932793 if (is_file ($ matches [1 ]) || is_link ($ matches [1 ])) {
2794- $ app ->log ("update_jailkit_chroot: removing deprecated file which jk_update failed to remove: " .$ matches [1 ], LOGLEVEL_DEBUG );
2794+ $ app ->log ("update_jailkit_chroot: removing deprecated file which jk_update failed to remove: " .$ matches [1 ], LOGLEVEL_DEBUG );
27952795 unlink ($ matches [1 ]);
27962796 } elseif (is_dir ($ matches [1 ]) && !is_link ($ matches [1 ])) {
2797- $ app ->log ("update_jailkit_chroot: removing deprecated directory which jk_update failed to remove: " .$ matches [1 ], LOGLEVEL_DEBUG );
2797+ $ app ->log ("update_jailkit_chroot: removing deprecated directory which jk_update failed to remove: " .$ matches [1 ], LOGLEVEL_DEBUG );
27982798 $ this ->rmdir ($ matches [1 ], true );
27992799 } else {
28002800 # unhandled error
@@ -2901,7 +2901,7 @@ public function update_jailkit_chroot($home_dir, $sections = array(), $programs
29012901 public function delete_jailkit_chroot ($ home_dir , $ options = array ()) {
29022902 global $ app ;
29032903
2904- $ app ->log ("delete_jailkit_chroot called for $ home_dir with options " .print_r ($ options , true ), LOGLEVEL_DEBUG );
2904+ $ app ->log ("delete_jailkit_chroot called for $ home_dir with options " .print_r ($ options , true ), LOGLEVEL_DEBUG );
29052905 $ app ->uses ('ini_parser ' );
29062906
29072907 // Disallow operating on root directory
0 commit comments