aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2010-06-01 13:59:04 +0200
committerRobin Appelman <icewind1991@gmail.com>2010-06-01 13:59:04 +0200
commit43cabdb3f80406141aebc8ee652656ab508b5292 (patch)
tree55237229eab2f749d3651b4e15bcc5c4a8320890
parentca0744c0df9325a0f1cd6a1e7dd9cb4797a2a0a8 (diff)
downloadnextcloud-server-43cabdb3f80406141aebc8ee652656ab508b5292.tar.gz
nextcloud-server-43cabdb3f80406141aebc8ee652656ab508b5292.zip
better error messages if there are premission problems
-rwxr-xr-xinc/lib_base.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php
index 14b9aa10afc..666e0d6524c 100755
--- a/inc/lib_base.php
+++ b/inc/lib_base.php
@@ -83,7 +83,7 @@ oc_require_once('lib_connect.php');
if(!is_dir($CONFIG_DATADIRECTORY_ROOT)){
- mkdir($CONFIG_DATADIRECTORY_ROOT);
+ @mkdir($CONFIG_DATADIRECTORY_ROOT) or die("Can't create data directory ($CONFIG_DATADIRECTORY_ROOT), you can usually fix this by setting the owner of '$SERVERROOT' to the user that the web server uses (www-data for debian/ubuntu)");
}
if(OC_USER::isLoggedIn()){
//jail the user in a seperate data folder
@@ -160,13 +160,15 @@ class OC_UTIL {
global $CONFIG_DBNAME;
if($CONFIG_DBTYPE=='sqlite'){
$file=$SERVERROOT.'/'.$CONFIG_DBNAME;
- $prems=substr(decoct(fileperms($file)),-3);
- if(substr($prems,2,1)!='0'){
- @chmod($file,0660);
- clearstatcache();
+ if(file_exists($file)){
$prems=substr(decoct(fileperms($file)),-3);
if(substr($prems,2,1)!='0'){
- $error.='SQLite database file ('.$file.') is readable from the web<br/>';
+ @chmod($file,0660);
+ clearstatcache();
+ $prems=substr(decoct(fileperms($file)),-3);
+ if(substr($prems,2,1)!='0'){
+ $error.='SQLite database file ('.$file.') is readable from the web<br/>';
+ }
}
}
}