From 8b0088fd8d1774f4bdf5ae345ab5ad2da1eaedaf Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 13:23:05 -0500 Subject: Change gallery/bin -> gallery3/bin in the comment since I suspect most people don't change the name of the directory. Follow-on to 1d7f5e3ab117a6cce8f2a1d3de5e311b74dbee81 for #1935 --- modules/gallery/views/admin_movies.html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gallery/views/admin_movies.html.php b/modules/gallery/views/admin_movies.html.php index e7810711..242a4349 100644 --- a/modules/gallery/views/admin_movies.html.php +++ b/modules/gallery/views/admin_movies.html.php @@ -8,7 +8,7 @@

static build of FFmpeg from one of the links here.", array("url" => "http://ffmpeg.org/download.html")) ?> - +

-- cgit v1.2.3 From 1748aae9d1b3735747555025e7c202b895837625 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 13:23:39 -0500 Subject: Create an empty and secure gallery3/bin directory for use with the new system::find_binary code. Fixes #2004. --- bin/.htaccess | 8 ++++++++ bin/README | 5 +++++ 2 files changed, 13 insertions(+) create mode 100755 bin/.htaccess create mode 100644 bin/README diff --git a/bin/.htaccess b/bin/.htaccess new file mode 100755 index 00000000..a3815526 --- /dev/null +++ b/bin/.htaccess @@ -0,0 +1,8 @@ +DirectoryIndex .htaccess +SetHandler Gallery_Security_Do_Not_Remove +Options None + +RewriteEngine off + +Order allow,deny +Deny from all diff --git a/bin/README b/bin/README new file mode 100644 index 00000000..ec09639f --- /dev/null +++ b/bin/README @@ -0,0 +1,5 @@ +This directory contains utility software that Gallery uses to perform +image manipulation and other useful functions. It should not be +accessible from a web browser, and by default it's empty. Gallery +will instruct you when it's appropriate to download software and +install it here. -- cgit v1.2.3 From 016335fb8983ae90f559ddc0ec04473dbd437b63 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 15 Feb 2013 11:24:48 -0700 Subject: Automated update of .build_number to 348 for branch master Last update: 5b6c138da1e53e93e4de8079885fcef29d12e673 (2 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index 6f2a9ebc..fdf1d159 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=347 +build_number=348 -- cgit v1.2.3 From 7bdccade98e76df3a7830bc45bc42321a77c709a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 19:09:06 -0500 Subject: Every 500th request prune a single old file from var/tmp and var/logs. Might not be aggressive enough. Fixes #2005. --- modules/gallery/helpers/gallery_event.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index 54c60296..eb54e521 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -36,6 +36,34 @@ class gallery_event_Core { locales::set_request_locale(); } + static function gallery_shutdown() { + // Every 500th request, do a pass over var/logs and var/tmp and delete old files. + // Limit ourselves to deleting a single file so that we don't spend too much CPU + // time on it. As long as servers call this at least twice a day they'll eventually + // wind up with a clean var/logs directory because we only create 1 file a day there. + // var/tmp might be stickier because theoretically we could wind up spamming that + // dir with a lot of files. But let's start with this and refine as we go. + if (!(rand() % 500)) { + // Note that this code is roughly duplicated in gallery_event::gallery_shutdown + $threshold = time() - 1209600; // older than 2 weeks + foreach(array("logs", "tmp") as $dir) { + $dir = VARPATH . $dir; + if ($dh = opendir($dir)) { + while (($file = readdir($dh)) !== false) { + if ($file[0] == ".") { + continue; + } + + if (filemtime("$dir/$file") <= $threshold) { + unlink("$dir/$file"); + break; + } + } + } + } + } + } + static function user_deleted($user) { $admin = identity::admin_user(); if (!empty($admin)) { // could be empty if there is not identity provider -- cgit v1.2.3 From c97fe4bcdde3201ca416d61e38cd8afb4503dca2 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 15 Feb 2013 17:10:08 -0700 Subject: Automated update of .build_number to 349 for branch master Last update: 5b6c138da1e53e93e4de8079885fcef29d12e673 (4 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index fdf1d159..b9f67ef7 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=348 +build_number=349 -- cgit v1.2.3 From 0dd12caa6f4c0452167b0e621a01bee28e71b0af Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 19:12:08 -0500 Subject: Follow-on to 7bdccade98e76df3a7830bc45bc42321a77c709a - point out that there's duplicated code in gallery_event. --- modules/gallery/helpers/gallery_task.php | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 856d2639..37de2f93 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -281,6 +281,7 @@ class gallery_task_Core { switch ($task->get("mode", "init")) { case "init": $threshold = time() - 1209600; // older than 2 weeks + // Note that this code is roughly duplicated in gallery_event::gallery_shutdown foreach(array("logs", "tmp") as $dir) { $dir = VARPATH . $dir; if ($dh = opendir($dir)) { -- cgit v1.2.3 From 9346503c62a14a738dfa2efe24b8831275b73f44 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 15 Feb 2013 17:12:30 -0700 Subject: Automated update of .build_number to 350 for branch master Last update: c97fe4bcdde3201ca416d61e38cd8afb4503dca2 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index b9f67ef7..d497add5 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=349 +build_number=350 -- cgit v1.2.3 From 96ad7789c84b5b81320f9cb94b4c8cb4e10ad92f Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Fri, 15 Feb 2013 16:15:40 -0800 Subject: Follow-on to 7bdccade98e76df3a7830bc45bc42321a77c709a to exclude directories for now. --- modules/gallery/helpers/gallery_event.php | 5 +++++ modules/gallery/helpers/gallery_task.php | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/modules/gallery/helpers/gallery_event.php b/modules/gallery/helpers/gallery_event.php index eb54e521..26432ef5 100644 --- a/modules/gallery/helpers/gallery_event.php +++ b/modules/gallery/helpers/gallery_event.php @@ -54,6 +54,11 @@ class gallery_event_Core { continue; } + // Ignore directories for now, but we should really address them in the long term. + if (is_dir("$dir/$file")) { + continue; + } + if (filemtime("$dir/$file") <= $threshold) { unlink("$dir/$file"); break; diff --git a/modules/gallery/helpers/gallery_task.php b/modules/gallery/helpers/gallery_task.php index 37de2f93..a79cb2d5 100644 --- a/modules/gallery/helpers/gallery_task.php +++ b/modules/gallery/helpers/gallery_task.php @@ -290,6 +290,11 @@ class gallery_task_Core { continue; } + // Ignore directories for now, but we should really address them in the long term. + if (is_dir("$dir/$file")) { + continue; + } + if (filemtime("$dir/$file") <= $threshold) { $files[] = "$dir/$file"; } -- cgit v1.2.3 From eb5b99abb4fb50df2dc8e8125a4fc49a674bc423 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Fri, 15 Feb 2013 17:17:51 -0700 Subject: Automated update of .build_number to 351 for branch master Last update: 9346503c62a14a738dfa2efe24b8831275b73f44 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index d497add5..a12f908c 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=350 +build_number=351 -- cgit v1.2.3 From b0180288e049b472f3fefbfb28d7bed77e718b37 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sat, 16 Feb 2013 08:23:36 +0100 Subject: #1749, 1754, 1901 - revert two recent commits that check for Zend Guard obfuscation level support. This is not the root of the problem for all installs, and can trigger false positives that break previously-working installs... we'll have to find a better way. --- index.php | 7 ------- installer/installer.php | 5 ----- 2 files changed, 12 deletions(-) diff --git a/index.php b/index.php index c39452ea..5f6d231b 100644 --- a/index.php +++ b/index.php @@ -29,13 +29,6 @@ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') { exit("Gallery is not supported on Windows (PHP reports that you're using: " . PHP_OS . ")"); } -// Gallery doesn't use Zend Guard code obfuscation, and Kohana 2.4 will not work if level is 3+. -if (function_exists("zend_current_obfuscation_level") && (zend_current_obfuscation_level() >= 3)) { - exit("Gallery doesn't use Zend Guard code obfuscation, and is incompatible if it's running " . - "with a level of 3 or higher. For Gallery to run, please edit your main php.ini file and " . - "change/add the following line: 'zend_loader.obfuscation_level_support = 2'"); -} - // PHP 5.4 requires a timezone - if one isn't set date functions aren't going to work properly. // We'll log this once the logging system is initialized (in the gallery_event::gallery_ready). if (!ini_get("date.timezone")) { diff --git a/installer/installer.php b/installer/installer.php index 2b0f1452..4ce80ee7 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -243,11 +243,6 @@ class installer { $errors[] = "Gallery cannot function when PHP is in Safe Mode. Please disable safe mode."; } - if (function_exists("zend_current_obfuscation_level") && (zend_current_obfuscation_level() >= 3)) { - $errors[] = "Gallery doesn't use Zend Guard code obfuscation, and is incompatible if it's running " . - "with a level of 3 or higher. Please edit your main php.ini file and change/add the following line: 'zend_loader.obfuscation_level_support = 2'"; - } - return @$errors; } -- cgit v1.2.3 From 87d20c63af02ae573853da2cb82d7323a56677b5 Mon Sep 17 00:00:00 2001 From: Automatic Build Number Updater Date: Sat, 16 Feb 2013 12:42:07 -0700 Subject: Automated update of .build_number to 352 for branch master Last update: eb5b99abb4fb50df2dc8e8125a4fc49a674bc423 (1 commits ago) --- .build_number | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.build_number b/.build_number index a12f908c..d2d451a0 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=351 +build_number=352 -- cgit v1.2.3