adamwill pushed to owncloud (epel7). "disable the htaccess fiddling stuff harder (..more)"

notifications at fedoraproject.org notifications at fedoraproject.org
Mon May 4 21:46:54 UTC 2015


>From 75987018e6a7d12d21ec7ffa203103ebb7aedc7a Mon Sep 17 00:00:00 2001
From: Adam Williamson <awilliam at redhat.com>
Date: Mon, 4 May 2015 14:41:15 -0700
Subject: disable the htaccess fiddling stuff harder

Don't respect the check_for_working_htaccess variable, just
unconditionally remove this crap. This is less upstreamable,
but we only started setting the config value to 0 OOTB a few
months ago, so several people encountered breakage with the
weaker version.

diff --git a/0001-setup-allow-disabling-all-htaccess-fiddling.patch b/0001-setup-allow-disabling-all-htaccess-fiddling.patch
deleted file mode 100644
index 51ca69e..0000000
--- a/0001-setup-allow-disabling-all-htaccess-fiddling.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-From d58104d6f7e8d2906a1a3c9d4662f36b356c8e63 Mon Sep 17 00:00:00 2001
-From: Adam Williamson <awilliam at redhat.com>
-Date: Sat, 21 Feb 2015 16:53:03 -0800
-Subject: [PATCH] setup: allow disabling all htaccess fiddling
-
-Distribution-packaged ownCloud, and other deployments where
-the admin/deployer has sufficient control over the system, can
-do this stuff much better. For instance, a sensible packaged
-OC will use a directory that is not accessible via the web
-server *at all* as the data directory (rendering it unnecessary
-to attempt to 'protect' it with a .htaccess file) and will
-include the 403/404 ErrorDocument directives, along with other
-appropriate Apache configuration directives, in a config file
-stored (again) outside the web-served locations.
-
-This makes both of setup's attempts to fiddle about with
-.htaccess stuff optional - they won't happen if the config
-directive check_for_working_htaccess is set to false. We
-could maybe keep that directive with its current meaning and
-add a new one for 'don't mess with htaccess files at all',
-but I think anyone who's setting it to false probably wants
-this behaviour.
----
- lib/private/setup.php   | 6 +++++-
- lib/private/updater.php | 6 +++++-
- 2 files changed, 10 insertions(+), 2 deletions(-)
-
-diff --git a/lib/private/setup.php b/lib/private/setup.php
-index e3a29b6..7707c01 100644
---- a/lib/private/setup.php
-+++ b/lib/private/setup.php
-@@ -231,7 +231,11 @@ class OC_Setup {
- 			file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.ocdata', '');
- 
- 			// Update htaccess files for apache hosts
--			if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
-+			if (
-+				isset($_SERVER['SERVER_SOFTWARE']) &&
-+				strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') &&
-+				OC::$server->getConfig()->getSystemValue('check_for_working_htaccess', true)
-+			) {
- 				self::updateHtaccess();
- 				self::protectDataDirectory();
- 			}
-diff --git a/lib/private/updater.php b/lib/private/updater.php
-index fb41e2d..f7933f1 100644
---- a/lib/private/updater.php
-+++ b/lib/private/updater.php
-@@ -188,7 +188,11 @@ class Updater extends BasicEmitter {
- 		}
- 
- 		// Update htaccess files for apache hosts
--		if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
-+		if (
-+			isset($_SERVER['SERVER_SOFTWARE']) &&
-+			strstr($_SERVER['SERVER_SOFTWARE'], 'Apache') &&
-+			\OC_Config::getValue('check_for_working_htaccess', true)
-+		) {
- 			try {
- 				\OC_Setup::updateHtaccess();
- 			} catch (\Exception $e) {
--- 
-2.3.0
-
diff --git a/owncloud-8.0.3-dont_update_htacess.patch b/owncloud-8.0.3-dont_update_htacess.patch
new file mode 100644
index 0000000..db34f90
--- /dev/null
+++ b/owncloud-8.0.3-dont_update_htacess.patch
@@ -0,0 +1,37 @@
+diff --git a/lib/private/setup.php b/lib/private/setup.php
+index e3a29b6..7eeeb92 100644
+--- a/lib/private/setup.php
++++ b/lib/private/setup.php
+@@ -230,12 +230,6 @@ class OC_Setup {
+ 			// out that this is indeed an ownCloud data directory
+ 			file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.ocdata', '');
+ 
+-			// Update htaccess files for apache hosts
+-			if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
+-				self::updateHtaccess();
+-				self::protectDataDirectory();
+-			}
+-
+ 			//and we are done
+ 			OC_Config::setValue('installed', true);
+ 		}
+diff --git a/lib/private/updater.php b/lib/private/updater.php
+index 08731c7..2b722e3 100644
+--- a/lib/private/updater.php
++++ b/lib/private/updater.php
+@@ -202,15 +202,6 @@ class Updater extends BasicEmitter {
+ 			throw new \Exception('Updates between multiple major versions are unsupported.');
+ 		}
+ 
+-		// Update htaccess files for apache hosts
+-		if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) {
+-			try {
+-				\OC_Setup::updateHtaccess();
+-			} catch (\Exception $e) {
+-				throw new \Exception($e->getMessage());
+-			}
+-		}
+-
+ 		// create empty file in data dir, so we can later find
+ 		// out that this is indeed an ownCloud data directory
+ 		// (in case it didn't exist before)
diff --git a/owncloud.spec b/owncloud.spec
index f50e457..52b233e 100644
--- a/owncloud.spec
+++ b/owncloud.spec
@@ -1,6 +1,6 @@
 Name:           owncloud
 Version:        8.0.3
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Private file sync and share server
 
 License:        AGPLv3+ and MIT and BSD and CC-BY and CC-BY-SA and GPLv3 and Public Domain and (MPLv1.1 or GPLv2+ or LGPLv2+) and (MIT or GPL+) and (MIT or GPLv2) and ASL 2.0 and LGPLv3
@@ -61,7 +61,7 @@ Patch6:        0001-drop-AWS-autoloader.patch
 Patch7:        owncloud-8.0.0-disable_minify.patch
 # Stop OC from trying to do stuff to .htaccess files. Just calm down, OC.
 # Distributors are on the case.
-Patch8:         0001-setup-allow-disabling-all-htaccess-fiddling.patch
+Patch8:         owncloud-8.0.3-dont_update_htacess.patch
 
 BuildArch:      noarch
 
@@ -465,6 +465,9 @@ fi
 
 
 %changelog
+* Mon May 04 2015 Adam Williamson <awilliam at redhat.com> - 8.0.3-2
+- disable the htaccess fiddling stuff harder
+
 * Fri May 01 2015 Adam Williamson <awilliam at redhat.com> - 8.0.3-1
 - new release 8.0.3
 
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/owncloud.git/commit/?h=epel7&id=75987018e6a7d12d21ec7ffa203103ebb7aedc7a


More information about the scm-commits mailing list