From: Bert Hubert Date: Sun, 29 May 2011 08:09:28 +0000 (+0000) Subject: Like many others, Charles Sprickman discovered powerdns gsqlite3 needs write access... X-Git-Tag: auth-3.0~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ba71c508285eb132704f28cdfebe99e1aba4bbd7;p=pdns Like many others, Charles Sprickman discovered powerdns gsqlite3 needs write access to the directory containing the sqlite3 database. There was no useful error reporting if this was wrong. This commit fixes the problem. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2202 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/modules/gsqlite3backend/ssqlite3.cc b/modules/gsqlite3backend/ssqlite3.cc index f376fc2cc..2f32ef1c8 100644 --- a/modules/gsqlite3backend/ssqlite3.cc +++ b/modules/gsqlite3backend/ssqlite3.cc @@ -116,7 +116,13 @@ bool SSQLite3::getRow( row_t & row ) m_pStmt = NULL; return false; } - + + if(rc == SQLITE_CANTOPEN) { + string error ="CANTOPEN error in sqlite3, often caused by unwritable sqlite3 directory: "+string(sqlite3_errmsg(m_pDB)); + sqlite3_finalize(m_pStmt); + throw sPerrorException(error); + } + // Something went wrong, complain. throw sPerrorException( "Error while retrieving SQLite query results: "+string(sqlite3_errmsg(m_pDB) ));