diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-03-14 13:03:18 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-03-14 15:36:35 +0100 |
commit | 3c46dcd7ddde403cdc89abdaabd3879fc71d39b9 (patch) | |
tree | 12d793c2951e1a0b53e03356eefdce0457c1256a /lib/private/setup.php | |
parent | b92be2ef1cb59f251a6d48953f4cb8d5e0eb734f (diff) | |
download | nextcloud-server-3c46dcd7ddde403cdc89abdaabd3879fc71d39b9.tar.gz nextcloud-server-3c46dcd7ddde403cdc89abdaabd3879fc71d39b9.zip |
Added .ocdata file to check for data folder validity
In environments where the data folder is mount from another partition,
it is important to check that the data folder we see is actually the
real one. If the mount failed for some reasons, this fix will make
ownCloud temporarily unavailable instead of causing unpredictable
behavior.
Diffstat (limited to 'lib/private/setup.php')
-rw-r--r-- | lib/private/setup.php | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/private/setup.php b/lib/private/setup.php index 0d5bf424b33..b1061b3a25b 100644 --- a/lib/private/setup.php +++ b/lib/private/setup.php @@ -106,6 +106,10 @@ class OC_Setup { //guess what this does OC_Installer::installShippedApps(); + // create empty file in data dir, so we can later find + // out that this is indeed an ownCloud data directory + file_put_contents(OC_Config::getValue('datadirectory', OC::$SERVERROOT.'/data').'/.ocdata', ''); + //create htaccess files for apache hosts if (isset($_SERVER['SERVER_SOFTWARE']) && strstr($_SERVER['SERVER_SOFTWARE'], 'Apache')) { self::createHtaccess(); |