From 3e756407a0e2cd2da68a59b0ea50acd72fe4d415 Mon Sep 17 00:00:00 2001 From: Georg Ehrke Date: Thu, 23 Feb 2012 18:23:09 +0100 Subject: [PATCH] check if the tempfile was created successfully --- lib/db.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/db.php b/lib/db.php index 9d3c20e0145..4c17cd0dbd1 100644 --- a/lib/db.php +++ b/lib/db.php @@ -318,6 +318,9 @@ class OC_DB { // Make changes and save them to a temporary file $file2 = tempnam( get_temp_dir(), 'oc_db_scheme_' ); + if($file2 == ''){ + die('could not create tempfile in get_temp_dir() - aborting'); + } $content = str_replace( '*dbname*', $CONFIG_DBNAME, $content ); $content = str_replace( '*dbprefix*', $CONFIG_DBTABLEPREFIX, $content ); if( $CONFIG_DBTYPE == 'pgsql' ){ //mysql support it too but sqlite doesn't -- 2.39.5