Skip to content
Snippets Groups Projects
Commit 43cabdb3 authored by Robin Appelman's avatar Robin Appelman
Browse files

better error messages if there are premission problems

parent ca0744c0
No related branches found
No related tags found
No related merge requests found
......@@ -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,6 +160,7 @@ class OC_UTIL {
global $CONFIG_DBNAME;
if($CONFIG_DBTYPE=='sqlite'){
$file=$SERVERROOT.'/'.$CONFIG_DBNAME;
if(file_exists($file)){
$prems=substr(decoct(fileperms($file)),-3);
if(substr($prems,2,1)!='0'){
@chmod($file,0660);
......@@ -170,6 +171,7 @@ class OC_UTIL {
}
}
}
}
$prems=substr(decoct(fileperms($CONFIG_DATADIRECTORY_ROOT)),-3);
if(substr($prems,-1)!='0'){
chmodr($CONFIG_DATADIRECTORY_ROOT,0770);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment